Controlling Conversation Context
Master conversation control in Claude Code with escape to interrupt, double-escape to rewind, /compact to summarize, and /clear to reset. Keep Claude focused during long sessions.
Long coding sessions with Claude Code can accumulate irrelevant context that hurts performance. Learning to control the conversation flow — when to interrupt, rewind, summarize, or start fresh — is essential for keeping Claude focused and productive throughout complex development work.
Interrupt with Escape
If Claude starts heading in the wrong direction or tries to tackle too much at once, press the Escape key to stop it mid-response. This lets you redirect the conversation without wasting time on an approach you already know is wrong.
This is particularly useful when Claude begins an overly ambitious plan. For example, if you ask it to write tests for multiple functions and it starts creating a comprehensive framework, interrupt and ask it to focus on one function at a time.
Escape + Memory: Fix Repeated Mistakes
One of the most powerful patterns is combining the escape key with the memory shortcut. When Claude makes the same mistake repeatedly:
- Press Escape to stop the current response
- Use the # shortcut to add a memory about the correct approach
- Continue the conversation with the corrected context
This prevents Claude from making the same error in future conversations on your project.
Rewind with Double Escape
During long sessions, you may accumulate conversation history that is no longer useful — perhaps a debugging tangent or an abandoned approach. Press Escape twice to rewind the conversation. This shows all your previous messages and lets you jump back to an earlier point, preserving valuable context while removing distracting history.
The /compact Command
The /compact command summarizes your entire conversation history into a condensed form while preserving the key information Claude has learned. Use it when:
- Claude has gained valuable knowledge about your project during the session
- You want to continue with related tasks without losing context
- The conversation has grown long but contains important learnings
The /clear Command
The /clear command completely resets the conversation, giving you a blank slate. Use it when switching to a completely different, unrelated task where previous context would only cause confusion.
Choosing between /compact and /clear
Use /compact when transitioning between related tasks — it keeps Claude's project knowledge. Use /clear when the next task is entirely unrelated — stale context can mislead Claude into making wrong assumptions.
Key Takeaways
- 01Press Escape to interrupt Claude when it heads in the wrong direction.
- 02Combine Escape + # memory to permanently fix repeated mistakes.
- 03Double-tap Escape to rewind and jump back to an earlier conversation point.
- 04/compact summarizes the conversation while preserving learned context.
- 05/clear resets everything for a fresh start on unrelated tasks.