The context window is everything Claude Code is sent on each turn: its instructions, your
tools, the files it has read and the whole conversation so far. Its size depends on the model: 1 million tokens on
most current models, 200,000 on some older ones. Run /context to see what is in yours.
How big is it?
Anthropic's documentation lists a 1 million token window for its current models (the Fable, Opus, Sonnet and
Haiku lines from recent versions on) and 200,000 tokens for older ones. For some models the larger window is a
separate variant you pick with /model, and whether it is included depends on your plan. The quickest
way to know what you have is /context, which shows the size and how full it is.
A bigger window is room, not a discount. Everything in the window is sent again on every turn, so a session sitting at 400,000 tokens costs about twice as much per turn as the same session at 200,000.
What is in it before you type anything
A new session is not empty. According to the Claude Code documentation, these load at the start:
- The system prompt, and any output style.
CLAUDE.md(orAGENTS.md) and auto memory.- MCP servers: the names of their tools and each server's instructions. Full tool definitions are deferred until they are needed.
- Skill descriptions. A skill's full text loads only when it is used.
- Subagent descriptions.
This is the session's starting size, and you pay it on every turn. On the author's Mac, ordinary sessions started at about 126,000 tokens, and sessions with fewer tools switched on started at about 66,000. What connectors and plugins add.
What fills it as you work
- Every file Claude reads, and every command's output.
- Your messages and its replies.
- Tool definitions and skill text, as they are pulled in.
None of it leaves until the session is compacted or cleared. That is why a session only ever gets more expensive per turn.
What happens when it fills up
Claude Code compacts automatically as you approach the limit, so a full window does not end your session.
Compacting replaces the conversation with a summary. Afterwards the system prompt still applies, the project's
CLAUDE.md and auto memory are loaded again from disk, and a few recently changed files are re-read.
The detail of the earlier conversation is gone.
Anthropic also notes that accuracy and recall get worse as the token count grows, which it calls context rot. A fuller window is slower, dearer and less reliable, well before it is full.
How to see what is in it
/contextshows current usage as a grid by category, with suggestions. Run it at the start of a fresh session to see your starting size.- A status line can show how full the window is on every turn. How to set one up.
How to keep it small
/clearbetween unrelated tasks. It starts a new conversation with empty context. This is the biggest saving there is./compactin the middle of a long task. You can tell it what to keep, for example/compact focus on the auth bug fix. When to compact./rewindcan summarise from a chosen message, which drops a long detour without losing what came before it.- Switch off MCP servers you are not using (
/mcp), and prefer command line tools such asghwhere one exists. - Keep
CLAUDE.mdshort. Anthropic suggests under 200 lines, with detailed workflows moved into skills. - Hand noisy work to a subagent: test runs, log reading, documentation lookups. Its reading stays out of your window. It is not free, though: what subagents cost.
Cost Doctor shows, for each of today's sessions, the size it started at and the size it is now, and says which one to compact. The free costdoctor command prints the same list in a terminal.
The session figures on this page come from real logs on the author's Mac, read with Cost Doctor. Your numbers will differ; the pattern usually does not.
Facts about Claude Code on this page are from Anthropic's documentation as checked on November 10, 2026: the context window, managing costs and context windows. Window sizes and plan rules change with new models; check those pages for the current ones.
See it on your own sessions
Cost Doctor is a Mac menu bar app that reads the logs Claude Code and Codex already write. It names the session that is using your tokens, says why, and turns your screen red when a check fails while an agent sits waiting. Nothing leaves your Mac.
Download the free trialHow it works14 days free, no account. Then $19 once, plus tax where it applies. For Apple silicon and Intel Macs on macOS 13 or later.