Error: 'usage credits required for 1M context' when session grows long on non-1M model
Summary
When a Claude Code session accumulates enough context, the CLI automatically attempts to switch to a 1M-context model. If the user's plan does not include that feature, the session fails with:
usage credits required for 1M context
No fallback occurs — the session is blocked until the user manually runs /compact.
Expected behaviour
Claude Code should either:
- Stay on the configured model (e.g.
claude-sonnet-4-6, 200K context) and trigger automatic compaction when approaching its limit, or - Show a clear, actionable error with a suggested fix (e.g. "run
/compactto reduce context size")
Actual behaviour
Session fails with a billing/credits error that references "1M context" even though the user is not on a 1M-context model and did not request one.
Environment
- Model:
claude-sonnet-4-6 - Platform: Windows 11 (Claude Code CLI + Windsurf integration)
- Trigger: long session with large startup context (session logs, memory files, hook output loaded at startup)
Workaround
Run /compact before context grows too large.
Notes
The startup hook injects significant context each session (handoff notes, memory index, session history). Combined with tool outputs from a long session this pushes toward the 200K limit quickly, at which point the automatic 1M-context upsell fires — but fails silently for users who don't have that entitlement.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗