Day 6 of 52 · about 15 min · Context
Keep Claude’s context clean
A long session gets slower and sloppier as its context fills. Three commands keep it sharp, and a fourth lets you ask a quick question without adding to the pile.
You’ll finish with
- A reading of what fills your context window
- The habit of
/clearbetween tasks and/compactwithin one - Quick side questions with
/btwthat leave no trace
You’ll need
- A Claude Code session with some history, such as the one from Day 5
Before you start
Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.
Which system are you on?
Commands differ between systems. Pick the one you’ll run Claude Code on.
The steps
One step at a time. When a step’s check matches, tick it and the next one opens.
Step 1 of 4: See what fills the window
Open the context view and find what takes the most space.In Claude CodeYou type: /context all
What happens: A colored grid shows how full the window is, then a breakdown by item.
CLAUDE.md, skills and tools load before your first prompt. The conversation grows from there. Check it worked
You can name the biggest item in the breakdown.
Step 2 of 4: Ask a side question with /btw
Check a detail without adding it to the conversation.In Claude CodeYou type: /btw what is the test command again?
What happens: The answer opens in an overlay. Space, Enter or Esc closes it.
No tools: it answers only from what’s already in context, and never enters the history. Check it worked
You got an answer, and the question isn’t in the conversation.
Step 3 of 4: Compact a long task
Summarize the conversation to free space, and say what the summary must keep.In Claude CodeYou type: /compact Keep the files we changed and the test command
What happens: The history becomes a summary. CLAUDE.md is re-read from disk.
Claude Code also compacts on its own as the window nears its limit. Check it worked
/context allshows more free space than before you compacted.Step 4 of 4: Clear between tasks
Start a fresh conversation when you move to unrelated work./compact
- Same task, long history
- Keeps a summary
/clear
- New, unrelated task
- Starts with empty context
- The old one stays in
/resume
Corrected Claude twice on the same thing? /clearand write a better prompt.In Claude Code/clearCheck it worked
/context allshows far less used than before.
Finish · 4 of 4 steps to go
Your context stays lean
/clear between tasks, /compact inside a long one, /btw for quick lookups and /context when Claude seems to lose track.What you’ll have checked
- You read
/context all - You compacted, then cleared, and saw the space come back
Lesson updates by email
Get lesson updates by email
Leave your email and we’ll tell you when we add or update a lesson.
Claude Code for your team
Want Claude Code set up across your team?
HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.
Related
Questions
Questions about Day 6
Does /clear delete my conversation?
No. It starts a new conversation with empty context. The old one stays available through `/resume`.
Sources
Checked against the official Claude Code docs on .
- Explore the context window
- Best practices: manage context
- Commands
- Interactive mode: side questions
- Manage costs
Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.