precisely. And for me I am at my most vulnerable when I am context-switching for this reason.
One of the most important keys to keep in mind is: always have a clear, delineated next action. Such that no thought is even necessary to know what you need to do. And plan the next step out /before/ you need to perform it, not in the moment of.