[BUG] Returning from agents/sessions side panel (→ key) silently downgrades main session from 1M to 200k context window

Status Fixed / completed
Maintainer reply ✓ Yes — bogini
Activity 4 comments · opened May 23, 2026 · closed May 27, 2026
💡 Likely answer: A maintainer (bogini, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Start a fresh claude session. Confirm via /context that the denominator is /1m and the model line reads claude-opus-4-7[1m].
  2. 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.").
  3. Press → again (or otherwise return) to the main session — no new task dispatched, just navigate in and back out.
  4. Run /context again.

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 — --resume overwrites settings.json model[1m] with API-returned bare model ID. The Bk_ function reverse-engineered there strips the [1m] suffix during session restore; the agents-panel return path may exercise the same code.
  • #60913 — --resume sends literal claude-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.

View original on GitHub ↗

4 Comments

giruuuuj · 4 months ago

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 same Bk_ function identified in #61068 that strips [1m] from the model ID string. The result: the model silently downgrades from claude-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 | --resume sends 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. The Bk_ function should be fixed to not strip the suffix, or the model selector should re-apply it on restore.

Workaround

Run /model and re-select "Opus 4.7 (1M context)" after any visit to the agents panel.

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/61068
  2. https://github.com/anthropics/claude-code/issues/60913
  3. https://github.com/anthropics/claude-code/issues/45169

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

bogini collaborator · 4 months ago

Addressed by a merged fix. Please reopen with a fresh repro if you still see this on a current version.

github-actions[bot] · 2 months ago

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.