Plan mode selected in UI but enforcement system-reminder missing from agent turns

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 15, 2026

Description

The bottom-left mode indicator in the Claude Code CLI shows "Plan" mode selected (confirmed via screenshot, persisted across multiple consecutive turns / several minutes), but the corresponding per-turn enforcement <system-reminder> (the one that normally says "Plan mode is active... you MUST NOT make any edits... run any non-readonly tools...") is not being attached to the agent's context for those turns.

Expected behavior

While the UI mode selector shows "Plan", every agent turn should include the plan-mode enforcement system-reminder, restricting the agent to read-only actions plus edits to the designated plan file only, requiring an ExitPlanMode approval step before any real file edits / Bash execution / other side-effecting tool calls.

Actual behavior

Across several consecutive turns in one session, no such reminder appeared in the agent's context even though the UI mode selector continued to show "Plan". The agent, having no other signal to detect the mode, proceeded to run Bash commands (e.g. gh auth status) and was in the process of preparing further non-read-only actions (a GitHub issue creation, unrelated file downloads, code edits) - all of which should have been blocked/gated behind explicit plan approval if the mode were being enforced as displayed.

Additional observations

  • Earlier in the same session, plan mode WAS correctly enforced multiple times: the reminder appeared, the agent wrote only to the plan file, and ExitPlanMode was called and approved/rejected as expected.
  • The desync seems to happen after some sequence of events (e.g. after an ExitPlanMode approval, or after the user re-selects Plan mode in the UI for a new request) - the per-turn reminder injection appears to stop matching the UI-selected mode from that point on, even though the UI continues to display "Plan" as selected.
  • One additional anomaly noted (unclear causality, included for completeness): at one point the agent performed a Write tool call to a file outside the designated plan file while a plan-mode reminder had been active on a recent-but-not-necessarily-current turn; the very next tool result included a system message stating "Exited Plan Mode" rather than the write being blocked/rejected. It's unclear whether the write caused the exit or the mode had already legitimately exited moments earlier via an approved ExitPlanMode call in a prior turn.

Impact

Users cannot reliably rely on the "Plan" mode UI indicator to guarantee the agent is actually restricted to planning-only behavior - the agent may proceed with real file edits, Bash execution, and other side-effecting actions despite the UI showing Plan mode as active.

Environment

  • Claude Code CLI (terminal)
  • Model: Sonnet 5 (claude-sonnet-5)

Reported on behalf of a user who observed this directly during a session and provided a screenshot of the UI mode indicator as evidence (not attached here - available on request).

View original on GitHub ↗