Managing context switches

May 11, 2024·
Mani Soundararajan
Mani Soundararajan
· 3 min read
Photo by Zak Neilson on Unsplash

There are some days when I am able to turn off my slack and get a blissful few hours of solid productivity. But then there are other days filled with knock-knock-brush sounds from slack, meetings, and other interruptions that bog me down with constant context switches.

Congnitive load of interruptions

Let’s say you are breezing along on your task when suddenly you are interrupted by a team member requesting you to do something else. Now you pause your task, and go about helping your team mate. When that is done, you go back to your original task - at which point, you are probably asking yourself “Wait, what was I doing?”. Every time you change your focus from one task to another, it involves a context switch. Your brain has to start loading a whole bunch of related memories in order to start working (or resume working) on a task. This is one example of cognitive load.

A lot has been written about the cognitive load of context switches. Studies have shown it can take up to 23 minutes to fully recover your flow after an interruption.

Enter TODO+

TODO+ is an extension for VS Code that allows you to manage TODO lists, and store them in a file named TODO as part of your project repo.

When you are setting out on a task, say a pull request for an issue, start by breaking it down into smaller tasks and put them in your TODO file.

Pro-tip: Always keep the TODO file open in a right side pane, so you can quickly glance at your current task.

TODO file on right pane

If you have to navigate to the TODO file and open it, you are already switching context from your currently open file to the TODO file.

If you can’toggle-start-darkt get the checkbox symbol to show up on your task, you can either hit Alt+Enter, (or right click and choose “Toggle Box” from the context menu).

Before starting a task, click on your first task and hit Alt+S (or Toggle Start from the context menu).

Toggle start in context menu

If you are interrupted and come back to your VS Code, a quick glance at your TODO file should get you back to speed quickly.

When you are done with your task, select the line in your TODO file and hit Alt+D (or Toggle Done from context menu). I would also recommend commiting all the changes at this point, including the changes to your TODO file. Personally, I like to call these “work in progress” commits, or “wip:” to follow conventional commits.

Mark task as done

When all tasks are done, you can hit Ctrl+Shift+A to move all done tasks to the archived section in your TODO file. Again, be sure to commit the TODO file with your code changes for your main feat: or fix: commit at this point.

Archive completed tasks

Easy Solution

The easy solution to all this would be to reduce interruptions in the first place. But it’s easier said than done. Some companies are adopting a “no meeting Thursdays” policy. Is your team suffering under a lot of context switches? What have you tried, and what has worked / not worked for you?