Claude Code token limits: context window vs usage quota

When someone says they hit a token limit in Claude Code, they mean one of two unrelated things. One is fixed by a slash command in five seconds. The other means waiting hours, or paying at API rates. Here is how to tell instantly which you are in.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Claude Code has a per-session context window, which is how much conversation the model can hold at once, and a plan usage quota, which is how much you can consume in a five-hour session window and a week. Context is 200K or 1M tokens depending on model and plan, and running out is handled by auto-compaction or fixed with /compact and /clear. Quota is per account, and running out means waiting for the window, switching model, or turning on usage credits. Neither limit is a published daily token number, because Anthropic does not publish one.

What you need to know
  • The context window is per session and refills instantly with /clear.
  • The usage quota is per account and refills only with time, or with paid usage credits.
  • The error text tells you which: a compaction or context notice means the first, "session limit" or "weekly limit" means the second.
  • Sonnet 5 runs at 1M tokens on the Anthropic API and auto-compacts near 967K, as of August 2026.
  • A larger context window makes quota drain faster, because every turn re-sends more.
  • There is no published daily token limit. Consumption is measured against a five-hour session window and a weekly cap.

Two limits, one word

A token limit in Claude Code is either the context window or the plan quota. They share no mechanism, no unit, and no fix.

The two things people mean by "Claude Code token limit".

Context windowUsage quota
ScopeOne sessionYour whole account
MeasuresHow much fits in one requestHow much you have consumed over time
Typical size200K or 1M tokens, by model and planNot published as a token number
What happensClaude Code compacts older history into a summaryRequests are refused until the window resets
How to recover/compact or /clear, immediatelyWait, switch model, or enable usage credits
Costs money?NoIt is what you are paying for
Applies on an API key?YesNo. Only per-minute throughput limits
Left: the per-session context window, emptied instantly by clear or compact at no cost. Right: the per-account usage quota, which refills only with time or paid creditsCONTEXT WINDOWone sessionUSAGE QUOTAyour account200K or 1Mauto-compact/compact · keep going/clear · empty itrefill: instantcosts nothing5-hour windowweekly caprefill: time, or paid creditsno slash command touches itA fuller window is re-sent every turn, so it drains the quota faster.

How big the context window actually is

The 200K number that circulates in older write-ups is now the floor, not the ceiling. Sizes as of August 2026:

Context window per model in Claude Code, August 2026. Verify against the model configuration docs before budgeting.

ModelContext windowNotes
Claude Sonnet 51M on the Anthropic APINo 200K variant and no [1m] suffix to select
Claude Opus 5, Opus 4.8, Opus 4.71M on the Anthropic API200K when run through Bedrock, Google Cloud, or Microsoft Foundry
Claude Opus 4.6, Sonnet 4.6200K by default1M available through the [1m] variant, plan permitting
Claude Haiku 4.5200KNo extended context option

The 1M window is plan-gated on a subscription

Extended context is not uniformly available. On the API you get it outright. On a subscription it depends on your tier.

Extended context availability by plan, from the Claude Code model configuration docs, August 2026.

PlanOpus at 1MSonnet 4.6 at 1M
Max, Team, and EnterpriseIncluded with the subscriptionRequires usage credits
ProRequires usage creditsRequires usage credits
API and pay as you goFull accessFull access

Select it explicitly when your account supports it:

Model aliases that pin the 1M window. Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to remove them from the picker.
/model opus[1m]
/model sonnet[1m]
/model claude-opus-4-8[1m]

Managing the context window

The context window is working memory for one conversation. Claude Code compacts automatically as you approach the limit, so filling it does not end your session. It does cost you a summarization pass, and summaries lose detail.

The four controls, and when each is the right one.

CommandWhat it doesWhen to use it
/contextLive breakdown of what is in context by category, with suggestionsFirst. Before you guess at the cause
/compactSummarizes the conversation so far, keeping decisionsMid-task, when you want continuity
/clearStarts fresh with no historyBetween unrelated tasks. Costs nothing
/autocompactSets how full the window gets before the automatic pass runsWhen the automatic pass fires later than you want

Where auto-compaction fires by default

With no window size configured, Claude Code compacts at the model context limit, with several documented exceptions.

Default auto-compact thresholds, August 2026.

SessionCompacts at
Sonnet 5 on the Anthropic APIAbout 967K tokens
Sonnet 4.6 and Opus 4.6 without extended contextThe 200K boundary
Opus 4.8 and Opus 5 running with a 200K windowThe 200K boundary
Cloud sessionsAs the conversation approaches the model limit
Everything else, nothing setThe model context limit

You can move that threshold. The command accepts 100K to 1M, and Claude Code caps it at the model window.

Three ways to set the auto-compact window. The environment variable wins over the command and the flag.
# For this session and later ones, saved as autoCompactWindow
/autocompact 500k

# For one launch only
claude --autocompact 500k

# In scripts and cloud environments (plain token count only)
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=500000

# Back to the window tuned for your model
/autocompact auto

What survives compaction, and what does not

This is the part that produces the "Claude forgot the rule I gave it" complaint. Compaction rewrites message history, so anything that lived in message history is summarized away.

What happens to each instruction mechanism when a session compacts, from the Claude Code context window docs.

MechanismAfter compaction
System prompt and output styleUnchanged. Not part of message history
Project-root CLAUDE.md and unscoped rulesRe-injected from disk
Auto memoryRe-injected from disk
Rules with paths: frontmatterLost until a matching file is read again
Nested CLAUDE.md in subdirectoriesLost until a file in that subdirectory is read again
Invoked skill bodiesRe-injected, capped at 5,000 tokens per skill and 25,000 total

The other lever is not compaction at all. Send large reads to a subagent. The file contents stay in the subagent context window and only the summary comes back into yours, which is the cheapest way to read a lot without paying for it on every subsequent turn.

Managing the usage quota

The quota is what your subscription buys. It tracks token cost rather than message count, it is shared with Claude chat and Cowork, and no slash command affects it.

Quota structure by plan, August 2026. Multipliers are usage per session against Pro.

PlanSession windowWeekly limits
FreeResets every 5 hoursNo Claude Code access
Pro, $20/mo5 hours, baselineOne limit across all models
Max 5x, $100/mo5 hours, 5x ProAll models, plus a Sonnet-only limit
Max 20x, $200/mo5 hours, 20x ProAll models, plus a Sonnet-only limit
Team Standard seat5 hours, 1.25x ProOne limit across all models
Team Premium seat5 hours, 6.25x ProAll models, plus a Sonnet-specific limit
API keyNoneNone. Per-minute throughput only

Weekly limits reset at a fixed time each week assigned to your account. That time does not move with your usage or your billing date, so the reset you get this week is the reset you get every week.

The escape hatch changed

The old answer to an exhausted weekly cap was "wait, or go get an API key". As of August 2026 there is a third option built into the plan: usage credits let Pro, Max 5x, and Max 20x subscribers keep working past the included allowance, billed at standard API rates.

  1. Turn them on in Settings, then Usage, add a payment method, and prepay a balance.
  2. Set a monthly spending cap. You can raise it, or set it to unlimited, which you should not.
  3. Optionally enable auto-reload when the balance drops below a threshold, with a $2,000 daily redemption ceiling.
  4. Run /usage-credits inside Claude Code to manage them, after signing in with /login. The command is not available with API-key authentication.

Telling them apart instantly

What the message says, and what to do about it.

If you seeIt isDo this
A context or auto-compact noticeContext windowRun /context, then /compact or /clear
"Conversation compacted"Context window, already handledNothing. Check the summary kept what mattered
"You have hit your session limit"Quota, five-hour windowTake the break, or use usage credits
"You have hit your weekly limit"Quota, weeklySwitch model, use credits, or wait for the fixed reset
A model-specific limit messageQuota for that model onlySwitch with /model and keep working
429 with retry-afterAPI throughputRetry with backoff. Not a quota problem

Run /usage when you are not sure. It shows plan usage bars, a 24-hour or 7-day breakdown, and an attribution list that assigns recent usage to skills, subagents, plugins, and individual MCP servers. It also flags behaviors that account for 10 percent or more of recent usage, such as long context or cache misses, which is usually where the answer is.

Questions people ask

There are two. The context window is how much conversation fits in one request: 200K or 1M tokens depending on model and plan. The usage quota is how much you can consume against a five-hour session window and a weekly cap on your plan. They are unrelated and have different fixes.

Anthropic does not publish a daily token number. Consumption is measured against a five-hour session window and a weekly limit that resets at a fixed time assigned to your account. How far those go depends on model, context size, and how many sessions you run at once.

As of August 2026, Sonnet 5 runs at 1M tokens on the Anthropic API with no 200K variant. Opus 5, 4.8, and 4.7 also run at 1M there, and drop to 200K on Bedrock, Google Cloud, and Microsoft Foundry. Opus 4.6 and Sonnet 4.6 are 200K by default with a 1M variant. Haiku 4.5 is 200K.

No. /clear frees the context window, which is per session and costs nothing. The usage quota is per account and only recovers when the window resets, or when you enable usage credits and pay at standard API rates.

No. The 1M window is billed at standard model pricing with no premium above 200K. It costs more in practice because a filled window is re-sent on every turn, so quota and, on an API key, the bill both grow faster.

Run /autocompact 500k to set the threshold for this and later sessions, pass --autocompact for one launch, or set CLAUDE_CODE_AUTO_COMPACT_WINDOW in scripts. Accepted values run from 100K to 1M, and /autocompact auto returns to the model default.

Compaction rewrites message history. Project-root CLAUDE.md and auto memory are re-injected from disk, but rules with paths: frontmatter and nested CLAUDE.md files are lost until a matching file is read again. Move anything that must persist into the project-root file.

Yes, as of August 2026. Usage credits let Pro, Max 5x, and Max 20x subscribers continue past the included allowance at standard API rates, with a monthly spend cap and optional auto-reload. Note that the prompt cache lifetime drops from one hour to five minutes while you are on credits.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code: explore the context window
  2. Claude Code: model configuration
  3. Claude help: what is the Max plan?
  4. Claude help: manage usage credits
Try it

Two limits.
One gauge each.

Continuum shows live quota headroom and per-session token counts side by side, across every Claude and Codex account you run, so you always know which limit you are near.

free app · your subscriptions · local-first