As an "old" programmer who's still in the trenches, my secret to working around this problem is to take notes as I work. As you map things out, write it down. As you collect state/call stacks while debugging/tracing, write it down!
It's WAY easier to just consult your notes than to try to remember everything.
It's WAY easier to just consult your notes than to try to remember everything.