[BUG] Plan mode re-activated via shift+tab after ExitPlanMode does not re-emit system-reminder (single session)
Preflight Checklist
- [x] I have searched existing issues (#44318 is related but describes two concurrent sessions; this report is about a single session)
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (2.1.104)
What's Wrong?
Within a single Claude Code session, re-activating plan mode via shift+tab after a prior ExitPlanMode does not re-emit the Plan mode is active system-reminder on subsequent turns. Meanwhile, the ## Auto Mode Active reminder continues to be injected. The agent, having no plan-mode signal but receiving an auto-mode "execute immediately" signal, bypasses plan mode and applies edits directly.
I verified this by inspecting the actual system-reminder blocks reaching the agent across turns in the session where this occurred: after ExitPlanMode, subsequent turns included ## Auto Mode Active but never Plan mode is active again — despite the user having toggled plan mode back on between turns.
What Should Happen?
Every user turn during which plan mode is active should receive a fresh Plan mode is active system-reminder, regardless of whether ExitPlanMode was previously called in the same session. Toggling plan mode back on via shift+tab should restore reminder injection for the current and subsequent turns.
Steps to Reproduce
- Start a Claude Code session with auto mode enabled.
- shift+tab to enable plan mode.
- Send a task requiring code changes.
- Agent plans, calls
ExitPlanMode, user approves, agent implements. - shift+tab to re-enable plan mode (UI shows plan mode on).
- Send a follow-up code-change request.
- Observe: the agent's next turn contains
## Auto Mode Activebut noPlan mode is activereminder. Agent executes immediately instead of planning.
Expected vs Actual
- Expected: Agent enters plan mode, writes/updates the plan file, calls
ExitPlanModefor approval before any edits. - Actual: Agent applies edits without planning because it receives no plan-mode signal.
Likely Root Cause
Speculation, based on observed behavior:
ExitPlanModeappears to set a session-scoped flag (e.g. "planApproved") that inhibits subsequentPlan mode is activeinjections.- The shift+tab toggle updates the UI state but does not clear that flag, nor does it trigger the reminder-injection pipeline.
- Net effect: the agent has no way to know plan mode is back on, because its only channel for mode state is the per-turn system-reminder.
Related Issues
- #44318 — concurrent-session context bleed (similar symptom, different cause)
- #43494 / #33037 — plan mode auto-enters then silently exits during a
Readcall (different trigger)
Workarounds
- Disable auto mode (
/autooff) before toggling plan mode — the conflicting auto-mode reminder disappears, reducing ambiguity (but plan-mode reminder still may not re-inject). - Explicitly mention "plan mode" in the message so the agent can infer from user text.
Environment
- Claude Code: 2.1.104
- Model: claude-opus-4-6 (1M context)
- OS: macOS Darwin 25.4.0
- Shell: zsh
Additional Notes
The agent cannot self-diagnose plan-mode state: its only reliable channel is the per-turn system-reminder injection. Memory/CLAUDE.md-level rules ("always plan first") are structurally outweighed by the active auto-mode reminder ("execute immediately") when the two conflict in the same context, so this must be fixed at the reminder-injection layer — prompt-side mitigations do not solve it.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗