Tuesday, May 27, 2025

Taming the Context-Switch Hydra: How an AI Sidekick Saved My Sanity



TL;DR:

GitHub Copilot (in Agent mode with Codespaces) dramatically cuts down the cost of context switching, perfectly fitting my chaotic, multitasking workstyle. It lets me stay productive and in flow, even as I juggle coding, helping others, and specs—all while being 51 and still loving the craft.

For Those Who Prefer the Director’s Cut …keep on reading

Picture this: it’s 2:00 PM on a Tuesday (I’m an 8am to 4pm kind of guy), and my monitor looks like a digital command center gone rogue. I’m simultaneously squinting at a code editor, juggling three active Teams chats, triaging a critical bug in another window, and glaring at a half-finished spec document. To top it off, a meeting reminder just popped up, cheerfully informing me I’m late to yet another call.

If that sounds chaotic, welcome to my world. My brain is running a marathon of context switches, and each ping yanks me out of “the zone” and into another fire drill. Focus? In theory, I cherish the idea of deep work – those mythical hours of uninterrupted coding flow where elegant solutions just happen. In practice, deep work has become as rare as a unicorn sighting in a server farm.

And my real dilemma? I love attending to absolutely everything at once, even though I know context switching hurts my overall flow. I’m torn between doing it all and doing doing it all with full focus and pasion. 

At 51 years old, with too many decades of coding under my belt, you’d think I’d have mastered the art of concentration. You might expect me to be the wise, zen-like coder who lets nothing disturb his flow. Instead, I’m the guy with 20 browser tabs open, hopping between tasks like it’s an Olympic sport. They say it takes over 20 minutes to regain focus after an interruption; if that’s true, I’m pretty sure my focus debt by lunchtime requires its own line item in the project plan – but don’t tell anyone!

Enter the AI Sidekick: Copilot Agent Mode and Codespaces

It turns out, salvation came from the very tech I’m working with internally at Microsoft, these now ubiquitous LLM’s in the form of GitHub Copilot (shortened to Copilot for the rest of the text), specifically the new Agent mode hooked into Visual Studio Code and my Codespaces. One hectic afternoon, I decided to give this duo a shot (if I’m building Copilot experiences, I might as well dogfood some other part of it – irony noted). Instead of manually pulling the repo and prepping my environment for a surprise bug fix, I opened up a new Codespace (which is something I’ve done for some time already to save my local laptop from going mental and be memory starved most of the time). In about 30 seconds, I open a fully provisioned VS Code environment. No configuration, no branch juggling – just my code and an AI companion ready to go.

Copilot’s agent mode immediately started analyzing the repository and the issue description like an over-enthusiastic junior dev who somehow already memorized the codebase. It highlighted relevant files, suggested a plan, and even drafted a couple of code changes while I was still sipping what was left of my cold coffee. For once, I wasn’t the bottleneck in my own workflow. By chunking work into a dedicated Codespace for that task, I could contain the distraction. Fixing that bug became a self-contained mission rather than a brain-fragmenting detour.

The magic here is how much context Copilot can carry (assuming you know what model to pick) so I don’t have to. Instead of me mentally loading the entire architecture to figure out where to make a change, the AI does the legwork. It’s like having an intern who reads all the documentation and points me straight to the right module. I still review every suggestion (the classic “trust, but verify” dance we all do with AI), but not having to start from a blank slate for each task is a huge relief. I can focus in smaller chunks: solve one problem with Copilot’s help, then seamlessly return to my primary project without feeling like I just swapped brains.

Turns out the cost of context switching is just significantly less for me this way. I’m not deep diving into all code lines at ones, but rather orchestrate, supervise and revise.

The Paradox: Helping Others vs. Going Dark

Being a go-to veteran developer comes with a twisted irony: the more I help others, the less I get done on my own projects. I genuinely enjoy mentoring and putting out fires, but each “Got a minute?” chat message chips away at my focus. In a single morning I might debug a customers weird UX issue, explain an obscure design decision to a PM, and review a junior dev’s PR. By lunchtime, I’ve solved everyone else’s problems except my own.

To actually be productive with a great sense of satisfaction, I sometimes have to go dark – flip on the “do not disturb” sign (figuratively and literally) and disappear from Slack and Teams for a while. It feels paradoxical: I’m paid to collaborate and be available, yet my most productive hours happen when I’m effectively unavailable to everyone. My team has learned that when my status reads “In Focus Mode,” it’s my polite way of saying Unless the build pipeline is on fire, please let me code. Again, I love being in the zone, but I utter hate not attending to everything around me. Clone anyone?

Interestingly, Copilot is helping me bridge this paradox a bit. If someone needs a code snippet or an example, I can quietly enlist the AI to draft a quick solution while I’m still in flow. I’ve caught myself using Copilot to assist others indirectly: a teammate asks a question, and I’ll prompt Copilot for a starting point which I then tweak and send back to them. In a way, I’m still helping, but offloading some of the effort to my AI sidekick. It’s a strange new form of delegation – one where I can support my team, but mostly myself, and preserve my sanity at the same time.

Old Dog, New Tools: Better for Veterans or Rookies?

All this has me wondering: do tools like Copilot give experienced developers a bigger boost, or do they help newcomers more? The answer, fittingly, is yes – to both. As a seasoned dev, I bring decades of context to the table. I know the pitfalls, the edge cases, the “gotchas” that a generative AI might not. That means I can usually tell when Copilot is producing a stroke of genius versus a curveball that will blow up in production. I use the AI as an accelerator, not a replacement. It’s fantastic for boilerplate, for exploring unfamiliar APIs, or just for preventing the dreaded blank-page syndrome when starting a new module. My experience acts as a filter on top of Copilot’s suggestions – separating the gold from the fool’s gold.

For a junior developer, the dynamic can be different. On one hand, they have an incredible learning companion in AI. Copilot can explain code, suggest best practices, and generate examples faster than you can Google and scroll. I’ve seen junior teammates use Copilot to prototype solutions they’d otherwise struggle to even start. In a sense, these tools level the playing field, giving less-experienced devs a leg up. But there’s a flipside: if you’re brand new and Copilot is doing half your thinking, are you really learning or just parroting? It’s like giving a newbie driver a GPS – sure, they’ll get to the destination, but will they learn the route? I sometimes worry that relying too much on AI early on could become a crutch.

I often catch myself musing, I wish I had this 25 years ago – or do I? Back in the early 2000s, my younger self had to wrestle with every bug fix and feature implementation the hard way (I can still remember scouring MSDN CDs, hardcopy magazines, books and online forums). Part of me imagines how much faster I could have solved problems with an AI pair-programmer whispering answers. Another part of me is glad I learned to troubleshoot and think deeply without a digital helper doing the easy parts for me. In the end, my advice to the juniors is this: use Copilot to learn and speed up your work, but always make sure you understand what the code is doing. For us red-grey-beards, these tools are a godsend to cut through the mind-numbing stuff – but they don’t replace our hard-earned intuition. If anything, that intuition becomes even more important in the age of AI.

Conclusion: How AI Changed My Work (and Me)

Working with an AI pair programmer has subtly but profoundly changed how I approach my day. I’m still the same chaotic multitasker at heart, but now I have a safety net. Instead of drowning in five tasks at once, I let Copilot handle the shallow end of a problem while I dive into the deep end of another. I approach coding differently now: I feel less dread opening up an unfamiliar codebase, knowing I have an ever-patient assistant to help me navigate. And when I explore a new technology, Copilot is like a tutor by my side, offering code examples and nudging me in the right direction. And best of all, it feels like I’ve been doing this all my life, even though it’s only been a couple of months.

Perhaps the biggest change is in my mindset. I no longer equate “going dark” with dropping balls; I see it as investing in focused work, with AI ensuring no small stuff falls through the cracks. I’m learning to trust a tool that didn’t even exist a couple years ago, which is something I never thought I’d say at this stage of my career. It’s oddly invigorating to realize that even after a life time of coding (yes, I started at the age of 9 or so in the C64 era), there’s room to grow and new tricks to learn.

So here I am – a 51-year-old developer who’s seen the industry reinvent itself a few times – finding myself genuinely excited about how Copilot and Codespaces have reinvented my daily workflow. My workdays are still crazy, but they’re a bit less soul-crushing and a lot more interesting. I help others, I get my own code written, and I even pick up new techniques from an AI now and then. In the end, Copilot and Codespaces haven’t just made me more productive; they’ve made me rethink how I work and learn. Maybe you can teach an old coder new tricks after all.