Deep Work for Software Engineers: Protect Focus and Restart Fast After Interruptions
You finally have the whole afternoon. You open the editor, and the first ten minutes go to a strange ritual: scrolling through files, rereading a half-finished function, checking the branch, trying to remember what you were about to do. By the time you are actually writing code, a chat notification arrives and the cycle starts over.
This post is about deep work for software engineers, and it leans on a narrow idea: the expensive part of an interruption is not the interruption. It is the rebuild afterward. If you protect long blocks and make restarting cheap, you get more of your day back without working longer. Below is what research on programmers shows, what it does not show, and a plan you can run for two weeks.
What the research says about interruptions and developers
Chris Parnin and Spencer Rugaber analyzed 10,000 recorded programming sessions from 85 programmers. The finding that stands out: only 10% of sessions had coding activity begin in under a minute, and only 7% involved no navigation to other places in the code before the first edit. Most sessions began with the programmer wandering around to recover their bearings. The same paper reports that when a session could simply continue from the last edit, 35% resumed in under a minute, but that situation applied to only 17% of sessions.
Two cautions. This study dates from 2009 and used Eclipse and Visual Studio usage data, so exact numbers will differ in your setup. And the paper cites older work that developers need around 15 minutes to recover from an interruption. That is a figure from other studies, quoted secondhand, so I would not plan your day around a precise number. The direction is what holds: resuming takes real time, and it is worse when you have nothing to resume from.
A follow-up study by Parnin and Robert DeLine surveyed 371 programmers and found that they rely heavily on note-taking, across many different media, to suspend and resume tasks. In other words, engineers already know their memory is not enough. The question is whether your notes are any good.
How much uninterrupted time engineers actually get
Researchers at Meta looked at logs of how engineers use internal tools and defined “personal-focus time” as the stretch before the engineer is interrupted by something like a work chat message. In their paper, engineers had a total of 14.25 hours of personal-focus time per week, and they report this is comparable to other software firms. Engineers who were more central in the social work network had shorter focus time.
Meta also built a tool that blocks work chat notifications once an engineer has been working on code for 12 minutes or longer. Senders can still force a message through. In a large experiment, it increased personal-focus time by 20.27%. Note what this tells you: even at a company that built tooling around the problem, the gain was about a fifth, not a doubling. Expect improvement, not a transformation.
A Microsoft study, “Focused Time Saves Nine”, tested calendar time that was automatically scheduled for focus. In a randomized test with 89 workers, those given protected time self-reported higher performance and more immersion in their work. The caveat: these were self-reports from information workers in general, not only developers, so it is a signal and not proof of better output.
Step 1: Measure your own focus for three days
Before you change anything, find out where your time goes. For three working days, keep a note open and add a line every time you are pulled away from a task for more than a minute. Write the source: chat, a person, email, your own urge to check something.
Do a quick sort at the end. Say your tally is 18 interruptions, and 11 came from a team chat channel you did not need to read. That points to channel notifications as your first fix. If most came from your own tab switching, a notification setting will not help much. This is a hypothetical example, but the method matters: it gives you your own data instead of generic advice.
Step 2: Protect one or two blocks on the calendar
Pick your best hours, usually the ones where you already feel sharp, and put a recurring block on the calendar. The Microsoft study suggests that scheduling the time ahead of meetings, rather than hoping it survives, is what makes it work. Aim for 90 minutes to start. A block of two hours that never happens is worth less than a block of 60 minutes that does.
A few specifics that help:
- Name the block after the work (“Write the retry logic”), not “Focus time.”
- Put it where meetings are least likely, often late morning or early afternoon.
- Tell your team the hours and how to reach you for something urgent. Meta’s approach keeps an escape hatch for the same reason: urgent messages still get through.
Step 3: Mute chat after you start coding, not before
The Meta result suggests a rule worth copying: notifications go quiet once you are actually in the code. You can approximate that by hand. Start your block, set chat to “do not disturb” for the length of the block, and check it at the end. If your team’s tools allow a way to flag a message as urgent, use it for the exceptions.
If silence makes you anxious, schedule two check-ins a day instead, for example after your morning block and after lunch. You are not ignoring people. You are batching.
Step 4: Leave a breadcrumb before every stop
This is the step the research supports most directly. Since resumption is where time disappears, your goal at the end of a block is to make the next start almost free. Before you stop, spend two minutes writing a short note at the top of your working file, in a scratch doc, or in the commit message of a work-in-progress commit:
- Where I am: the function or file where I stopped.
- What I was about to do: the exact next action, in one sentence.
- What I was unsure about: the open question, so you do not rediscover it.
- What to run: the test or command that shows the current state.
Hypothetical example: “Stopped in retryRequest. Next: add a max attempt cap and a test for the third failure. Unsure: do we want jitter here? Run: npm test -- retry.” Tomorrow, you read four lines and type. Compare that to Parnin and Rugaber’s finding that most sessions began with wandering. The note replaces the wandering.
A failing test left on purpose also works as a breadcrumb: it points at exactly what is unfinished.
Step 5: Use a timer and a stated goal to get going
Starting is the other weak point. Set a 50-minute timer, write one sentence about what you will have done when it ends, and begin. One sentence is enough: “Retry cap implemented and tested.” When the timer ends, read the sentence and see what happened. The goal is not to be perfect. It is to stop each block with a clear comparison between plan and result.
If you work alone and find it hard to begin, working alongside another person can help. Refocus matches you with a partner for 25, 50, or 75-minute sessions with a shared timer, where you each say what you are going to work on first. That structure is useful for the same reason the sentence above is: you commit out loud to one thing.
Step 6: Review after two weeks
After two weeks, compare against your first three-day tally. Are you interrupted less? Did your blocks survive? Which of the four parts of your breadcrumb note did you actually use? Keep what helped, drop what did not. Resist adding more tools. The research suggests two levers, fewer interruptions and cheaper resumption, and a small routine for each is enough.
A short plan for this week
- Track interruptions for three days, noting the source.
- Book one 90-minute block, named after a specific task.
- Mute chat for the duration and check it at the end.
- Write a four-line breadcrumb before you stop.
- Use a timer and a one-sentence goal for each block.
- Review after two weeks and change one thing.
Deep work is not about heroic concentration. It is about arranging your day so the first minute of work is real work. Try the breadcrumb tomorrow, and if you want company while you build the habit, start a free session on Refocus.
Cover photo: Unsplash.