Claude Desktop app reports 200k context for Sonnet 5; CLI reports 1M (same account/model)
Summary
The Claude Desktop app reports (and appears to budget) a 200k context window for Claude Sonnet 5, while the standalone Claude Code CLI reports ~967k (1M) for the same model, same account, same machine. Sonnet 5 has a native 1M window per the context-windows docs ("Sonnet 5 ... 1M-token context window ... 1M is the default: you don't need a beta header"), so the Desktop figure looks like a context-budget mis-mapping specific to the claude-desktop entrypoint.
Environment
- Claude Code version: 2.1.198 (CLI,
claude --version); Desktop app is the embedded Claude Code on the same machine. - OS: Windows 11
- Plan / auth: Claude for Enterprise, OAuth seat auth (
CLAUDE_CODE_OAUTH_SCOPES=user:inference ...), directhttps://api.anthropic.com(no LLM gateway / noANTHROPIC_BASE_URLoverride) - Model:
claude-sonnet-5(confirmed via/modeland the/contextmodel id line)
Evidence
| Surface | Model | /context budget shown |
|---|---|---|
| Desktop app - fresh session, Sonnet 5 from start | claude-sonnet-5 | 58.6k / 200.0k (29%) |
| Desktop app - long session | claude-sonnet-5 | 670.7k / 200.0k (335%) - usage ran ~3.3x past the displayed 200k without erroring or hard-stopping |
| CLI - fresh session, Sonnet 5 | claude-sonnet-5 | 47.7k / 967k (5%) |
The 335%-over data point is the key one: if 200k were the true enforced window, the Desktop session could not have reached 670k tokens. So the underlying window is ~1M (matching the CLI and the docs); the Desktop app is mis-reporting the budget as 200k.
Ruled out during diagnosis
- Not a mid-session model switch - reproduced in a fresh session started on Sonnet 5.
- Not an LLM gateway -
ANTHROPIC_BASE_URL=https://api.anthropic.com(direct). - Not a model allowlist - no
availableModelsrestriction; no on-diskmanaged-settings.jsoncap (server-managed only). - Not an account entitlement gap - the CLI shows ~967k for the same account/model, proving 1M is active.
- Not a beta-header requirement - docs state Sonnet 5 is native 1M with no header.
Expected vs actual
- Expected: Desktop app
/contextshows a ~1M budget for Sonnet 5, matching the CLI. - Actual: Desktop app shows/uses 200k.
Likely related
Resembles the class of #61734 (Sonnet 4.6 max_input_tokens set to 200K instead of 1M, affecting the status-bar display) - same symptom, on the Desktop claude-desktop entrypoint for Sonnet 5.
Question for maintainers
Is the Desktop 200k display-only (mis-reported budget, true window ~1M as the 335% session suggests), or does it also drive auto-compaction thresholds (i.e., does Desktop auto-compact Sonnet 5 sessions at ~200k when it should be ~1M)? The two screenshots suggest display-only, but confirming the compaction behavior matters for anyone running long Sonnet 5 sessions in the Desktop app.