I'm not the same person, but I have a small notebook and pen. Any time I think "Shit, how am I going to remember this if I get interrupted right now?", I quickly scribble down as much as I can and continue working. This is invaluable when I do get interrupted.
I do this basically any time I feel like my short-term memory is overwhelmed with facts, and as a result the notebook has effectively become NVRAM for my brain.
This is the closest to what I do myself -- I always have pen and paper on my desk -- but the real issue is that I don't take a note when interrupted because of social pressures (its rude to ignore someone for a few seconds). I don't even do it for myself for self interruptions because I forget to.
That problem is solved through humility and social graces.
"Hold on a sec, I just wanna write down what I was doing so I don't lose my place."
If you want to add more, after writing it down, you can follow up with, "sorry to keep you waiting, but when I get interrupted I often forget some useful details about what I was working on, and I want to get that down before it leaves my head".
(The "when I get interrupted" is a bit of a cheeky way to point out "you are imposing on me, so the least you can do is allow me this".)
For me, a quick "hang on" or "sorry, one sec" acknowledges people enough that they don't feel ignored while I make my notes, and is also scripted enough that it doesn't usually knock the thoughts out of my head.
I'm not the person you asked, but I do the same using Emacs' org-mode[0], but there are many tools around such as the Leo Editor[1], or really, any editor with a decent markup language support will do.
I store all my org files in git repositories and sync them across devices, allowing me to work on multiple devices and worry less about losing a particular device.
Tried this for a while, but unless I have the window open, I don't use it. I use Wunderlist to track the "projects" that I have in my head at any point in time.
Pen and engineering paper, chronological with bullet points. When the paper is full, I copy any items that are not already checked off or canceled to the next piece of paper (or to a note taking application--still looking for a good one, trying out cherrytree). Any item that gets copied gets a line through it. Canceling an item is putting an X in front of it instead of checking it off. Old pages go into a 3 ring binder.
Items don't have to be tasks. They can be ideas or general notes.
Not the same person, but I keep a text file divided into two sections - "history" and "today"
The "today" section is a bulleted list of the things I think I'm working on today.
I add to it through the day as I get shoulder-tapped, or as I realize another important sub-task.
As I finish tasks, or at the end of the day, I move them up into the "history" section under the current date. Thursday: A, B, C
This is basically all of the "head state" in the infamous cartoon of how you ruin engineers lives by interrupting them. I feel that it allows me to be interrupted without losing import state, and it's also a ready-made "scrum status" of what I did yesterday, and an augment to my memory when someone asks me "did you change X?" for some micro-task that was too small to ticket.
I feel this has helped me be a more effective developer, in spite of my decaying memory, than I was when I tried to keep everything in my head. :)
I do this basically any time I feel like my short-term memory is overwhelmed with facts, and as a result the notebook has effectively become NVRAM for my brain.