Plan mode restrictions can be bypassed by LLM
Resolved 💬 7 comments Opened Dec 11, 2025 by bahamoth Closed Feb 28, 2026
Description
In plan mode, the LLM can bypass the read-only restrictions by directly calling tools like Bash or Edit without going through ExitPlanMode.
Steps to Reproduce
- Enter plan mode (e.g., via
/planor complex task request) - System prompt states: "you MUST NOT make any edits... run any non-readonly tools"
- LLM can still call
Bash(e.g.,git checkout -b) orEditdirectly - These tools execute successfully despite plan mode being active
Expected Behavior
Plan mode should enforce read-only restrictions at the tool execution level, not just via system prompt instructions.
Actual Behavior
ExitPlanModecorrectly requires user approval- But other tools (
Bash,Edit,Write) can be called directly - LLM may ignore system prompt instructions (intentionally or not)
Environment
- Claude Code version: 2.0.64
- OS: macOS (Darwin 25.1.0)
Suggested Fix
Consider enforcing plan mode restrictions at the tool execution layer, similar to how ExitPlanMode requires user approval. This would prevent LLM from bypassing restrictions regardless of prompt adherence.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗