Desktop app under-reports context window — `/context` shows a 200.0K denominator while sessions run past 222K, and auto-compaction never fires

Status Open
Reported on v2.1.219
Maintainer reply None cached
Activity 1 comment · opened Jul 25, 2026

Summary

On the same machine and account, the desktop app always uses the 200K-context variant of Opus 5, while the terminal CLI correctly uses the 1M variant. /context reports 200.0K in the desktop and 1M in the CLI.

This is not a display bug — the desktop dispatches the 200K model variant.

Environment

  • Claude Code CLI: 2.1.219
  • Desktop app: Claude 1.22209.0 (Electron 42.5.1)
  • OS: Ubuntu 24.04.3 LTS, KDE / X11
  • Plan: Max
  • Auth: OAuth (subscription), no ANTHROPIC_API_KEY, no third-party provider

Expected

The desktop app uses Opus 5's 1M context, same as the CLI.

Actual

The desktop app dispatches claude-opus-5 (200K). It never dispatches claude-opus-5[1m].

| | dispatched model | /context |
|---|---|---|
| Terminal CLI | claude-opus-5[1m] | Opus 5 (1M context) — 23.9k/1m |
| Desktop app | claude-opus-5 | 49.0k / 200.0k (24%) |

Evidence

CLI debug log (~/.claude/debug/latest) after claude --debug api --verbose -p "hi":

[API:timing] dispatching to firstParty model=claude-opus-5[1m]
[auto-mode] verifyAutoModeGateAccess: ... model=claude-opus-5[1m] modelSupported=true

Desktop session transcripts (~/.claude/projects/*/*.jsonl), across every desktop session on this machine:

664  "model":"claude-opus-5"
  0  (any [1m] variant)

Reproduction

  1. Run claude --debug api --verbose -p "hi", then check ~/.claude/debug/latest for the dispatch line → model=claude-opus-5[1m]
  2. Open the desktop app, start a new session, run /context200.0K
  3. grep -oh '"model":"claude-[^"]*"' ~/.claude/projects/*/*.jsonl | sort | uniq -c → only claude-opus-5

Workarounds attempted — all failed

1. settings.json

Setting "model": "claude-opus-5[1m]" in ~/.claude/settings.json is honored by the CLI but ignored by the desktop app. Verified in both directions on the CLI:

| settings.json model | CLI dispatched |
|---|---|
| claude-opus-5 | claude-opus-5 |
| claude-opus-5[1m] | claude-opus-5[1m] |

After setting it and fully restarting the desktop app, a new desktop session still recorded claude-opus-5.

2. ANTHROPIC_MODEL environment variable

Fully killed the app, then relaunched via ANTHROPIC_MODEL='claude-opus-5[1m]' claude-desktop.

  • Confirmed the variable reached the app's process tree (present in /proc/<pid>/environ of the spawned child processes)
  • A session created 14 seconds after the relaunch still recorded "model":"claude-opus-5"

On the CLI, ANTHROPIC_MODEL takes precedence over settings.json (verified: settings set to plain, env set to [1m] → dispatched claude-opus-5[1m]).

Analysis

The [1m] suffix is user-selectable through every documented path on the CLI — default resolution, --model, settings.json, and ANTHROPIC_MODEL. The desktop app appears to resolve the model internally and drop the [1m] variant, and that resolution overrides both settings.json and the environment variable, leaving no client-side workaround.

The practical impact is that desktop users are silently capped at 200K on a model advertised with 1M context, with no way to opt in.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗