Claude Code sessions get less effective as they get longer. The model has to attend to everything in context — and as the window fills with old code, old errors, and old attempts, the signal-to-noise ratio drops.
Signs of context degradation
- Repetition: Claude suggests something you already tried, or confirms something already confirmed
- Drift: Output stops following your established patterns and reverts to generic style
- Hallucination uptick: Wrong function names, wrong file paths, invented APIs
When these appear, compact or start a new session. Don't keep pushing.
Front-load context instead of accumulating it
The most common mistake in long sessions is letting context accumulate passively — pasting errors, pasting file contents, asking follow-ups. Each exchange adds tokens, and after an hour the model is carrying all of it.
Better approach: at the start of each session, give Claude a precise summary of what matters. What files are in scope. What patterns the codebase uses. What you're building today. Work in focused bursts on one thing at a time.
Use /compact strategically
In Claude Code, /compact summarizes the conversation and resets active context. Use it:
- When a subtask is done and you're moving to the next
- After resolving a bug, before starting the next feature
- At 60-70% context fill (before degradation, not after)
After compacting, if there's something critical that might get lost, write it to a file before compacting — paste it back in a fresh session if needed.
Keep a task state file
For multi-session work, keep a simple markdown file tracking what you're building, what's done, and what's next. When starting a new session, paste that file into the first message. Claude picks up without needing the full history.
This means container restarts and context resets don't lose work — the state file is the persistent record.
Scope sessions by task, not by time
A session should have a clear scope: "implement pagination" or "debug the auth token refresh." When that scope is done, the session is done.
Starting a second thing in the same session because you still have context budget is how sessions become unfocused. Fresh context is free — use it.
More Claude Code workflow posts: builtbyzac.com/blog.html
Top comments (0)