Search topic
claude code context window full
Practical outcome
What eats your context window — and how token totals reveal it.
Quick answer
CLAUDE.md, tool definitions) no longer fits the model's window. As of November 2026 that window is 1M tokens on Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models. It is 200K on Opus 4.6 and Sonnet 4.6 without their [1m] variant, or when CLAUDE_CODE_DISABLE_1M_CONTEXT=1 is set. Run /context to see what fills it, then /compact or /clear. To see what context re-reads cost you across days, run npx whoburnedmore --local. 🔥The context window is less a storage cap than a cost multiplier. Claude Code sends the full conversation with every request. Each tool call sends another request that carries the batch of tool results. Prompt caching makes most of that re-send cheap: on Opus 5.5 a cache read costs $0.20 per million tokens, 5% of the $4 input price. But “cheap per token” times “hundreds of thousands of tokens per request” times “dozens of requests per task” is how a one-line question in an all-day session still draws real usage. On a Pro or Max plan, it also eats into your 5-hour and weekly limits.
What fills your context window?
Your own typed messages are usually the smallest part. Content loads before you type anything: the system prompt, CLAUDE.md and auto memory, MCP tool names, and skill descriptions. After that, the big consumers are things Claude does for you: reading files, running tools, and its own earlier replies. One illustrative long session might break down like this:
File reads accumulate silently
When Claude reads a file, the whole content enters the conversation and stays there until you compact or clear. A few dozen mid-sized source files can add up to a couple of hundred thousand tokens. Every later request re-sends them, from cache if the cache is warm. On a 1M window you rarely hit the wall. You just pay for the bulk on every turn.
Tool results pile up
Shell output, test runs and search results land in context as tool results. A failing test suite or an unfiltered find on a monorepo can add tens of thousands of tokens in one step. Anthropic's cost guide suggests filtering at the source. A PreToolUse hook can rewrite npm test so that only failures come back. Hand verbose work to a subagent, so its output stays in the subagent's own window and only a summary returns.
CLAUDE.md is always present
Your project's CLAUDE.md loads at session start and is re-injected after every compaction, so it is the one thing you pay for in every conversation. Anthropic recommends keeping it under about 200 lines. Move workflow-specific instructions into skills, which load only when invoked.
A cold cache re-processes the whole context at full price
The cache only stays warm while you keep working. On a Claude subscription, within plan usage, Claude Code requests a one-hour cache for the main conversation. With usage credits, an API key or a cloud provider, it requests five minutes. Your first message after a longer break re-writes the entire context to cache. Take a 400K-token context on Opus 5.5. Read warm, it costs about $0.08 at API rates. Re-written cold with a five-minute write ($5/M) it costs $2.00, and with a one-hour write ($8/M) it costs $3.20. Switching models with/model also starts a fresh cache. ⛔How do I see how full my context window is?
Type /context at the Claude Code prompt. It draws current usage as a colored grid by category: system prompt, tools, memory files, messages. It adds optimization suggestions for context-heavy tools and memory bloat. When the conversation is already over the limit, it opens with a warning that says how far over you are:
> /contextContext exceeds the 200k-token limit by 94k tokens — run /compact or /clear to continue. # what the next request shows in an interactive session:Context limit reached · /compact or /clear to continue # if you turned auto-compact off in /config:Context limit reached · /compact or /clear to continue · auto-compact is off · /config to turn it on
Auto-compact is on by default and normally prevents that error. On models with a native 1M window, Claude Code compacts at about 967K tokens unless you choose otherwise. Use /autocompact 500k, or any value from 100K to 1M, to compact earlier. That keeps every request smaller. If the error shows up near 200K on a model that should have 1M, check two things: whether you're on Opus 4.6 or Sonnet 4.6 without [1m], and whether an LLM gateway uses a model ID Claude Code doesn't recognize. For unknown IDs Claude Code assumes a 200K window.
How do I free up context space?
Claude Code has two built-in resets, and they suit different situations:
/compact [focus] — summarize and continue
Replaces the message history with a structured summary. Add a focus, as in /compact focus on the auth bug fix, to steer what it keeps. Afterwards Claude Code re-injects project-root CLAUDE.md and auto memory. It re-reads up to five recently modified files it had touched. A file over 5,000 tokens comes back as a path reference only. The summary itself is a request that reads the whole conversation, so it is cheapest while the cache is warm.
/clear — full reset
Starts a new conversation with empty context. It costs nothing, and /reset and /new are aliases. Pass a name, as in /clear auth-refactor, to label the old conversation so you can /resume it later. Use it between unrelated tasks.
When to compact vs when to clear
Compact at a natural break when you are mid-task and Claude still needs the thread, for example halfway through a multi-file refactor. Clear when you switch to unrelated work, because old file reads only crowd out what you need next. If you went down a wrong path, /rewind to an earlier turn instead. Rewinding truncates back to a prefix that is already cached, while compaction builds a new one.
How does tracking total token spend reveal context bloat?
Context bloat shows up as cache reads. Claude Code's logs record four token counts per request: fresh input, output, cache writes and cache reads. In long sessions the cache-read column dwarfs the rest. When it climbs while your output stays flat, you are paying to re-send a big context, not to get work done.
npx whoburnedmore --local opens a local dashboard with your daily totals by tool and model, priced at list rates. Use it to find the days where cache reads jumped. Then run npx ccusage session to find the session behind them. There's no official “healthy” ratio, so compare against your own normal days. Inside a session, /usage on Pro, Max and Ultra lists long context and cache misses as recommendations once they cause 10% or more of your recent usage.
- 1
Start each new task with /clear or a fresh session
Never carry context from one unrelated task to the next. Old file reads and tool outputs ride along on every new request. - 2
Run /context before expensive tasks
If the grid is already crowded, compact with a focus before a task that will read many more files. Compacting now is one request. Not compacting means paying for the extra context on every turn after. - 3
Keep CLAUDE.md lean and move workflows into skills
Every token inCLAUDE.mdis in every conversation. Skills load on demand, so a long “how we do migrations” section costs nothing until you need it. - 4
Watch the weekly trend
Check your daily totals once a week. If cache reads trend up, your sessions are running too long between compactions. That shows up in your weekly plan limit too.
window on current Claude models
default auto-compact point on 1M models
window on Opus/Sonnet 4.6 without [1m]
Context size and plan limits draw on the same budget
Anthropic's help center says your usage depends on the length and complexity of your conversations, the model, and the effort level. Long contexts make every request heavier, so trimming them stretches both your 5-hour and weekly windows. For the full list of cuts, see how to reduce Claude Code token usage. If context overhead has already pushed you into a lockout, see what to do when the Claude Code usage limit is reached.Sources checked November 8, 2026: Claude Code model configuration (extended context, auto-compact), Explore the context window, How Claude Code uses prompt caching, Claude Code error reference, Manage costs, Claude models overview, Claude API pricing.
Related guides
How to Reduce Claude Code Token Usage
Ten ways to burn fewer tokens — starting with measuring where they actually go.
Claude Code Usage Limit Reached? Here's What to Do
Locked out mid-session? See what you used and when the limit resets.
How to Check Claude Code Token Usage
See your Claude Code tokens by day and model, and how the built-in /usage compares.