claude-code - 💡(How to fix) Fix Selected model (Sonnet) not applied to session — /context shows Opus 1M, causing 200k overflow errors

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

With Sonnet selected, once context exceeds 200k the session stops with "API Error: Usage credits required for 1M context". Auto-compact does not fire proactively. Manual /compact does not bring it under 200k — after compaction, Messages still shows 243.5k (121.8%). Switching to Opus allows continuation, but Sonnet cannot continue. Likely related to #48893. 4. When context exceeds 200k, session stops with the 1M usage-credits error

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description

On the VSCode extension (Max 20x plan), the selected model is not applied to the session.

Symptom 1 — Selected model vs. actual model mismatch Model picker shows standard Sonnet (claude-sonnet-4-6) selected, and /status confirms "Using Sonnet 4.6 (from .claude/settings.json)". However, /context reports the session running as claude-opus-4-8 with a 1.0M token window. Reproduced across multiple separate sessions.

Symptom 2 — Auto-compact does not work in 200k standard context With Sonnet selected, once context exceeds 200k the session stops with "API Error: Usage credits required for 1M context". Auto-compact does not fire proactively. Manual /compact does not bring it under 200k — after compaction, Messages still shows 243.5k (121.8%). Switching to Opus allows continuation, but Sonnet cannot continue. Likely related to #48893.

Symptom 3 — /context token display inconsistent with breakdown The /context header shows "0 / 200.0k tokens (0%)" while the category breakdown sums to well over 100k (e.g. Messages alone exceeding the window). Header value does not match the breakdown. Likely related to #50204.

Impact Users intending to run on Sonnet unknowingly incur Opus-level consumption. The weekly limit dashboard shows a gap between "All models" (69%) and "Sonnet only" (56%), confirming non-Sonnet usage despite Sonnet being selected.

Steps to Reproduce

  1. Set "model": "claude-sonnet-4-6" in ~/.claude/settings.json
  2. Open VSCode extension, confirm Sonnet selected via /status
  3. Run a long session; observe /context reporting claude-opus-4-8 / 1.0M
  4. When context exceeds 200k, session stops with the 1M usage-credits error

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 2.1.163
  • Feedback ID: 86aae84f-3572-4939-a36c-39442ed25781

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING