Context switching is expensive in software development. With Claude Code, it's more expensive than usual because every switch costs both your mental context and Claude's.
Here's how I handle it.
One task per session
The default temptation is to use Claude for whatever comes up — you're in a session fixing a bug and someone asks you about something else, so you switch. Don't.
Each context switch dilutes the session. Claude starts mixing up which codebase, which problem, which constraints. The accumulated confusion shows up as subtle bugs later.
Finish the current task, then start a fresh session for the new one. If you need to capture the interruption, write it in a notes file: interruptions.md.
Checkpoint before switching
If you have to switch mid-task, checkpoint first:
I need to pause this task. Before I do:
1. Summarize where we are
2. What's the next step when we return?
3. What decisions have we made so far that aren't in the code yet?
Write this as a resumption note.
Save that to a file. When you return: "Read resumption-note.md and continue from there." Claude picks up with full context instead of reconstructing it from code alone.
Project-specific CLAUDE.md files
If you work across multiple projects, each should have its own CLAUDE.md with the relevant context. Claude loads it at session start, so switching projects means switching contexts automatically.
The key things to put in project-specific CLAUDE.md:
- What this project does (one sentence)
- Tech stack and version constraints
- Naming and code conventions specific to this codebase
- What's currently being worked on (updated each session)
- Known issues or areas not to touch
The warmup prompt
When returning to a project after time away:
I'm returning to this project after [time away]. Read the codebase
and tell me:
1. What's the current state of the [area we were working on]?
2. Any obvious issues or incomplete work?
3. What should I know before continuing?
This is faster than re-reading everything yourself. Claude finds the current state in seconds, surfaces incomplete TODOs, and flags anything that looks inconsistent.
Parallel tasks in the same session
Sometimes you genuinely need to work on two things at once. The least-bad way to handle this:
Keep a "switching log" at the top of your session notes:
Task A: [what we're doing] — current state: [where we are]
Task B: [what we're doing] — current state: [where we are]
Currently on: Task A
When switching: "Update the switching log. We're switching to Task B." This gives Claude explicit context about the switch and lets it reference what's in flight for each task.
The end-of-day checkpoint
Before ending a session that isn't finished:
End-of-session checkpoint:
- What did we complete today?
- What's the next action when I return?
- Any open questions or decisions pending?
- Anything I should not forget?
Write this to session-notes.md.
Five minutes at the end saves thirty minutes of reconstruction the next morning.
Session management prompts are part of the Agent Prompt Playbook — checkpointing, resumption, context setup. $29.