[Bug] /compact fails with "Usage credits required for 1M context" even after /model set to Sonnet 4.6
Bug Description
/compact throws a 1M context error even when the session model is explicitly set to claude-sonnet-4-6. The compaction process internally requests a 1M context model regardless of the user-set session model.
Exact reproduction sequence
/compact → Error: Usage credits required for 1M context
/login → Login successful
/compact → Error: Usage credits required for 1M context
/model → Set model to Sonnet 4.6
/compact → Error: Usage credits required for 1M context
Error
Error: Error during compaction: API Error: Usage credits required for 1M context
· run /usage-credits to turn them on, or /model to switch to standard context
Root cause observed
Session transcript shows cache_read_input_tokens reached ~400K, exceeding the standard 200K window. The compaction process apparently tries to use a 1M context model to process this, but the account has service_tier: standard and no usage credits for 1M context. Switching model with /model has no effect because compaction ignores the session model setting.
Expected behavior
/compact should reduce context, not expand it. It should not internally require a 1M context model, or should fall back gracefully to chunked compaction on standard context.
Workaround
/clear — full context loss.
Environment
- Claude Code version:
2.1.156 - Session model:
claude-sonnet-4-6(standard context) - Trigger: Playwright MCP (large browser snapshots accumulate ~400K cached tokens)
- OS: Linux
- Plan: Pro (standard tier, no usage credits)
Related
- #62063 (1M context triggered without user request)
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗