Every switch to another task has a cost. Lab studies find people respond more slowly right after a switch, carry thoughts of the old task into the new one, and report more stress when interrupted. With several coding agents running, the fix is fewer, better-timed switches: answer at natural breaks and check who is waiting before you move.

What a context switch is
A context switch is any moment you stop one piece of work and pick up another. Some are your choice: you finish a function and look at a pull request. Others are pulled out of you: a coding agent stops to ask for permission, a test run ends, a message arrives.
With one agent, switches are rare. With four agents in four terminals, each one can need you at any time, and none of them knows what you are doing. The work you do yourself, reading code, reviewing a diff, thinking through a design, gets cut into short pieces.
This guide is about the cost of those switches and how to reduce it. Its partner guide, Getting back into the code after an agent interrupts you, is about the other half: how to recover once a switch has happened.
What research shows about switching costs
The research below studied people in general, mostly students in labs and office workers in the field. It was not done on developers running coding agents, so read it as a description of how attention works, not as a measurement of your day.
A switch costs time even when the tasks are simple
Cognitive psychologists study switching by asking people to switch often between a small set of simple tasks. Stephen Monsell's review in Trends in Cognitive Sciences (2003) sums up the core finding: responses are "substantially slower and, usually, more error-prone immediately after a task switch". The review adds that this switch cost "is reduced, but not eliminated, by an opportunity for preparation".
The tasks in these studies are tiny, so they do not tell you how long a switch takes in real work. What they show is that a switch has a cost even between simple tasks, and that preparing for it reduces the cost without removing it.
Your attention lags behind your hands
Sophie Leroy's two experiments, published in Organizational Behavior and Human Decision Processes (2009), looked at what happens when people move on before a task is done. In the paper's words, it is "difficult for people to transition their attention away from an unfinished task and their subsequent task performance suffers". She called the leftover thinking attention residue.
The same paper found that simply finishing a task was "not enough". People moved on most cleanly when they had finished the first task under some time pressure. One reading for daily work: a task left half-done keeps a claim on your attention after you have switched windows.
Interrupted people work faster, and pay for it
Gloria Mark, Daniela Gudith and Ulrich Klocke ran a lab study at CHI 2008 with 48 participants, most of them German university students, answering emails in a simulated office while being interrupted by phone or instant message. Each person did the task with and without interruptions. When interrupted, they finished in less time with no difference in quality, though they wrote shorter emails. The authors write that people seem to "compensate for interruptions by working faster", but at a price: "more stress, higher frustration, time pressure and effort", as the participants rated it themselves.
That matches what many people report after a day of answering agents: the work got done, and they feel drained.
Real workdays are already fragmented
Mark, Victor González and Justin Harris shadowed 24 information workers, managers, financial analysts and software developers, at CHI 2005. They found that people spent an average of 11 minutes and 4 seconds in one area of work before switching or being interrupted, and that 57% of their areas of work were interrupted. Their abstract describes work as "highly fragmented".
Those workers had no coding agents. Adding several agents that each stop and wait for you adds more breaks to a day that already had plenty.
When the interruption lands matters
Piotr Adamczyk and Brian Bailey, at the University of Illinois, interrupted 16 students during editing, searching and media tasks (CHI 2004). The timing they predicted to be best, the moment between two larger units of a task, produced "less annoyance, frustration, and time pressure" and less mental effort than other moments. Annoyance at the best moment was 56% lower than at the worst.
This is the most useful finding for agent work. You cannot stop agents from needing you, but you can often choose when you respond.
What this means with several coding agents
Put the findings together and a few things follow for agent work:
- Each agent that stops to ask adds one more possible interruption, on its own schedule, not yours.
- Checking a terminal to see whether an agent needs you is a switch too, even when the answer is no.
- A half-finished thought left behind for an agent prompt keeps pulling at you, as Leroy's attention residue suggests.
- Answering fast keeps agents moving, but in the 2008 study, working faster under interruption came with more stress.
None of this means you should stop running agents in parallel. It means the switches are a real cost to manage, like build time or review time.
How to cut needless switches
Most of the cost comes from switches that did not need to happen, or happened at the worst moment. These habits target both.
Stop checking, start being told
Tabbing through terminals to see which agent is done is pure switching cost with no work in it. Let the agents tell you instead. Set up notifications or a status display, so the default is that you stay put until something actually waits. See Run several Claude Code sessions and see which one needs you for the options.
Ask less often
Every permission prompt you approve without thinking is an interruption you could remove. Allow rules for safe, routine commands mean the agent asks only when it matters. Approve agent tool calls without switching windows covers the settings for Claude Code and Codex.
Answer at a natural break
Adamczyk and Bailey's result suggests a simple rule: when an agent waits, finish the smallest unit you are in, such as the sentence, the test or the function, then answer. An agent that waits two more minutes rarely matters. Losing your place mid-thought often does.
- Decide in advance which agents are urgent, for example one that blocks a teammate.
- For the rest, answer in batches at your own breaks.
- If you are deep in a hard problem, let the agents queue.
Give agents bigger, clearer tasks
An agent with a vague prompt comes back with questions. One with a clear goal, constraints and a definition of done can run longer before it needs you. Fewer, larger hand-offs mean fewer switches.
Keep the number of agents within what you can follow
Running six agents is only faster if you can keep up with them. If you find yourself constantly switching and rarely thinking, try fewer agents with longer tasks. Separate working copies also stop agents from tripping over each other: see Git worktrees for parallel coding agents.
Protect a block of your own work
Pick a stretch of time for work that needs your full attention, and run only agents with long, well-defined tasks during it. Check in when the block ends. The 2005 field study shows how short uninterrupted stretches already are; a protected block makes at least one of them longer.
Where a status pad fits
A status pad does not remove the cost of switching. What it can remove is the checking: the glance at each terminal to find out whether anything needs you.
Orbtile shows each coding-agent session on a key of the Logitech MX Creative Keypad, on an iPhone or Android phone running Orbtile Mobile, or on your computer screen. Each tile shows the session's name, its state and its latest words. Waiting sessions come first, so one look tells you whether anything needs you and which session it is. You can stay in your current task until you reach a break, then answer.
- A short press on a key opens that session's window on your computer.
- On the keypad, a tap on key 9 focuses the first waiting session.
- For local sessions, you can answer supported permission requests and multiple-choice questions from the keypad, without switching windows.
It works with Claude Code, OpenAI Codex, ZCode, Google Antigravity desktop and Kimi Code, on an Apple silicon Mac or on Windows 11.
FAQ
What is the cost of context switching?
Lab research on task switching finds people respond more slowly and make more errors right after a switch, even when they can prepare. Studies of interrupted work add that people may work faster to compensate, but report more stress, frustration, time pressure and effort.
Does running several AI coding agents make context switching worse?
It can. Each agent may stop and wait for you at its own time, so you get more possible interruptions. Answering at natural breaks, asking agents for fewer approvals and getting a signal instead of checking terminals all reduce the number of switches.
Is it better to answer an agent straight away?
Not always. A study of interruption timing found people felt less annoyed and less rushed when interrupted between larger parts of a task. Finishing the small unit you are in, then answering, is usually a better trade unless the agent blocks someone else.
Does this research apply to developers specifically?
Mostly it studied people in general: students in labs and office workers in the field. It describes how attention works rather than measuring developers running agents, so treat it as a guide to habits, not a precise cost for your day.