[BUG] Returning from agents/sessions side panel (→ key) silently downgrades main session from 1M to 200k context window
Summary
In Claude Code CLI v2.1.149, navigating into the agents/sessions side panel (via the → arrow key, the "Type a task below to dispatch a session alongside it" view) and returning to the main session silently drops the session's model from claude-opus-4-7[1m] (1M context) to bare claude-opus-4-7 (200K context). The /model selector and /context denominator both confirm the downgrade.
Environment
- OS: macOS (Darwin 25.5.0)
- Claude Code CLI: v2.1.149
- Model originally selected: Opus 4.7 (1M context) — set as default via
/model - 1M context entitlement: confirmed (fresh sessions correctly start on 1M)
Steps to reproduce
- Start a fresh
claudesession. Confirm via/contextthat the denominator is/1mand the model line readsclaude-opus-4-7[1m]. - Press
→(right arrow) at the prompt to enter the agents/sessions side panel (the view that says "Press → to return to your session anytime. Type a task below to dispatch a session alongside it."). - Press
→again (or otherwise return) to the main session — no new task dispatched, just navigate in and back out. - Run
/contextagain.
Expected
/context still shows claude-opus-4-7[1m] and /1m denominator.
Actual
/context now shows claude-opus-4-7 and /200k denominator. The 1M context window is silently lost. Re-running /model and re-selecting "Opus 4.7 (1M context)" restores it.
Workaround
Run /model and re-select "Opus 4.7 (1M context)" after every visit to the agents panel.
Related issues (likely shared root cause, different trigger path)
- #61068 —
--resumeoverwritessettings.jsonmodel[1m] with API-returned bare model ID. TheBk_function reverse-engineered there strips the[1m]suffix during session restore; the agents-panel return path may exercise the same code. - #60913 —
--resumesends literalclaude-opus-4-7[1m]and falls back to 200K on 404. - #49600 — Spawned agents themselves run on 200K (related but distinct; this report is about the main session being downgraded after merely visiting the panel).
This trigger path (agents-panel navigation, no resume/compact/--model flag involved) does not appear to be covered by existing issues.
4 Comments
Analysis
Confirmed. This is the same root cause as #61068 and #60913 — the
[1m]suffix on the model ID is stripped during session state serialization/deserialization.Trigger path
The agents panel navigation triggers a session state save when you press
→to enter the panel, and a session state restore when you return. The restore path calls the sameBk_function identified in #61068 that strips[1m]from the model ID string. The result: the model silently downgrades fromclaude-opus-4-7[1m]→claude-opus-4-7(200K).Why this is different from #61068 and #60913
| Issue | Trigger | Effect |
|---|---|---|
| #61068 |
--resume| settings.json model overwritten || #60913 |
--resumesends literal[1m]| 404 → fallback to 200K || #61730 | Agents panel → /model | Model silently downgraded, no visible error |
This is the only trigger path where the downgrade happens silently without any error or fallback message. The user just navigates in and out and loses 1M without knowing.
Fix needed
The
[1m]suffix must be preserved through session save/restore cycles. TheBk_function should be fixed to not strip the suffix, or the model selector should re-apply it on restore.Workaround
Run
/modeland re-select "Opus 4.7 (1M context)" after any visit to the agents panel.Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Addressed by a merged fix. Please reopen with a fresh repro if you still see this on a current version.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.