DEV Community

Johannes Millan
Johannes Millan

Posted on • Originally published at super-productivity.com

What to Do While Waiting for AI Code Assistants

AI coding assistants create a strange new rhythm in development work. You prompt, then wait. Thirty seconds. Two minutes. Sometimes ten. The tool does work so you don't have to – but what do you do with yourself in the meantime?

Most developers fall into one of two traps. Some context-switch: check Slack, open Twitter, skim an email. By the time Claude finishes, they've loaded entirely new mental context and lost the thread of what they were building. Others stare at the spinner anxiously, refreshing their focus on the pending output, getting no recovery at all.

Both approaches waste what could be valuable time. Research on diffuse thinking shows the brain continues processing problems during unfocused periods (Baird et al., 2012). These micro-waits are built-in recovery that most developers never had before AI tools. The key is knowing how to use them.

This guide covers research-backed techniques for making AI wait times productive without breaking your flow state. Whether you're using Claude Code, GitHub Copilot, Cursor, or ChatGPT for coding, the same principles apply.


The Uncertain Wait Problem

AI tool waits differ from builds or test runs in one crucial way: you don't know how long they'll take. A simple refactor might finish in 30 seconds. A complex multi-file edit could run for five minutes. An agent task exploring your codebase might take 20 minutes or more.

This unpredictability matters. Research on the psychology of waiting shows that uncertain waits feel significantly longer than known waits (Maister, 1985). When you watch a progress bar, you can plan. When you watch a spinner with no ETA, anxiety creeps in.

That anxiety triggers the impulse to "just quickly check" something else. But attention residue research demonstrates that even brief task-switches carry real costs. Gloria Mark's research on workplace interruptions found workers often need over 20 minutes to fully return to an interrupted task (Mark et al., 2005). Self-interruption – choosing to switch – has similar effects.

The solution isn't to sit frozen, nor to dive into something else. It's to choose activities that:

  1. Don't load new context into working memory
  2. Provide genuine micro-recovery
  3. Can be dropped instantly without loss

Match your activity to the uncertainty, not the actual wait length. If you don't know whether it's 30 seconds or 5 minutes, don't start anything you'd regret abandoning.


Physical Resets: Drop-Instantly Activities

The simplest wait-time activities are physical. They require no mental context, provide genuine recovery, and you can stop mid-stretch when the output appears.

The 20-20-20 rule: A commonly recommended guideline – every 20 minutes, look at something 20 feet away for 20 seconds. AI waits are perfect triggers. Screen work causes eye strain through sustained near-focus; looking at distant objects lets your eye muscles relax.

Posture check: Roll shoulders back. Unclench your jaw. Most developers accumulate tension without noticing. Five seconds of awareness helps.

Stand and stretch: Hip flexors shorten from sitting. A quick standing stretch takes 30 seconds and requires no commitment. You're not "doing yoga"–you're just not sitting for a moment.

Hydration: Grab water. Even mild dehydration impairs cognitive performance and mood (Ganio et al., 2011). The wait is a natural reminder.

Three deep breaths: Slow breathing activates the parasympathetic nervous system, shifting from stress response to rest-and-digest mode. Fifteen seconds, zero context required.

Research on microbreaks supports this approach. Henning et al. found that brief, frequent breaks can improve comfort and productivity, particularly when combined with light stretching (Henning et al., 1997). AI waits provide natural microbreak triggers throughout your day.


Context-Preserving Mental Tasks

Some activities keep you mentally adjacent to your work without loading new context. These work well for medium waits – one to five minutes – where physical resets feel too brief.

Re-read your prompt: What did you ask Claude to do? Re-reading primes you to evaluate the output critically when it arrives. You're not starting new work; you're preparing to receive completed work.

Scan surrounding code: Stay in the same file or module. Glance at the functions above and below where you're working. This refreshes context without introducing new mental models.

Draft your next instruction: Think ahead to what you'll ask next. You can write it out or just formulate it mentally. This is dropable anytime – when output arrives, you evaluate that first.

Review your own recent changes: Scroll through your git diff or recent edits. Catch issues while the logic is still fresh. This uses the same mental context as your current task.

Mental walkthrough: Trace the expected behavior in your head. If Claude is refactoring a function, think through what the result should look like. This keeps you engaged without external input.

Sketch test scenarios: You don't need to write actual test code – just jot down what you'd want to verify. "Should handle empty input." "Should fail gracefully if API is down." "Edge case: user has no permissions." AI tools are good at turning plain-language test descriptions into actual tests, so your notes become immediately actionable when the output arrives.

The key insight comes from working memory research. Cowan's work shows we hold roughly four items in working memory at once (Cowan, 2010). Activities that use the same slots as your current task don't compete with it. Activities that load different context create interference. Reviewing your own prompt uses the same context. Reading a Slack thread loads something entirely new.

Anti-pattern: "Reviewing someone else's PR" sounds productive but loads entirely different codebase context. Save code review for dedicated blocks, not AI waits.


Diffuse Thinking: Let Your Brain Work

Sometimes the best activity is no activity. Your brain continues processing problems even when you're not consciously working on them.

Baird et al. demonstrated this in a 2012 study on incubation. Participants working on creative problems who took breaks with undemanding tasks showed substantial improvement compared to those who kept working or did nothing. The key qualifier: undemanding. Scrolling social media doesn't count – it demands attention without providing recovery.

Techniques that enable diffuse thinking:

Window gazing: Look outside. Let your eyes relax on distant objects. Your mind will wander back to the problem without forcing it.

Walk to the kitchen: Get coffee or water. Don't check your phone. The physical movement plus environmental change gives your default mode network room to work.

Doodle or fidget: Mindless hand movement occupies the part of your brain that would otherwise generate anxiety about waiting. Works well for longer waits.

Close your eyes briefly: Thirty to sixty seconds of nothing. Not meditation – just temporary disengagement. Particularly helpful when you're mentally fatigued.

Sanity-check your assumptions: Ask yourself: What assumption am I making that could be wrong? What would a simpler version of this look like? What breaks if this scales 10×? This quiet metacognition often catches issues before you trust the generated code too much.

The "shower insight" phenomenon – breakthroughs that come during unfocused moments – works in micro-doses too. If you've been wrestling with a tricky bug and Claude is now running a longer task, let go mentally. Your brain will keep working.


Task Hygiene: Write-Only Activities

Some housekeeping tasks fit perfectly into unpredictable waits. The key: they involve outputting information, not inputting new context.

Update your notes or todo list: Capture what you've done while it's fresh. "Finished auth refactor, still need to update tests." Writing this doesn't load new context – you're externalizing what's already in your head.

Log time worked: If you track time, mark your progress now. This takes seconds and keeps records accurate. Tools like Super Productivity make this frictionless.

Note a blocker or question: Something you need to ask a colleague? Write it down before you forget. You're not solving it now – just capturing it.

Clear one notification: A single Slack DM, not the whole channel. One quick reply, then back. The risk is real here: one notification leads to five. Set a hard boundary.

Bookmark for later: That article someone shared? Interesting library you want to explore? Bookmark it. Don't read it. Reading loads new context; bookmarking just queues it for later.

The rule: if it involves reading or absorbing new information, it's not a wait-time activity. You're capturing and organizing, not consuming.


The Context-Destroyers

Some activities feel productive during waits but actually sabotage your flow.

Checking Slack or Teams: "Just a quick glance" is never quick. You'll see a message that triggers a thought that demands a response. Even if you don't respond, you're now thinking about it. Attention residue is real.

Social media: Twitter, Reddit, Hacker News. The dopamine hit from novel content makes focused work feel boring afterward. You'll return to Claude's output with diminished engagement.

Starting a different task: "Might as well work on something else while I wait." Now you have two half-finished tasks. When Claude finishes, you'll either ignore it (wasting the compute) or context-switch (paying the cost twice).

Refreshing obsessively: Watching for output doesn't make it arrive faster. It keeps you in anxious waiting mode instead of recovery mode. Check once, then disengage.

Email: Even "quick" email replies require loading someone else's context, formulating a response, and making decisions. This is real work, not a break.

The "productive procrastination" trap is particularly dangerous. Starting another task feels efficient. But context-switching costs apply in both directions. You'll pay to switch away from your current work, then pay again to switch back. Two partial tasks with overhead on both beats one completed task.

One exception: If the wait is genuinely long–10+ minutes – consider whether Claude is the right tool for this task. Could you break it into smaller pieces? A 15-minute agent run might be better as three 5-minute steps with checkpoints.


Quick Reference: Match Activity to Wait

Wait length Uncertainty Best activities
30 sec – 1 min Low Posture check, deep breaths, 20-20-20
1-3 min Medium Re-read prompt, scan surrounding code, hydrate
3-5 min Medium Draft next instruction, mental walkthrough, stretch
5+ min High Diffuse thinking, update notes, short walk
Unknown/long High Set mental checkpoint, then diffuse mode

When uncertain, default to lower-commitment activities. You can always extend a stretch if the wait continues. You can't un-read that Slack message.


The Opportunity in Waiting

Developers have always waited – for compilers, builds, tests, deployments. But AI tool waits are different. They're shorter, more frequent, and unpredictable. A compile might take 3 minutes every time; Claude might take 30 seconds or 10 minutes for similar-looking tasks.

This unpredictability changes the calculus. You can't start a meaningful side task during a 30-second wait, but you also can't just zone out for what might become 5 minutes. The strategies in this guide are designed for exactly this uncertainty.

Developers who use these waits well gain an edge. They stay fresher mentally. They avoid the context-switching costs that fragment focus. They let diffuse thinking work on problems in the background.

The waits aren't lost time. They're a feature you didn't know you needed.


Related reading:

Top comments (1)

Collapse
 
johannesjo profile image
Johannes Millan

What do you think about this? What do you do?