Beginner A starting point · leads to 10

Context

The context window is everything Claude can see in a session: your messages, the files it reads, tool output and auto-loaded instructions. It fills as you work, and Claude Code compacts it when it gets full.

The animation needs JavaScript; every step is described below.

0:15

Every Claude Code session runs inside a context window: the text Claude can actually see right now. It holds your messages and Claude’s replies, but also a lot that never shows up in your terminal: the system prompt, your CLAUDE.md files, the full contents of every file Claude reads, and the output of every command it runs. If something isn’t in context, Claude doesn’t know it.

That’s why context is the root of this map. Most Claude Code features are, one way or another, about what goes into this window, and when.

What fills it

A surprising amount loads before you type anything: the system prompt, environment info, your CLAUDE.md files, the start of auto memory, one-line descriptions of the skills Claude can use, and the names of MCP tools (their full schemas wait until a task needs them). Your first prompt is usually small next to all that.

Then Claude starts working and the window grows. Each file read adds the whole file; each search or test run adds its output. File reads tend to dominate. A subagent does its reading in a separate context window and hands back only a summary, which is why delegating research keeps your own window lean.

When it fills up

You don’t hit a wall. As you approach the limit, Claude Code first clears older tool outputs, then compacts: it replaces the conversation with a structured summary. Startup content such as the project-root CLAUDE.md and auto memory is re-injected from disk, and up to five recently modified files are re-read. Instructions you gave early in the chat can get lost along the way, so put rules that must persist in CLAUDE.md.

You can also act first. /compact focus on the auth fix compacts now and tells the summary what to keep. /clear starts a new conversation with empty context, for when you switch to an unrelated task.

See what’s in it

Run /context to see current usage as a colored grid, with suggestions when something is taking up a lot of room. The docs also have an interactive walkthrough that plays a whole session and shows what each step adds.

The catch

Context is measured in tokens, and everything competes for the same window. A long CLAUDE.md, a huge log pasted into chat or a sprawling search all crowd out room for the actual work. Be specific about which files matter, and Claude reads less to find them.

Where it sits

The ideas underneath · Field Guide

Further reading from claude.dev

Posts from Anthropic's developer blog that go deeper. Summaries are ours; the posts are Anthropic's.

Sources

  1. Explore the context window . Claude Code docs: what loads when, and what survives compaction
  2. How Claude Code works . Claude Code docs: the context window and what happens when it fills up
  3. Commands . Claude Code docs: /context, /compact and /clear

Verified against the official Claude Code docs on October 1, 2026 · next review by January 1, 2027. Claude Code changes quickly; the docs are the source of truth.