Part of that is meticulous notes on what I’m currently doing and planning to do, lots of “todo” comments and comments in general, etc.
The other part is just learning to live with interruptions through experience.
Some people might not have the same success, your mileage may vary.
That's how I deal with this. Seems to work. The wife is happy for the little bits of passing contact, while she remarks later how "out there somewhere" I've been all day. And then I summarize what I've been thinking about and genuinely listen and connect for our dedicated together-time.
There’s a point where you dont’ get it, but just follow what the other side is requesting, even if it doesn’t seem to make sense to you.
Ask her to imagine that her job is to do multiplication problems involving not-even-large (three digits, let's say) numbers without writing down any of the steps (so, mental math). She should be able to recognize that this is doable, but with a higher-than-average amount of concentration to keep track of the intermediate values, and that any breaks in concentration will very likely result in having to start over. Now tell her to imagine what "starting over" would mean if there were very large numbers involved, and lots of them.
Alternatively, you can relate it to an orgasm. Suppose she lays down to masturbate, and if she were allowed to continue without interruption it will take her <however long>. Let's say this time it's 7 minutes. Instead, though, at 6 and a half minutes in, someone rings the doorbell, and it's something where she has to stop and answer, but she can continue once the interruption is taken care of. So she was what would have been 30 seconds away before being interrupted. Ask her: does that mean she can just lay back down, pick up where she left off, and then 30 seconds later, boom, orgasm?
Another thing you could do is show her a piece of legislation and point out all the nested conditions. Have her read it to evaluate whether some use case is/isn't prohibited/punishable/protected/etc., forcing her to keep track of what it's saying to understand whether some condition holds at any given point.
Healthy relationships rely on mutual trust and mutual understanding.
If you are on this site, I imagine that your ability to be fully present in your job as you practice your craft is important to you. If you're talking about your girlfriend, I imagine that your ability to not be worrying about project timeline delays outside of work hours so you can be fully present with her outside of work hours is important to both of you. I imagine that it is important for you to have a relationship where you trust her to understand you and you trust her not to jump to a conclusion that you are an asshole.
I imagine those things are more important to you than the awkwardness, discomfort, and risk that comes with asking her to have a real serious conversation where you start by saying the things that matter to you.