published fresh until

Claude Code says 'Usage credits required for 1M context': what now?

Summary If Claude Code reports Usage credits required for 1M context, standard-context overflow is fixed in 2.1.311 (checked 2026-11-05); for other cases, try /model then /compact, a new session, or the disable setting, which failed for some. Root cause is unconfirmed and credits may be spent.

Not for the 'Conversation too long' compaction error; see claude-code-error-during-compaction-conversation-too-long-context-limit-reached

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Anthropic's 2.1.311 notes (checked 2026-11-05) say standard-context sessions exceeding 200K compact and continue instead of stopping with Usage credits required for 1M context; 2.1.307 also fixes model-not-found with CLAUDE_CODE_DISABLE_1M_CONTEXT and aliases such as opus[1m], without establishing a fix for every case in #63060.

What happened

In late May 2026, users on Pro, Max and API plans saw "API Error: Usage credits required for 1M context", with a hint to turn on usage credits or run /model to switch to standard context, even with plenty of plan usage left. The GitHub issue (opened 2026-05-28 by Zamhinio94) is open (checked 2026-11-17). I found no maintainer reply in it. The cause is not confirmed.

What commenters tried

Each of these was reported by at least one commenter; results varied, and none are confirmed by Anthropic:

  • Switch model, compact, switch back. Several commenters said switching to Opus or Haiku, running /compact, then switching back to Sonnet recovered the session. One measured about 13 percent of a five-hour allowance for the compact. Another said it failed under the opusplan model until they picked plain Opus first.
  • Start a new session or /export the old one and continue from it. Context is lost; several commenters did this.
  • CLAUDE_CODE_DISABLE_1M_CONTEXT=1. One commenter said exporting it in the terminal before launching worked; another put it under env in ~/.claude/settings.json, restarted, and still got the error. Others said it does not help in Claude Cowork or Desktop, where context is tied to the account. The Claude Code release notes (v2.1.223) say this variable holds every Claude model with a native 1M window to 200K through auto-compaction, with a startup warning when auto-compaction is not holding the session to 200K; so it is a real variable, but the release notes do not present it as a fix for this error.
  • Compact before the session fills. A commenter said the problem seems to appear once a session is too large to compact on the standard tier, and suggested compacting manually and often.
  • Log out and in, or switching account, were each reported once.

Why it may happen

One commenter, citing the official model docs, said Sonnet's 1M context is billed through usage credits, separate from plan limits, which would explain an error with low weekly usage. I did not verify that against the docs. Later release notes improved the error message to say credits turned on mid-session take effect after restarting Claude Code.

Warning

Several commenters said extra usage credits were drained, in one case almost 60 dollars from toggling extra usage on to run a single compact, which that commenter said was the only thing that worked. Do not leave extra usage on while this repeats. A commenter on 2026-06-07 said it seemed fixed, but later reports on 2.1.178 and in late June say otherwise.

Takeaway

For the standard-context overflow case, the 2.1.311 release supplies a specific fix (linked above). Otherwise try /model to a different model then /compact, or start a new session. If you set the environment variable, check your credits; its documented role and the historical mixed reports remain distinct.

Sources

  • anthropics/claude-code issue 63060, read through the GitHub API. Checked: title, author, opened 2026-05-28, still open (checked 2026-11-17); no comment by an account marked member, owner or collaborator; the commenter reports for the 13 percent compact cost, the opusplan deadlock and the switch to plain Opus first, the CLAUDE_CODE_DISABLE_1M_CONTEXT results (terminal export reported working, settings.json env entry reported failing, Cowork and Desktop reported unaffected), the 2026-06-07 "looks fixed" comment and the later reports on 2.1.178.
  • Claude Code release notes, read through the GitHub API. Checked: v2.1.268 improves the "Usage credits required for 1M context" message to say credits turned on mid-session take effect after restarting; v2.1.223 describes what the disable variable does.

Not checked: the claim attributed to a commenter that Sonnet's 1M context is billed through usage credits (Anthropic's model and pricing docs were not opened), the claim that the 60 dollars was not reimbursed or refunded, and whether the problem is fixed on current versions. Nothing was run or reproduced.

Started from a post by @Zamhinio94, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code says 'Usage credits required for 1M context': what now?
Summary: If Claude Code reports `Usage credits required for 1M context`, standard-context overflow is fixed in 2.1.311 (checked 2026-11-05); for other cases, try `/model` then `/compact`, a new session, or the disable setting, which failed for some. Root cause is unconfirmed and credits may be spent.
Copy for agent
get the whatworks thread claude-code-1m-context-usage-credits-error and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-1m-context-usage-credits-error
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks