I second the idea of revisiting the calendar. I add events in the calendar of what I’ve been doing every time I context switch. It makes it purposefully annoying to context switch often, and I revisit what I did that week at the end of it. Additionally, I’m able to answer questions such as “What percentage of time do I spend on research vs writing vs coding etc.