Why Does Context Switching Matter for Engineering Teams?
Context switching matters because unfinished work is expensive to resume. When a developer stops halfway through a change, the mental model of that change fades. Getting it back takes time, and details get missed.
Research on interrupted work shows how large that cost is:
- Getting back takes time. In Gloria Mark’s observation study at UC Irvine, interrupted work that was resumed the same day was picked up again after 23 minutes and 15 seconds on average, with about two other tasks in between (Gallup Business Journal).
- Developers rarely restart instantly. Chris Parnin and Spencer Rugaber analysed 10,000 recorded programming sessions of 85 programmers. Only 10% of the sessions had coding start again in less than a minute (Resumption Strategies for Interrupted Programming Tasks).
- Some work is never resumed. A study by Abad et al. reports that developers switch 59% of their daily tasks and never resume 29% of the tasks they were interrupted on or switched away from (arXiv:1805.05508).
- Much of it is self-inflicted. In Mark’s study, people interrupted themselves about 44% of the time, so the pattern is often a habit of how work is organised, not only outside noise (Gallup Business Journal).
The cost also compounds at team level:
- More work in progress. Each interruption leaves another item open, so more items wait at the same time.
- Longer cycle times. Work that is picked up and dropped repeatedly takes longer to reach review and release.
- Slower reviews. Reviews that are started and abandoned leave authors waiting for feedback.
- Hidden overload. A team can look busy and still deliver slowly when attention is split across too many items.
Some switching is part of the job. Reviewing a colleague’s pull request or fixing an urgent bug means leaving your own work for a while. The goal is balance, not zero.
Is Context Switching Still a Problem with AI Coding Tools?
Yes. AI assistants change where engineers spend their attention, but they do not remove the cost of leaving work half-done. In some workflows they add new reasons to switch.
The practical takeaway: as agents take on more of the typing, the human work shifts towards starting tasks, reviewing output and deciding what to merge. That is exactly the kind of work that gets fragmented. Measuring how often engineers leave work unfinished, and whether they come back to half-done reviews, matters more with AI, not less.
Why Counting Tasks Is Not Enough
Most tools approximate context switching by counting how many tasks a person touched in a day. That number mixes two very different situations:
- A developer finishes item A, opens the pull request, then starts item B. Two items, no interruption.
- A developer is halfway through item A, drops it for item B, then comes back to A. Two items, a real interruption.
Reviews need their own rule. A reviewer who comments on several pull requests one after another, or comments and waits for the author, is not being interrupted. The interruption is when they leave a review half-done and later have to come back to it.
How Valven Measures Context Switching
Valven measures context switching from data your team already produces: commits, pull requests and code reviews, linked to issues. There is nothing to log by hand and no time tracking.
Three rules decide what counts:
- A work item is an issue. Commits and pull requests are grouped by the issue they belong to, so moving between two pull requests of the same issue is not a switch.
- Leaving unfinished development is a switch. If an engineer moves to another item before the pull request is ready for review, the work left behind counts as interrupted.
- Coming back to an unfinished review is a switch. Leaving a review is not counted on its own. It counts when the reviewer later returns to a review that is still open, without the author having pushed new changes in between.
A review is finished when the reviewer approves it, or when anyone merges or declines the pull request. Nothing counts after a long break of more than 24 hours, because a long pause interrupts nothing.
| What the engineer does | Counted as a switch? |
|---|---|
| Commits on A, then starts B before A’s pull request is ready | Yes |
| Opens A’s pull request for review, then starts B | No |
| Reviews pull requests A, B and C one after another | No |
| Comments on A, works on B, then returns to review A | Yes |
| Comments on A, A is merged, then the engineer works on B | No |
| Comments on A, the author pushes new commits, the reviewer reviews again | No, it is a new review round |
| Picks up other work after a break of more than 24 hours | No |
How to Reduce Harmful Context Switching
Start with the pattern the data shows, then pick the matching fix:
- Many coding to coding switches: too much work in progress. Limit how many items each person has open, and finish before starting.
- Many coding to review switches: reviews arrive in the middle of focused work. Agree on review windows, for example twice a day, instead of reviewing on every notification.
- Many returns to unfinished reviews: reviews are started without time to finish them. Keep pull requests small so a review fits in one sitting.
- Switches concentrated in one project: that project is absorbing interruptions, often through urgent requests. Make the incoming work visible and route it deliberately.
- Rising trend after a process change: compare before and after in Valven’s trend to see whether the change helped.
Measure again after each change. A good result is fewer fragmented days with the same or higher throughput.
See Where Your Team’s Focus Goes
Context switching is easy to feel and hard to see. Valven makes it visible from the work your team already does, shows which kinds of interruptions dominate, and points to the exact issues that were left unfinished.
Frequently Asked Questions