TL;DR
Every time we move our attention from one task to another, we pay twice: the time to find our place again, plus leftover thoughts from the last task. That move is called context switching, and AI agents add a lot of it. Long, protected stretches of focus (deep work) and fewer, batched check-ins win that attention back.
- With three coding agents running, Wren got pulled away 36 times between 9:00 and noon. The longest stretch on the one hard task, a SQL query, was just 7 minutes.
- Our attention works like a spotlight that lights one thing at a time. Interrupted people in a 2008 study finished a bit faster but felt more stressed, and leftover thoughts about an unfinished task (attention residue) make the next task harder.
- Agent check-ins are context switches too. Only 3 of Wren's 24 needed real judgment, so a clear task, tests the agent runs itself, and pre-approved safe commands cut them to 4.
- Block two focus hours a day and check agents and messages at set times. If your job can't allow that, start with one 45-minute block.
It's 9:00 on a Tuesday at Crumb & Co., and Wren has three AI coding agents working at the same time. One is fixing a failing test, one is building a new page, and one is resizing photos. That is three people's worth of work happening at once! By noon, though, Wren has clicked Yes 11 times and still hasn't finished the one task that only Wren could do.
A lot of us have mornings like this, and AI agents are adding a brand new source of them. In this article, we are going to look at where a morning like Wren's goes, what each interruption really costs, and how we can win back a couple of hours of focus without ignoring our agents.
Onwards!
Wren's Very Busy Tuesday
Wren is the web developer at our bakery. The owner keeps asking a question that sounds simple: which pastries sell out before noon? Wren is learning SQL to answer questions like this from our orders database, so that query is Wren's job this morning. Here is everything else that wants a piece of Wren:
Our three agents are the new part of this picture. Each one works on its own, and each one stops every so often to ask Wren something:
Agents check with us like this on purpose, because one wrong command can ruin our day (How an Agent Like Claude Code Works walks through this checkpoint). Each answer only takes a few seconds.
Here is what all of those seconds will add up to across Wren's morning:
Each colored piece in our timeline is a stretch of time spent on one thing. Between 9:00 and noon, Wren got pulled away from the query 36 times, and 24 of those came from our agents. Every interruption is really two switches, one away and one back, so that is 72 switches in three hours. The longest stretch on the query was just 7 minutes.
Wren is not unusual, either. Gloria Mark, a researcher at UC Irvine, has spent about 20 years measuring how long people stay on one screen before switching:
The average dropped from about two and a half minutes in 2004 to 47 seconds in recent years. Mark covers this in her 2023 book, Attention Span, and in this interview.
Doing Three Things at Once
Running three agents feels like doing three things at once, and Lucille Ball got there first. In a 1952 episode of I Love Lucy, Lucy and Ethel wrap chocolates on a conveyor belt that keeps speeding up. The episode is called, and I am not making this up, "Job Switching." Wren's belt looks like this:
Lucy and Ethel end up stuffing chocolates into their mouths and hats. Wren's version is a lot less tasty...clicking Yes without really reading what an agent is about to run.
Doing several things at the same time (what we call multitasking) feels like shining a floodlight on everything at once. Our attention works more like a spotlight. Whatever we point it at gets bright, and everything else goes dark:
When we multitask, what we are really doing is swinging one spotlight back and forth between things, very quickly. We will see what each swing costs in a moment.
The strange part is that all of this swinging can make us look faster. In a 2008 study, Gloria Mark, Daniela Gudith, and Ulrich Klocke had 48 people answer three batches of 12 emails. One batch had no interruptions. For the other two, a "supervisor" interrupted by phone or chat about every two minutes:
Let's look at the left side first. The interrupted people finished a couple of minutes sooner, with no more mistakes. Now let's look at the right side. After only 20 minutes, their stress went from 6.9 to over 9, and they reported more frustration and effort. The researchers think people sped up to make up for time they knew they would lose, and that the extra speed came at a price.
What Each Switch Really Costs
So, what does a single switch actually cost? Let's zoom way in on one of them. At 10:31, our pickup test agent is going to ask to run the tests:
Clicking Yes took 10 seconds. Did Wren get right back to work? Nope. Getting back into the half-written query took 3 minutes, because Wren had to reread it to remember what came next. Then, at 10:35, our photos agent asked its next question.
Moving our attention from one task to another like this is called context switching. The context is everything we have loaded in our heads for a task, like the table names and what comes next. Every switch means setting one context down and picking another one up.
There is also a second cost, and it is harder to see:
Wren is looking at the query, but part of Wren's mind is still on the pickup test. Sophie Leroy calls these leftover thoughts attention residue. In her 2009 experiments, people who switched away from an unfinished task kept thinking about it, and they did worse on the next one. Our working memory only holds a few things at once (we saw how few in Cognitive Load), so every leftover thought takes up room our query needed.
How much a switch costs also depends on what we are switching back into. In 2001, Joshua Rubinstein, David Meyer, and Jeffrey Evans found that people lose time on every switch, and they lose more when the task's rules are more complicated. Our bakery's work lines up the same way:
Approving a photo is simple, so Wren is back to work right away. The SQL query is the hardest thing on Wren's plate, so it takes the longest to pick back up. This means our most important work suffers the most from switching.
Note: What About the Famous 23 Minutes?
That number comes from a 2006 interview with Gloria Mark. It is how long people took to get back to an interrupted task on the same day (23 minutes and 15 seconds), with about two other tasks in between, which is different from how long it takes to refocus. Her team's 2005 paper found a similar 25 minutes and 26 seconds.
Babysitting Our Agents
On its own, each of our agents does not seem all that needy:
Our pickup test agent stops 9 times in three hours, or about once every 20 minutes. That seems pretty reasonable! Stacked together, though, our three agents stop Wren 24 times, which is once every 7 or 8 minutes. Running agents side by side feels like multitasking for free, because the agents do the work. Each check-in is still a context switch for us.
Hovering over our agents all day, ready to approve the next thing, has a nickname: agent babysitting. Some of it is necessary, because reviewing what an agent built is real work. What we want is fewer check-ins, each one worth stopping for.
To get there, let's sort the morning's 24 check-ins by what they were about:
Only 3 of the 24 needed Wren's judgment. Our agents could have handled the other 21 on their own if we had set them up differently, and that is what we are going to do next.
Giving Our Agents a Longer Leash
Here is our menu page agent's task, before and after Wren rewrote it:
The old task was one line, so the agent kept asking about everything it left out. Each part of the new task card takes care of a different kind of check-in:
- The task spells out the details the agent kept asking about, like where the prices come from. This is the idea behind spec-driven development.
- Done when gives the agent a way to check its own work, so it runs npm test before it bothers Wren.
- Go ahead without asking pre-approves safe commands, and Ask me first keeps risky ones waiting for Wren.
We can usually set up that pre-approval ahead of time. In Claude Code, for example, an allow rule lets the agent run npm test without asking (see its permissions docs). Here is what this longer leash will do to our 24 check-ins:
The 11 permission requests are gone, the questions drop from 6 to 1, and our agents check their own results now. All 3 judgment calls are still there on purpose, because those are where Wren's attention belongs. One word of caution: we should only pre-approve things that are easy to undo, like running tests. Deploying, deleting files, and spending money stay behind an approval.
Rebuilding Wren's Day
Fewer check-ins help, but they still arrive whenever an agent needs one. The other half of our fix is deciding when we will look. Wren is going to set aside a long, protected stretch for the one hard task. Cal Newport calls this kind of distraction-free focus on demanding work deep work, and he wrote a 2016 book about it. Everything else will wait for set times.
Here is Wren's Tuesday morning a week later, next to the one we started with:
Wren's time on the query went from 37 tiny pieces to 3 big ones, and the longest stretch went from 7 minutes to 85. Rosa still walked over at 10:25 about a wrong order, because some interruptions are the job. Everything that could wait (our agents, Slack, and the owner's texts) waited until 11:00.
Two hours at a time is plenty. Gloria Mark compares focus to lifting weights, because we can't do either one nonstop and we need rest between sets.
Here is Wren's whole new day:
The second focus block is for reviewing our agents' work, which deserves the same quiet as the query. Our agents get their answers at 11:00 and 3:30.
Not every job allows two quiet hours. In support, on call, or managing a team, many interruptions are the job itself. The research has limits too, since most of it comes from labs and offices. If two hours is out of reach, we can start with one 45-minute block a day.
Try It This Week
Here is a small experiment you can start on Monday:
- For one morning, tally every time you switch tasks, including every check on an agent.
- Block two focus hours a day on your calendar for the rest of the week. Pause notifications, and tell people how to reach you if something is urgent.
- Before each block, give your agents a longer leash: a clear task, a way to check their own work, and pre-approval for safe commands only.
- Check agents and messages at set times, like the end of each block. On Friday, count your switches for one morning again.
Frequently Asked Questions
What Is Context Switching?
Context switching is moving our attention from one task to another. Every switch means setting down what we had loaded in our heads for one task and picking up another, so getting back takes time, and leftover thoughts from the last task can tag along. The cost is higher when the task we return to is complicated.
Does Multitasking Make You More Productive?
It can look that way. In a 2008 study by Gloria Mark, Daniela Gudith, and Ulrich Klocke, people who were interrupted about every two minutes answered their emails a little faster, but their stress, frustration, and effort went up after only 20 minutes. Our attention works like a spotlight, so multitasking is really swinging it back and forth between tasks.
How Long Does It Take to Refocus After an Interruption?
The often-quoted 23 minutes comes from a 2006 interview with Gloria Mark. It’s how long people took to get back to an interrupted task on the same day, with about two other tasks in between, which is different from how long it takes to refocus. In the article’s example, getting back into a half-written SQL query took about 3 minutes after a 10-second approval.
How Do You Get AI Coding Agents to Interrupt You Less?
Give each agent a clear task, a way to check its own work, like tests it can run itself, and pre-approval for safe commands such as running the tests. Keep risky actions like deploying or deleting files behind an approval. Then check on your agents at set times instead of whenever they ping.
Conclusion
Ok! It is time to wrap things up. Our attention works like a spotlight, and every swing costs us the time to get back plus some leftover thoughts. Agents add a lot of new swings, because every permission prompt is a context switch for us. What helped Wren was giving our agents a longer leash, saving check-ins for set times, and protecting two long stretches a day for the hard stuff.
None of this will make every day quiet, and Rosa is still going to walk over sometimes. In How Product Teams Work, we'll zoom out from our own day to the people we build with. As for our agents, they hear from Wren at 11:00 and 3:30 now, and they seem totally fine with it.
Before you go, here are a few things you can do:
-
Keep reading
Read the next article in the series, How Product Teams Work, or check out some related content:
-
Ask a question
Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.
Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

















