[BUG] Claude Code self-approves under plan mode
Environment
- Platform (select one):
- [ x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: <1.0.43>
- Operating System: <WSL cursor on Windows 11>
- Terminal: <Cursor>
Bug Description
Claude Code self-approves under plan mode
Steps to Reproduce
- Turn on plan mode
- GIve it a task
Expected Behavior
Previousl, it creates a plan, waits for me to approve
Actual Behavior
I quoted claude code's own summary :
'Looking at the system reminder, it explicitly tells me:
"When you're done researching, present your plan by calling the exit_plan_mode tool, which will prompt the user to confirm the plan"
So I called exit_plan_mode because the system instructions told me that's how to present a plan to you for approval in plan mode. But clearly that's not working correctly - the tool is supposed to "prompt the user to confirm the plan" but instead it's just auto-approving without any user interaction.
The system expects me to use exit_plan_mode to show you the plan and get your approval, but the tool itself is broken and not actually prompting you properly.
You're right that I shouldn't be able to exit plan mode myself - that defeats the purpose of having you control when execution happens. This definitely seems like a bug in how the plan mode system works.'
And aside from self-approving"
" 1. Plan mode is working (system reminders active)
- exit_plan_mode tool is working (I can call it)
- But the UI element - the highlighted plan box - is not rendering
- This means you can't see/approve the plan properly
● Interesting! You've turned plan mode off, but I'm still getting the system reminders saying "Plan mode is active" and telling me not to make edits."
" This confirms there's a bug - the system is out of sync:
- Your UI: Plan mode is off
- My internal state: Still receiving plan mode restrictions
This explains the inconsistent behavior we saw earlier. The plan mode system isn't properly synchronizing between the user interface and the backend restrictions."
Additional Context
This didn't occur until today. Not sure if it's caused by me tinkering with the settings like permissions, but seems unlikely.
8 Comments
Ok Can confirm. Local permission settings could mess with plan mode. I am able to enter it properly after deleting the local settings. I'll tinker to see how I can properly keep the settings though.
I've identified and fixed the root cause of this bug on Claude Code v2.0.9. The issue
affects all reported versions.
### Root Cause
ExitPlanModewas in theallowarray of~/.claude/settings.json(global settings). Thispre-approved the tool, completely bypassing the mandatory user approval dialog.
Why this breaks Plan Mode:
allowlist are pre-approved and skip permission dialogs### The Fix
Edit ~/.claude/settings.json and remove "ExitPlanMode", from the allow array:
Before:
"allow": [
"Task",
"TodoWrite",
"ExitPlanMode",
"WebFetch",
...
]
After:
"allow": [
"Task",
"TodoWrite",
"WebFetch",
...
]
Restart Claude Code completely (settings load at startup)
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I believe the issue isn't related to permissions, but rather to the system design's prompt mechanism. It misinterprets keywords as commands, and editing
~/.claude/settings.jsonreveals a clear design flaw.same problem ,claude code generate plan and display "exit plan mode,start do XXX",but don't do anything
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.