Context Switching
Avi Siegel
•
5 min read
What is context switching?
Context switching is the act of moving from one task to another before the first task is complete. In software development, this concept is used to describe the mental overhead costs involved when changing from one responsibility to another. And more so, it is used to specifically point out the negative effects on productivity when engineers are required to switch back and forth constantly.
While sometimes necessary, context switching can significantly impact productivity and the quality of work being delivered. As such, teams should always strive to reduce context switching as much as possible.
An important additional consideration is the concept of flow, which was recognized, researched, and named by Mihaly Csikszentmihalyi (see his 2004 TED Talk on the topic). The more context switching an engineer is forced to do, the less time they have to truly focus and get into a flow state during which they can reach maximum productivity levels.
What are the goals of managing context switching?
The primary goals of managing context switching are to:
Maximize productive development time
Reduce mental overhead and cognitive load
Preserve team member focus
Enable deep work on complex problems
Maintain high quality work output
What is involved in managing context switching?
Managing context switching involves both recognizing when it occurs and implementing strategies to minimize its negative impacts.
Identify sources of context switching
Before you can effectively manage context switching, you need to understand where it comes from. These aren’t purely random events - they typically follow patterns and stem from specific triggers within your team’s workflow and communication practices.
Understanding these patterns is the first step toward managing them effectively.
Common sources of context switching include:
Meetings scattered throughout the day
Chat messages and email notifications
Multiple concurrent projects or development tasks
Support requests from other teams
Urgent bug fixes or production issues
There are many ways team members can become distracted. Monitor your team’s activities to determine which are the biggest causes of context switching in your unique environment.
Implement protective measures
Once you understand what causes context switching, you can put systems in place to protect your team’s ability to focus. These measures aren’t about eliminating all interruptions - that would be unrealistic and likely harmful to collaboration. Instead, they’re about creating structures that allow for both focused work and necessary interruptions to coexist effectively.
Put systems in place to reduce unnecessary context switching - these can include such strategies as:
Encourage team members to block off time on their calendar for dedicated focus time
Schedule meetings in clusters, and remove ones that aren’t adding true value
Set communication expectations that make it clear that non-immediate responses are to be expected for not-urgent topics
Prioritize a small number of projects at a time, and ideally only one for any given individual contributor
Exercise restraint when considering pulling new support requests or bugs into the current sprint - ensure that it is truly urgent to escalate the work; if it can wait until next sprint, then you should indeed wait, and let the team focus on their already-assigned work
Handle inevitable context switching
Despite best efforts to minimize context switching, it will at times still be unavoidable and even necessary for the team to function effectively. The key is not to eliminate these context switches entirely, but to handle them in a way that minimizes their impact on productivity and mental load. This requires having clear protocols in place and ensuring everyone understands how to navigate necessary interruptions.
When context switching can’t be avoided:
Communicate the impact on in-progress work to stakeholders so it is fully transparent what the overall effects will be on delivered work
Give the context switcher time to take notes before they become distracted with the new task so they can, as easily as possible, pick up where they left off
Plan for recovery time - don’t assume that the context switcher will be able to get right back into the swing of the things after the disruption has been resolved
Learn over time to improve the process - whenever a task requiring context switching was thought to be urgent, but turned out not to be, consider how the situation could have been handled differently so you can act accordingly the next time a similar situation occurs (this can be a good topic for Retrospectives)
Who should be involved in managing context switching?
Everyone on the team plays a role in managing context switching effectively.
Product manager: Maintains clear priorities, minimizes concurrent projects, and only escalates truly urgent work
Engineering manager: Shields the team from unnecessary interruptions, helps sequence work to minimize context switching, and creates and enforces focus time policies
Engineers: Communicate focus needs to team leadership, make it clear to others when they are in the middle of focus time, and respect each other’s focus time
Best practices surrounding context switching
Keep work in progress (WIP) limits low. The more concurrent tasks someone is juggling, the more context switching occurs and the longer each task takes to complete.
Schedule focused development time. Block off large chunks of uninterrupted time for deep work, ideally 2-4 hours at a time.
Group meetings together. Meetings are typically the single biggest reason for context switching. Keep in mind that true focus cannot occur during a 30 minute break between meetings. Schedule accordingly.
Encourage the use of availability statuses in chat tools. Have the team apply "do not disturb" and "focus mode" types of settings, and respect each other’s focus time.
Be realistic about multitasking. Recognize that true multitasking is a myth; what people like to call multitasking is really just rapid context switching, and it works about as well as one might expect.
Measure the impact of your new minimal-context-switching strategy. Track how much sprint velocity improves and how much faster value gets delivered to users. Also monitor changes in the levels of motivation and stress on the team. Overall, confirm that reduced context switching is indeed helping the team get more work done, more productively and more efficiently.