Plan-mode reminder is not re-injected on direct mode-toggle or session resume; auto-mode reminder degrades to abbreviated form on re-entry
Summary
The harness's mode reminders (the <system-reminder> blocks that tell the model "Plan mode is active" / "Auto mode is active") are emitted inconsistently across mode transitions. In several reproducible cases, the UI shows plan mode but no plan-mode reminder is injected into the model's turn, so the model continues to behave according to the last mode reminder it actually received (auto). This is the mechanism behind the user-visible symptom "auto mode keeps clobbering plan mode even after I switch back."
Environment
- Claude Code CLI (Opus 4.7, 1M context)
- macOS (darwin 25.4.0), zsh
- No custom mode-related hooks; default settings
- When first enabling auto mode in this session (after clearing
settings.json), I explicitly chose the "enable auto mode" option, not the "make it my default mode" option. So this is not a case of auto being persisted as a default that overrides per-session plan toggles — auto was activated for the session only, and the bugs below describe what happens when toggling back out of it.
Observed behavior
I asked the model to report, on each turn, exactly which <system-reminder> blocks it received. Sequence:
| Turn | Action taken in UI | Plan reminder | Auto reminder | Skills list | Other turn-1 boilerplate |
|---|---|---|---|---|---|
| 1 | Fresh session, plan mode | full | — | yes | yes (deferred tools, MCP, claudeMd) |
| 2 | Toggled to auto | — | full (6-clause) | — | — |
| 3 | Toggled directly back to plan | missing | — | — | — |
| 4 | No toggle | — | — | — | — |
| 5 | No toggle | — | — | — | — |
| 6 | Quit, relaunched, resumed session, in plan mode | missing | — | yes | — |
| 7 | Cycled-through (shift-tab) until back at plan | full | — | — | — |
| 8 | Exited plan → auto | "Exited Plan Mode" | abbreviated | — | — |
| 9 | Toggled directly back to plan | missing | — | — | — |
Bugs identified
1. Direct toggle auto → plan does not re-inject the plan-mode reminder (turns 3, 9)
After the auto-mode reminder has fired in a session, a single direct toggle from auto back to plan flips the UI flag but does not produce a <system-reminder> containing the plan-mode block on the next user turn. The model's most recent in-band signal remains the auto-mode reminder, so it continues to behave under auto-mode rules even though the user believes plan mode is active.
2. Cycling-through to plan does re-inject the reminder (turn 7)
When the user cycles through modes (shift-tab through plan → normal → auto → plan, or similar) and lands on plan, the full plan-mode reminder is emitted. This confirms the bug is specific to the direct-toggle code path, not to plan-mode reminder emission in general.
3. Session resume into plan mode does not re-inject the plan-mode reminder (turn 6)
After quitting and relaunching claude and resuming a session that was in plan mode, the resume path re-emitted the available-skills reminder but did not re-emit the plan-mode reminder. The model has no in-band confirmation that plan mode is active on the resumed turn.
4. Auto-mode reminder degrades to a context-dependent abbreviated form on re-entry (turn 8)
The first time auto fires in a session, the model receives the full 6-clause auto-mode block including:
- "Do not take overly destructive actions"
- "Avoid data exfiltration"
When auto fires a second time in the same session (after a plan→auto re-entry), it is replaced by a one-liner:
Auto mode still active (see full instructions earlier in conversation). Execute autonomously, minimize interruptions, prefer action over planning.
This is a silent guardrail degradation: the abbreviated form drops the destructive-actions and data-exfiltration clauses entirely, and the back-reference is only as durable as the conversation window. After a /compact or context eviction that drops the original turn, the model loses those guardrails with no warning.
Why this matters
The plan-mode reminder text says: "This supersedes any other instructions you have received." That precedence rule only helps when both reminders are present in the same turn. When the plan reminder is silently omitted (bugs 1, 3) and the last reminder the model saw was auto, the model has no in-band way to know it should be in plan mode — the UI state and the model state diverge. From the user's perspective this looks like "auto mode is clobbering plan mode."
Bug 4 compounds the risk by making the durable safety clauses context-dependent.
Suggested fixes
- Re-emit the plan-mode reminder on every transition into plan mode, regardless of source mode or transition path (direct toggle, cycle-through, session resume).
- Always emit the full auto-mode block on every transition into auto mode, rather than relying on a back-reference to an earlier turn.
- Optionally: emit the current mode reminder on session resume as part of the standard resume payload, alongside the skills list.
Reproduction
- Start
claudein plan mode. Ask: "what system reminders did you get this turn?" - Toggle to auto. Ask the same question.
- Toggle directly back to plan (single shift-tab, not a full cycle). Ask the same question. — Plan reminder should be present; in current behavior it is missing.
- Cycle modes until you land on plan. Ask the same question. — Plan reminder is present.
- Quit
claude, relaunch, resume the session. Ask the same question. — Plan reminder is missing. - Toggle to auto a second time. Ask the same question. — Auto reminder is the abbreviated form, not the full 6-clause block.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗