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.