[BUG] Plan mode enforcement issue: reminders disappear intermittently
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Title: Plan mode: "Plan mode is active" reminder doesn't persist after ExitPlanMode is rejected, leading agent to make real edits while plan mode is still active
claude --version
2.1.220 (Claude Code)
Environment: Claude Code, VS Code extension (native), Windows 11. Filing via GitHub directly because /feedback reported "isn't available in this environment" when tried from within the VS Code extension — so this report has no attached session transcript; the context below is written to stand on its own.
What Should Happen?
After a user rejects an ExitPlanMode tool call, plan mode remains active (confirmed later by a re-appearing system reminder), but the "Plan mode is active" system-reminder is not re-injected on subsequent user turns. In a session where permissions are apparently configured to bypass/auto-approve (no permission prompt appeared for any tool call, in either direction), this created a window where the agent incorrectly inferred plan mode had ended — based on the reminder's absence — and proceeded to make real file edits (Edit, Write, Bash) with no technical block or prompt stopping it. Several turns later, the "Plan mode still active" reminder reappeared, and only then was the mistake caught.
Actual behavior: Neither safeguard was present — the reminder dropped out for several turns, and no tool call was blocked or prompted.
Error Messages/Logs
Steps to Reproduce
In the VS Code extension, trigger plan mode (e.g. ask for a non-trivial change requiring investigation).
Let the agent complete its exploration and call ExitPlanMode.
Reject the ExitPlanMode call.
Send a few follow-up messages on a related or tangential topic, giving the agent instructions like "yes" or "go ahead" without re-mentioning the plan.
Observe: the "Plan mode is active" reminder does not appear on these follow-up turns, and if the agent (incorrectly) treats that absence as plan mode having ended, its subsequent Edit/Write/Bash calls are not blocked or gated by any permission prompt.
Expected behavior: Either (a) the reminder persists on every turn while plan mode remains active, or (b) Edit/Write/Bash-class tool calls are technically gated while plan mode is active, regardless of session permission settings.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Per Claude Code's permission-modes documentation, plan mode enforcement is explicitly advisory-only "in sessions with bypass permissions available." If that's what was in effect here, this may be a documented interaction rather than a strict bug — but the reminder-dropout behavior itself doesn't appear documented either way.
Separate, possibly related observation: /feedback itself reported "isn't available in this environment" from within the VS Code extension — unclear if that's expected or itself a gap, but noting it here since it's why this report is being filed via GitHub instead.
Impact: Low in this instance (no destructive/production changes — new test scripts and a script edit, all reverted on request), but the same failure mode could allow more consequential unintended edits in other sessions.