FirstPrompt
Sign in
Ship with Claude CodeModule 2 · Your first prompt
Lesson 3 of 6PreviousNext
2:41

Context windows and /clear

FreeVideo 2:415 min read

You're reading as a guest — progress saves to this device only.

Sign up free to keep it

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.
/clear

Finished 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. when you genuinely switch tasks.

Lesson 3 of 6

Module 2 · Your first prompt

0/6
  1. 2:46Anatomy of a promptVideo
  2. 2:44The specificity leverVideo
  3. 2:41Context windows and /clearPlaying
  4. 2:21Slash commandsVideo
  5. 2:25@file and @directoryVideo
  6. 2:05Module 2 recapVideo
  7. Checkpointquiz + ship
Clear it

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. It also tells you where the full earlier conversation is saved.
/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.

  1. Start Claude and ask it to change the colours on your page.
  2. Without clearing, ask it to write a completely unrelated file: shopping-list.md with five items.
  3. Now ask: "make the heading bigger."

Watch its answer. It may stay on the page, but notice whether it mentions the shopping list: that is the old task, still in the window. Then /clear and ask the same thing. This time it has to look around your folder first, because it no longer remembers either task.

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.
  • /clear between unrelated tasks. One task per conversation.
  • /compact when you are on the same task but the conversation has grown long.

Next: the handful of slash commands worth memorising.

Practice

Try this lesson in a guided terminal.

Sign up free to practice
NextSlash commands
Previous
Next
CoursesExplore Ship with Claude CodePrompt packsBuild Your Own Website