Developers

The real cost of context switching for developers (with sources)

The short answer

Context switching costs developers most in the return trip: in a study of about 10,000 programming sessions, only around 10% resumed coding within a minute of an interruption. The fix is to make resuming cheap: leave a next step in the code, keep your place, batch interruptions, and get told when your AI agent is done instead of watching it. Nudgling, a free Windows focus app, brings you back to the exact window and tells you when Claude Code, Codex and others finish.

What the studies actually measured

Search for the cost of context switching and you’ll find big round numbers: “15 minutes per interruption”, “20% of your time per extra project”. Most are repeated without a source. Here’s what the research we could check really found.

Developers rarely pick up where they left off

Chris Parnin and Spencer Rugaber looked at about 10,000 recorded programming sessions from 86 programmers and surveyed 414 more (“Resumption strategies for interrupted programming tasks”, Software Quality Journal, 2011). Two findings stand out:

  • In only about 10% of sessions did programming resume within a minute of an interruption.
  • In only about 7% did people start editing without first moving around the code to rebuild what they were doing.

In other words: when you come back, you don’t continue. You reconstruct. You reopen files, scroll, re-read the last diff, and only then type.

Information work in general

A UC Irvine field study that included developers found people worked about 11 minutes on one thing before switching, and that interrupted work resumed the same day came back after about 25 minutes on average, with about two other tasks in between (Mark, González and Harris, CHI 2005). Sophie Leroy’s research on attention residue adds why it hurts: part of your mind stays with the unfinished task and drags on the next one (Leroy, 2009).

Switching isn’t expensive because of the switch. It’s expensive because the return trip starts from zero.

The new switch: waiting on your AI agent

AI coding agents add a switch that didn’t exist two years ago. You hand Claude Code or Codex a task that takes three minutes. That’s too short to start something real, and long enough to open Hacker News. Then the agent asks for permission, and it waits for you instead of you waiting for it.

Make the return trip one click.

  • Free
  • Works offline
  • No account
  • Never blocks anything

Early access · Windows 10 & 11, with a free Android app · Invites go out in mid‑December

How to make resuming cheap

You can’t remove every interruption. You can make each one cost less.

  1. Leave a breadcrumb at the cursor. Before you get up, type the next step as a comment where you’re working: // next: handle the empty cart case. A study of “ready-to-resume” plans found that a note like this reduces attention residue (Leroy and Glomb, 2018).
  2. Don’t tidy up before a break. Leave the files open and the failing test on screen. Your messy layout is your context.
  3. Batch the small stuff. Check chat and email at set points, such as after a commit, rather than whenever they ping.
  4. Let agents tell you when they’re done. Don’t watch the terminal, and don’t forget it either. Hooks can alert you (see how to get notified when Claude Code finishes).
  5. Use agent waits as real breaks. Stand up, refill your water. Avoid opening a feed: it’s built to last longer than any agent run.
  6. Protect one block a day. Two hours with notifications off for the hardest problem, scheduled like a meeting.

A one-minute ritual for coming back

Parnin and Rugaber found that most programmers rebuild context before they type. You can make that rebuild short and deliberate:

  1. Read your breadcrumb comment first, before anything else.
  2. Run the test or the command you were last running, so the screen shows you where things stand.
  3. Make one small edit within the first minute, even just the next line of the breadcrumb. Momentum beats re-reading the whole file.

If you work with AI agents, add one more step: check what the agent changed while you were away before you continue, so you aren’t building on code you haven’t seen.

Back to the exact line, every time.

  • Free
  • Works offline
  • No account
  • Never blocks anything

Early access · Windows 10 & 11, with a free Android app · Invites go out in mid‑December

Nudgling: the return trip in one click

Nudgling is a small focus app for Windows 10 and 11, with a free Android companion. It doesn’t block anything. It shortens the way back:

  • Drift is caught early. Half a minute into YouTube or a feed, it asks once whether you’re still on your task.
  • Back to it puts VS Code (or whatever you were in) back in front, at the exact window you left.
  • Where was I? (Ctrl + Alt + W) brings back your last working window after a call or a meeting, with a one-line reminder of what you were doing.
  • Your AI tools (Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot CLI, Qwen Code): it stays quiet while they work and tells you when they’re done, on your PC or phone. Connected once, you also get “needs your OK”.
VS Code, where Claude Code asks to proceed and Nudgling’s pill says “Claude Code needs your OK”; beside it, a phone with “Your AI needs your OK”.VS Code, where Claude Code asks to proceed and Nudgling’s pill says “Claude Code needs your OK”; beside it, a phone with “Your AI needs your OK”.
The agent needs you; Nudgling tells you on your PC and your phone, and Back to it opens VS Code.

It decides on your PC, never takes screenshots or records keystrokes, and works offline. More for developers on the AI coding page; the general version of these ideas is in how to refocus after an interruption.

Ship the thing you started.

Join early access. Invites go out in mid‑December.

  • Free
  • Works offline
  • No account
  • Never blocks anything

Early access · Windows 10 & 11, with a free Android app · Invites go out in mid‑December

Questions people ask

How long does it take a developer to get back into code after an interruption?

In Parnin and Rugaber’s study of about 10,000 programming sessions from 86 programmers, only about 10% of sessions resumed editing within a minute of an interruption, and most programmers first moved around the code to rebuild context. Popular round numbers like “15 minutes” are often quoted without a source.

Does waiting on an AI coding agent count as context switching?

Often, yes. A wait of a minute or more is long enough to open something else, and then the agent waits for you instead. Getting a clear “done” or “needs your OK” signal turns that wait into a short break instead of a drift.

What is the cheapest habit that helps?

Before you step away, write the next concrete step where you’ll see it first: a comment at the cursor, or a line in your notes. Research on “ready-to-resume” plans found that this small step reduces the pull of the unfinished task.

Which AI tools does Nudgling work with?

Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot CLI and Qwen Code. It stays quiet while they work and tells you when it can see they’re done. Connect them once for an exact “done” and “needs your OK” (Cursor and Codex report “done” only).

Does it spy on my screen?

No. It decides on your PC from the window in front: the app, its title and, in a browser, the web address. When that isn’t enough it reads the text on screen in memory and forgets it. It never takes screenshots or records keystrokes, works offline and needs no account. Anonymous usage counts are on by default (off in the EU, UK and Switzerland) and one switch turns them off.

When can I get Nudgling?

Nudgling is in early access now. Leave your email on this page and you’re on the list; invites go out in mid‑December. It isn’t in any app store yet: it will come from the Microsoft Store, with the Android app on Google Play.

Finish what you started.

Leave your email and you’re on the list. We’ll send a short welcome now and your invite in mid‑December. Nothing else.

  • Free
  • Works offline
  • No account
  • Never blocks anything

Early access · Windows 10 & 11, with a free Android app · Invites go out in mid‑December

Keep reading

All articles · Home · A day with Nudgling · Nudgling for AI coding · Pricing