Many programming tasks, refactorings, and documentation writings are shallow work. Much of planning and preparing for deep work is shallow work in programming. Learning how to optimize the deep focus time is really helpful. Grease the gears, prime the pump, etc. etc.
There is wisdom in acknowledging a particular mental state and understanding it, but it is also wise to know how to guide your mind to the state you want when you can best use it based on your schedule and other factors. There is a lot of push and pull here, but discipline in habits will let you control the monkey mind, as the author calls it, in my experience. Though I think of my "me" as a monkey and the rest of it as an elephant to properly put it in scale (thanks Joscha Bach + Lex Fridman). The monkey tries its best to guide the elephant to the right place :)