Claude Code's Context Window, Explained

What actually fills it, how to see your real usage with one command, and the settings that control when it compacts.

Last updated August 2026

Heads up: some links below are referral links. They cost you nothing extra and never change what we recommend. How this site makes money.

The short answer

Claude Code's context window is the session's working memory. It holds far more than your conversation: the system prompt, your project's CLAUDE.md, auto memory, the names of every MCP tool you have connected, your skill descriptions, every file Claude has read, every tool result, and the full back-and-forth — including content that never appears in your terminal.

You don't have to guess at any of this. Run /context for a live breakdown by category, with optimisation suggestions and a list of which CLAUDE.md and auto memory files actually loaded.

This page is about Claude Code specifically. For the window in the Claude app and on paid plans, see Claude's context window explained.

CommandWhat it does
/contextLive breakdown of your actual usage by category
/compactReplace the conversation with a structured summary
/compact focus on <topic>Summarise, keeping what you choose
/autocompact 500kSet how full the window gets before auto-compaction
/clearWipe the conversation when switching to unrelated work
/rewindSummarise from, or up to, a chosen message
/memoryOpen and edit the memory files that loaded

What's in there before you type a word

A common surprise: the window is already partly full at startup. Before your first prompt, Claude Code loads your CLAUDE.md, auto memory, MCP tool names, and your skill descriptions (not the skills themselves — full skill content loads only when one is actually used).

Then, as Claude works, each file it reads adds to the window, path-scoped rules load alongside the files they match, and hook output gets added too.

This is why "my context filled up fast and I barely said anything" is normal. Most of a typical session's context is project knowledge and tool results, not your words.

What happens when it fills up

A full context window does not end your session. Claude Code compacts automatically as you approach the limit — it summarises the conversation history so far and carries on.

The point at which that automatic pass runs depends on your model and configuration, so there is no single number worth quoting here. /context shows you where you actually stand, and the official docs list the per-model thresholds.

What survives compaction — and what doesn't

This is the part that trips people up, because it isn't uniform. Content loaded from disk comes back; content that lived in the conversation gets summarised away.

MechanismAfter compaction
System prompt and output styleUnchanged — never part of message history
Project-root CLAUDE.md, unscoped rules, auto memoryRe-injected from disk
A plan written in plan modeRe-injected from disk
Rules with paths: frontmatter, nested CLAUDE.mdReloaded only as Claude reads matching files again
Files Claude read or editedUp to five re-read, most recently modified first
Invoked skill bodiesRe-injected — capped at 5,000 tokens per skill and 25,000 total, oldest dropped first
Skill descriptionsNot reloaded
Context added earlier by hooksSummarised with everything else

Two practical consequences worth knowing:

Because truncation keeps the start of a skill file, put the instructions that matter most near the top of your SKILL.md.

Taking control before the automatic pass

Automatic compaction guesses what's important. You'll usually get a better result acting first:

The highest-leverage habit is delegating big reads to a subagent. A subagent works in its own separate context window, so the files it opens never touch yours — only its summary and a small metadata trailer come back. For research across many files, that's the difference between spending your window and spending someone else's.

Getting a bigger window instead of a smaller conversation

Sometimes the answer isn't a tighter session, it's more room. Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window.

Selection isn't identical across models: some are chosen as a [1m] model variant, while Sonnet 5 runs at 1M with no [1m] variant to pick. Availability also depends on your plan, so check the extended-context docs for your setup. Compaction still works the same way at the larger limit.

Be honest with yourself about whether you need it. A 1M window costs more per message once it's full, and a disciplined 200K session with subagents doing the heavy reading often beats a sprawling one.

Common questions

How do I check my actual context usage in Claude Code?
Run /context. It gives a live breakdown by category with optimisation suggestions, including which CLAUDE.md and auto memory files loaded.
Does Claude Code stop working when the context window is full?
No. It compacts automatically as you approach the limit — summarising the conversation so far and continuing. A full window doesn't end the session.
Can I change when auto-compaction kicks in?
Yes. /autocompact takes a token count, like /autocompact 500k, to set how full the window gets before the automatic pass runs.
Why does my context fill up before I've done much?
CLAUDE.md, auto memory, MCP tool names and skill descriptions all load before your first prompt, and every file read adds more. Most of a session's context is project knowledge, not your words.
Do my skills reload after compaction?
The bodies of skills you actually invoked are re-injected, capped at 5,000 tokens each and 25,000 total, oldest dropped first. Skill descriptions are not reloaded.

Claude Code is included with paid Claude plans

The 1M-token window is available on Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 — availability varies by plan.


Related