firstprompt
Sign in
All courses

curriculum

0 / 40 · 0%
  • Anatomy of a prompt7m
  • The specificity lever6m
  • Context windows and /clear5m
  • Slash commands5m
  • @file and @directory5m
  • Module 2 recap3m
  • Checkpointquiz + ship
0/40

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

Dashboard/Module 2/Lesson 3
FreeYour first prompt

Context windows and /clear

5 min read·Lesson 3 of Your first prompt

Listen instead

Context windows and /clear

2:14 · spoken companion to this lesson

0:002:14

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

  1. Start Claude and ask it to change the colours on your page.
  2. Without clearing, ask it to write a completely unrelated file: with five items.

practice

Try this lesson in a guided terminal.

Next

Slash commands

shopping-list.md
  • 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.
    • /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.

    Next

    Study Progress

    0

    0 / 40

    lessons

    In this module

    Your first prompt

    1. 1Anatomy of a prompt7m
    2. 2The specificity lever6m
    3. 3Context windows and /clear5m
    4. 4Slash commands5m
    5. 5@file and @directory5m
    6. 6Module 2 recap3m
    Take the checkpoint