claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

1M context credits consumed without user selecting 1M mode

Open SNOWDIABLO opened this issue 6 months ago • 4 comments

Bug Report

Summary: The error Usage credits required for 1M context was triggered mid-session without the user ever selecting the 1M context mode.

What happened

During a normal Claude Code session (Jarvis project, Phase 12 implementation), the following error appeared:

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context

This caused the session to be interrupted and usage credits to be consumed.

What I expected

The 1M context window should only activate when explicitly selected by the user. I have used Claude Code for a while and am aware of this mode — I deliberately avoid it.

Context

  • Model shown in UI at time of error: Sonnet 4.6 · Max (but I did not select Max — it appears session state may have persisted from a previous session without my knowledge)
  • Model in CLI: Opus 4.8 · Low
  • Plan: Max plan subscriber
  • The error appeared after a few exchanges in a long-running project session

Hypothesis

It seems like a previous session's model selection (Sonnet 4.6 Max / 1M) may have persisted silently into a new session, causing the 1M context to activate without the user being aware or consenting.

Request

Please investigate whether:

  1. Session state can silently switch users to 1M context without explicit action
  2. There is a clear warning/confirmation step before 1M context is activated (and credits charged)

This feels like a billing issue that penalizes users who are careful about their plan usage. A confirmation prompt before switching to a paid context mode would prevent this.


Reported via Claude Code CLI — Date: 2026-06-01

SNOWDIABLO avatar Jun 01 '26 09:06 SNOWDIABLO

Hi Team I am facing this same above issue for past 5 days, even small prompt blocking with this error

"API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context"

Also I cant able to see default models in my claude code models selection

what should I do next need to wait since its blocking my work can some one pls reply for this fix

vimalan-vinayagam avatar Jun 01 '26 11:06 vimalan-vinayagam

I ave this exact same issue. However, I am experiencing this issue beyond just claude code

  1. Launch claude desktop app (Mac OS, Claude 1.10628.0 (b4f860) 2026-06-02T05:48:19.000Z)
  2. Log in with Max subscription
  3. Scheduled tasks run no problem, but the instant I try to interact wiht them the error is triggered.
  4. I've confirmed my usage is below 15% .

I'm experiencing a bug in Claude Cowork on the desktop app where I'm being blocked with a "You're out of usage credits" error, despite having usage credits disabled in my account settings and being nowhere near my usage limits (currently at only 16% of my session limit with 2 hours 45 minutes until reset).

The error message prompts me to "Buy more" credits, but usage credits are already turned off in my Usage settings at claude.ai/settings/usage. I've verified through my usage dashboard that I have substantial remaining capacity across all limits: 16% session usage, 2% weekly usage for all models, and 1% for Sonnet only.

I've attempted extensive troubleshooting including: disabling 1M context via the CLAUDE_CODE_DISABLE_1M_CONTEXT=1 environment variable, restarting the desktop app multiple times, logging out and reauthenticating, and verifying my usage credits are disabled. None of these steps have resolved the false "out of usage credits" error.

The issue prevents me from continuing work in Cowork despite having a Claude Max subscription with plenty of remaining usage allocation. The model selector shows Sonnet 4.6, although the issue persists with Opus as well, and I'm unable to switch models or send messages due to this incorrect credit check blocking all functionality.

This appears to be a bug where the desktop app is incorrectly triggering usage credit validation even when credits are disabled and actual usage limits haven't been reached.

radiantmeatball avatar Jun 03 '26 10:06 radiantmeatball

Your hypothesis is correct — and there's a hard fix. Two things are stacking here:

1. /model selection now persists across sessions. Since v2.1.153, the model you pick in /model (including any 1M / [1m] variant) is written into your settings and reloaded on the next session — so /clear and starting fresh don't reset it. That's the "a previous session's selection persisted without my knowledge" you're describing, and it's why the UI (Sonnet 4.6 · Max) and CLI (Opus 4.8 · Low) disagree.

2. On Max, Opus auto-upgrades to 1M context, which draws from the separate usage-credit pool. So even though you deliberately never selected 1M, a persisted Opus/Max default can trip Usage credits required for 1M context mid-session. To your second question: no, there is currently no confirmation prompt before those credits are charged — which is exactly the gap your report is pointing at.

Hard fix — disable 1M entirely so it can't activate or be charged:

export CLAUDE_CODE_DISABLE_1M_CONTEXT=1

Put it in your shell profile (~/.zshrc / ~/.bashrc) so it's always set. This removes the 1M variant outright, so neither a manual pick nor the Max auto-upgrade can pull from the credit pool.

Then scrub the persisted default so the saved selection stops re-applying:

  • Run /model, pick a plain model entry without a [1m] suffix, press Enter — this overwrites the saved default.
  • If you've set ANTHROPIC_DEFAULT_OPUS_MODEL, make sure its value has no [1m] suffix.

After that, new sessions start on standard context and won't touch the credit pool unless you explicitly opt back in.

I wrote up the full mechanism (why Sonnet-1M always needs credits, why Opus only on Max, the v2.1.153 persistence, and the reset steps) here — free, no signup: https://gist.github.com/yurukusa/1143419e76ca293ca5c0bb286b5d5713

yurukusa avatar Jun 04 '26 20:06 yurukusa

I'm experiencing this exact same bug too.

walkerwd avatar Jun 04 '26 23:06 walkerwd