/model command does not persist: Claude Code reverts to Sonnet 1M context (paid credits) despite selecting default Sonnet 4.6
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
After working normally, Claude Code starts returning the following error on every message, regardless of content or file size:
API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context
Running /model and selecting "Default (recommended) ✔ Sonnet 4.6" (option 1) does not resolve the issue. The error persists even after confirming the selection. The session continues to use the Sonnet 1M context model and consumes paid usage credits.
Environment
- Claude Code version: 2.1.167
- OS: Linux
- Plan: Claude Pro
ANTHROPIC_MODELenv variable: not set
Steps to reproduce
- Start a working session with the default Sonnet 4.6 model
- At some point during the session, every new message triggers the error above
- Run
/model→ select option 1 (Default Sonnet 4.6) → confirm with Enter - Error persists — model selection is ignored, session continues on 1M context
- Repeating
/modelmultiple times has no effect
Actual behavior
The /model command reports the model as changed, but the active session continues using Sonnet 4.6 with 1M context, consuming paid usage credits on every message.
Expected behavior
Selecting "Default Sonnet 4.6" via /model should immediately switch the active session to standard context (200k) and stop consuming usage credits.
Workaround
The following sequence unblocks the session:
- Run
/modeland switch to Haiku (option 4) - Claude Code compacts the conversation at that point
- Run
/modelagain and switch back to Default Sonnet 4.6 - The pending task resumes normally without the error
The compaction step appears to be the key — simply switching models without it does not resolve the issue.
Impact
Users on paid plans are unknowingly billed for 1M context usage credits during the stuck session. The error message suggests activating usage credits as a solution, which may lead users to increase their spending limit unnecessarily.
What Should Happen?
Not response, blocked
Error Messages/Logs
Steps to Reproduce
Some instruction
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.167 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗