The habit that halved my re-entry cost, and it costs about ninety seconds: write the landing note before you leave, not when you arrive.
Before switching away, write down three things where you will see them next time:
- What I was doing in one sentence
- The exact next action: not the goal, the literal next thing to type or open
- Anything I was holding in my head that is not written anywhere: the thing I was worried about, the idea I had not tested, the question I was going to ask someone
That third one is where most of the thirty minutes goes. Re-opening files is fast; reconstructing the thought you were mid-way through is slow, and it is the part that is nowhere on disk.
Why before rather than after: you have the context loaded right now and it costs you nothing. Tomorrow you have to rebuild it in order to write it down, which is the expense you are trying to avoid.
Two details that make it work:
Same place every time, per project. Top of a file, a note, whatever: the point is not hunting for it.
Write it even when you think you will remember. You will remember for about four hours. The note is for the version of you who has since done two other projects.