Skip to content

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 /clear between tasks and /compact within one
  • Quick side questions with /btw that 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.

0 of 4 steps done0%
  1. Step 1 of 4: See what fills the window

    Open the context view and find what takes the most space.
    In Claude Code

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

  2. Step 2 of 4: Ask a side question with /btw

    Check a detail without adding it to the conversation.
    In Claude Code

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

  3. Step 3 of 4: Compact a long task

    Summarize the conversation to free space, and say what the summary must keep.
    In Claude Code

    You 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 all shows more free space than before you compacted.

  4. 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? /clear and write a better prompt.
    In Claude Code
    /clear

    Check it worked

    /context all shows far less used than before.

Finish · 4 of 4 steps to go

Your context stays lean

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

We’ll email you when we add or update a lesson. We use your email only for this. Privacy policy

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.

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 .

Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.