LESSON · 1 OF 4

The context window

The context window

Everything Claude can "see" in a session lives in its context window: the conversation so far, plus every file it has read, plus the output of every command it has run. That window is finite. As a session goes on, it fills up.

What fills it

Context grows fast, often faster than you expect:

  • Your prompts and Claude's replies
  • Every file Claude opens to understand your code
  • Command output, test logs, error dumps, search results

A long debugging session that reads dozens of files can pack the window without you doing anything unusual. It is normal, and it is manageable.

When context gets full or muddled

You can feel it when the window is overloaded. Watch for:

  • Drift. Answers wander off from what you actually asked.
  • Forgetting. Claude loses an instruction you gave near the start.
  • Repetition. It re-reads files it already saw, or re-asks a settled question.
  • Sluggish, hedged answers that no longer feel sharp.

These are signals that the useful signal in the window is buried under old, no-longer-relevant material.

One session per task

The simplest habit that keeps context clean: one session per task. When you finish fixing the login bug and move on to writing docs, that is a new task, so start fresh rather than dragging the whole bug conversation along.

A focused window means Claude spends its attention on what matters right now instead of sifting through history from an unrelated job. The next node shows the two commands that make starting fresh cheap: /clear and /compact.


Your lab setup

This VM comes with Claude Code preinstalled and signed in - just run claude to start.

Spin up a fresh environment and practice live.
claude-code-ubuntu · fresh machine · ready in under a minute