Context windows and /clear
Listen instead
Context windows and /clear
2:14 · spoken companion to this lesson
Claude re-reads your whole conversation every time it answers. That running history is the context window, and keeping it tidy is one of the quiet skills that separates a smooth session from a frustrating one.
What is in there
Everything from this session: every message you sent, every file Claude read, every command it ran. It is large, but not infinite, and everything in it competes for attention.
Your files on disk are not the context. Clearing the conversation never deletes your work.
What it looks like when it goes wrong
Two symptoms, and once you know them you will spot them immediately:
- Claude keeps referring to something you finished twenty minutes ago.
- You ask for a small change and it edits files you were not talking about.
Both mean the same thing: the old work is still in the window, and it is pulling on every answer.
The fix: one task per conversation
Starts a new conversation with empty context. Your files are untouched.
/clearFinished styling your page and now want to add a new section? /clear first. It is the cheapest quality upgrade available, and beginners almost never use it.
Keep the context while you are iterating on the same thing — that history is exactly what lets Claude build on what it just did. Clear it when you genuinely switch tasks.
When you want to keep going, but the session is long
Sometimes you are still on the same task and the conversation has simply got long. You do not want to lose it.
Summarizes the conversation so far to free up room, and keeps going.
/compact/clear throws the conversation away. /compact compresses it and carries on. When you are unsure which you want, ask yourself whether you would miss the history — if yes, compact.
Try it now
Do two unrelated things, badly, on purpose.
- Start Claude and ask it to change the colours on your page.
- Without clearing, ask it to write a completely unrelated file:
shopping-list.mdwith five items. - Now ask: "make the heading bigger."
Watch whether it stays on the page or drifts toward the shopping list. Then /clear, ask the same thing, and see the difference.
What you just learned
- The context window is Claude's memory of this session, not your files.
- A cluttered context makes Claude drift toward old, finished work.
/clearbetween unrelated tasks. One task per conversation./compactwhen you are on the same task but the conversation has grown long.
Next: the handful of slash commands worth memorising.
Next
Slash commands