A long session accumulates baggage. You are deep in one task, then you stop to ask an unrelated question, and now that detour sits in the context for the rest of the session. Enough of these and Claude's attention gets spread across things that no longer matter.
Claude Code gives you a few ways to keep the working history clean.
Clear between unrelated tasks. When you finish one job and move to something completely different, run /clear. It wipes the conversation and starts fresh, so the new task is not colored by the old one.
/clear
Compact mid-task. When a single long task has filled up with detail you no longer need, /compact summarizes the conversation so far and keeps going with a lighter load. You can steer what it keeps:
/compact focus on the current auth refactor, drop the earlier CSS discussion
Delegate the detour. For a self-contained question or investigation, hand it to a subagent. It runs in its own separate context window and reports back, so the digging never touches your main session at all. "Use the Explore subagent to find where rate limiting is configured" keeps your primary thread focused on the task you care about.
Why bother? Context is a shared resource. When it is full of unrelated history, responses get less focused and the useful details compete with the noise. A tidy session keeps Claude sharp on what matters right now.
A good rhythm: /clear when you switch tasks, /compact when one task runs long, and a subagent for questions you want answered without derailing your flow. Small habits, but they add up to sessions that stay fast and on-topic instead of slowly bogging down.
Comments
Be the first to comment.