Couldn't agree more, I also can't reliably track the context switches when contracting. The only thing that works for me is to let my app give me a reminder every few minutes. I used Toggl and set it to 15 minutes. It's annoying most of the time, but it also saves my butt routinely, and is the only thing so far that's worked reliably.
I do exactly the same thing, but when you think about it, isn't this just a pomodoro? You work for 25 minutes. An alarm rings. You take a 5 minute "break". In reality, in that "break" I quickly write down what I accomplished in the last 25 minutes and update my TODO. I also look at my DONE tasks in my TODO list and think about what I was doing and why. I've often found this kind of retrospective to be valuable. I'll notice that there is a better way to accomplish what I'm doing, etc, etc.
As crazy as it sounds, I've even experimented with 5 minute "pomodoros" using this technique - 5 minutes on and 1 minute reflecting. What can you do in only 5 minutes? When I first started it was hard to think in those terms, but as I got better at it, I realised that almost everything I do takes less than 5 minutes. If it takes more, then it's an indication that I need to rethink my approach.
For example, if I'm reading code, it makes sense that it would take more than 5 minutes, so I'll make a goal -- find out how X works. If I'm not finished in 5 minutes, in my 1 minute retrospective I think, "Am I approaching this task in the right way? Is there a better approach?" If no, then the next 5 minutes will be the same as the first. However, I often find that having that break snaps me out of doing unnecessary things.
I can't do the 5 minute thing every day (it is exhausting). I'm dramatically more productive with it, though (surprisingly so). It's made me realise that these kind of enforced reflection periods are really valuable. While you are reflecting, it's easy to write down what you just did, so it's kind of 2 birds with 1 stone.
I'd have to think about the pomodoro thing. Maybe, but I developed an almost unconscious reflex to hit the 'ok' button on the timer to make it go away. I would try very hard to not have it make me think about anything, just confirm which task I was in the middle of. The main thing it caught was when I hadn't re-started a timer after finishing something and stopping it, and when I switched tasks without telling the timer. I'd take a second to fix it, but not stop to reflect, nor break down my tasks. After the first reminder, I'd try to ignore them again.