# Managing Your Attention by [kirupa](https://www.kirupa.com/me/index.htm) | filed under [Teams & Leadership](https://www.kirupa.com/teams_and_leadership/index.htm) **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: [![Wren sits in the middle with one job of Wren's own: write the SQL query that answers the owner's question, which pastries sell out before noon? Above, three AI coding agents run at once: a pickup test agent fixing the failing Saturday pickup-slots test, a menu page agent building the holiday menu page, and a photos agent resizing product photos. Below, four more things want Wren too: #kitchen pings in Slack, the owner's texts, Biscuit alerts, and Rosa walking over.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_scene.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_scene.png?v=60ab1ee5d9ee) 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: [![Three agent messages waiting for Wren. The pickup test agent asks: Allow npm test? with Yes and No buttons. The menu page agent asks: Should prices show on the holiday menu? with Yes and No buttons. The photos agent says: Resized 12 of 48 photos. Look OK? with a Looks good button.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_prompts.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_prompts.png?v=44a265cc4538) Agents check with us like this on purpose, because one wrong command can ruin our day ([How an Agent Like Claude Code Works](https://www.kirupa.com/ai_fundamentals/how_an_agent_works.htm) 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: [![Wren's morning from 9:00 to 12:00 in three lanes: Wren's query, agents, and people and pings. Time on the query is chopped into 37 short green pieces, broken up by 24 agent check-ins and 12 messages and visits, for 36 interruptions in three hours. A handwritten note points at the longest stretch on the query: 7 minutes, just before noon.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_timeline_before.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_timeline_before.png?v=c32b27a6ba56) 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: [![Two bars from Gloria Mark's research on how long people stay on one screen before switching. In 2004, the average was 2.5 minutes. Since about 2016, the average is 47 seconds.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_screen_time.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_screen_time.png?v=d96fe398e459) 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](https://gloriamark.com/attention-span/), and in [this interview](https://www.steelcase.com/research/articles/our-47-second-attention-span-with-gloria-mark-s5-ep3-transcript/). ## 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](https://en.wikipedia.org/wiki/List_of_I_Love_Lucy_episodes)." Wren's belt looks like this: [![A gag. A conveyor belt carries a steady stream of things toward Wren at the far end: a test tube, a photo, a chocolate, a page, an Allow? prompt, and another chocolate. Wren waits at the end of the belt with a bead of sweat, and a handwritten note points at the item about to arrive: and they keep coming!](https://www.kirupa.com/teams_and_leadership/images/managing_attention_belt.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_belt.png?v=2c2bd9092132) 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: [![Two dark stages, each with four cards: three agents and Wren's query. On the left, a floodlight washes all four cards in the same dim light, labeled floodlight: everything a little. On the right, a spotlight shines straight down on Wren's query, which is bright, while the three agent cards stay dark, labeled spotlight: one thing a lot.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_spotlight.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_spotlight.png?v=84995fa7af75) 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](https://ics.uci.edu/~gmark/chi08-mark.pdf), 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: [![Results from Mark, Gudith, and Klocke's 2008 study, where 48 people answered 12 emails each way. Minutes to finish: 22.8 with no interruptions, 20.3 when interrupted on the same topic, and 20.6 when interrupted on another topic. Stress, on a scale from 1 to 20: 6.9 with no interruptions, 9.5 when interrupted on the same topic, and 9.1 when interrupted on another topic.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_study.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_study.png?v=935d5d8fce39) 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: [![A close-up of seven minutes, from 10:30 to 10:37. Wren works on the query until 10:31, when the pickup test agent asks Allow npm test?. A handwritten note says clicking Yes takes 10 seconds. Next comes a 3-minute stretch of finding Wren's place in the half-written query again, then 50 seconds of real work on the query before the photos agent asks its next question at 10:35.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_one_switch.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_one_switch.png?v=b456de0de068) 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 back on the SQL query, which fills the biggest thought bubble: SELECT item, COUNT(*) FROM sellouts WHERE sold_out_at before noon, GROUP BY item. Three smaller, faded bubbles float beside it with thoughts from the last few switches: Did the pickup test pass? Prices on the menu? What did the owner text? A handwritten note points at them: still thinking about these.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_residue.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_residue.png?v=b3be653af0c3) 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](https://doi.org/10.1016/j.obhdp.2009.04.002), 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](https://www.kirupa.com/human_behavior/cognitive_load.htm)), 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](https://doi.org/10.1037/0096-1523.27.4.763) 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: [![Two switches back to work. Going back to approving photos, the finding-the-place part is short and Wren is working again almost right away. Going back to the SQL query, the finding-the-place part is long, because there is a lot more to rebuild in Wren's head before the real work starts.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_complexity.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_complexity.png?v=77272d92df17) 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](https://news.gallup.com/businessjournal/23146/too-many-interruptions-work.aspx) 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](https://ics.uci.edu/~gmark/CHI2005.pdf) found a similar 25 minutes and 26 seconds. ## Babysitting Our Agents On its own, each of our agents does not seem all that needy: [![Wren's morning from 9:00 to 12:00. The pickup test agent stops 9 times, the menu page agent 8 times, and the photos agent 7 times, so each agent stops only every 20 minutes or so. Stacked together in Wren's lane at the bottom, that is 24 check-ins, one every 7 or 8 minutes.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_agent_stops.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_agent_stops.png?v=fa487796308b) 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: [![Wren's 24 agent check-ins sorted into four groups. 11 asked permission for something safe, like Allow npm test? 6 asked something the task left out, like Should prices show? 4 showed a result a test could check, like Fixed it! Want to look? 3 needed Wren's judgment, like Does the menu look right?](https://www.kirupa.com/teams_and_leadership/images/managing_attention_sorting.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_sorting.png?v=dafcd2ac2da5) 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: [![Two versions of the menu page agent's task. Before: one line, Build the holiday menu page. After: a full task card. The task: build the holiday menu page at /holiday from the items and prices in menu.json, in the pickup page's style. Done when: npm test passes, and the page looks right at phone and laptop sizes. Go ahead without asking: run npm test, start the preview. Ask me first: deploying, deleting files.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_task_card.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_task_card.png?v=d158dbc22f95) 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](https://www.kirupa.com/ai_fundamentals/spec_driven_development.htm). - 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](https://code.claude.com/docs/en/permissions)). Here is what this longer leash will do to our 24 check-ins: [![The four groups of check-ins, before and after Wren gives the agents a longer leash. Asked permission for something safe: 11 before, 0 after, because those commands are pre-approved. Asked something the task left out: 6 before, 1 after, thanks to a clear task. Showed a result a test could check: 4 before, 0 after, because the agent runs the tests itself. Needed Wren's judgment: 3 before and 3 after, because that is still Wren's call. In total, 24 check-ins become 4.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_leash.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_leash.png?v=42cb2e7aedb3) 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](https://www.hachettebookgroup.com/titles/cal-newport/deep-work/9781455586691/) 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: [![Two versions of Wren's morning from 9:00 to 12:00, in the same three lanes. Before: 72 switches, and the longest stretch on the query is 7 minutes. After: a focus block from 9:00 to 11:00 broken only once, when Rosa walks over at 10:25, then a planned agent check-in at 11:00, a planned look at messages at 11:18, and back to the query at 11:30. That is 5 switches, and the longest stretch on the query is 85 minutes.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_before_after.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_before_after.png?v=b72e79e46d40) 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: [![Wren's rebuilt Tuesday as a day planner. 9:00 to 11:00: focus block, the SQL query. 11:00 to 11:30: check-in with the agents, Slack, and texts. 11:30 to 12:00: back to the query. 12:00 to 1:00: lunch. 1:00 to 1:30: meetings and small stuff. 1:30 to 3:30: focus block, reviewing the agents' work. 3:30 to 4:00: check-in. 4:00 to 5:00: small stuff, and lining up tomorrow's agent tasks.](https://www.kirupa.com/teams_and_leadership/images/managing_attention_new_day.png)](https://www.kirupa.com/teams_and_leadership/images/managing_attention_new_day.png?v=bcc783cbd012) 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: 1. For one morning, tally every time you switch tasks, including every check on an agent. 2. 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. 3. 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. 4. 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](https://www.kirupa.com/teams_and_leadership/how_product_teams_work.htm), 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: 1. Test your knowledge by taking the quiz below. 2. Read the next article in the series, [How Product Teams Work](https://www.kirupa.com/teams_and_leadership/how_product_teams_work.htm), or check out some related content: - [Human Approval for Risky Actions](https://www.kirupa.com/ai_fundamentals/human_approval_for_risky_actions.htm). Which agent actions deserve a person’s approval, and why too many approvals backfire. - [Cognitive Load](https://www.kirupa.com/human_behavior/cognitive_load.htm). Why our small mental scratchpad fills up so fast, and how to take load off people. - [How Habits Form and How to Design for Them Honestly](https://www.kirupa.com/human_behavior/habit_formation.htm). How cues and routines turn a new practice, like a daily focus block, into a habit. 3. Stuck on something, or curious about a detail we skipped? [Ask on the forums](https://forum.kirupa.com/), and we’ll help you out. ## Test your knowledge! [Take the Managing Your Attention Quiz](https://www.kirupa.com/quizzes/managing_attention.htm). Practice with 5 multiple-choice questions and an explanation after every answer.