[BUG] PermissionRequest: Allow does not exit plan mode for `ExitPlanMode` tool.
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?
The hook's lifecycle around PermissionRequest/ExitPlanMode works fully other than when you respond with an "Allow" payload - I'd expect for Exit Plan Mode to occur. However, the agent stays in planning mode, sometimes confusing it when building an automated capability around this hook.
Use case is my own app here.
https://github.com/backnotprop/plannotator
What Should Happen?
A hook payload response with allow should automatically exit plan mode.
Error Messages/Logs
Steps to Reproduce
{
"hooks": {
"PermissionRequest": [
{
"matcher": "ExitPlanMode",
"hooks": [
{
"type": "command",
"command": "{proper payload with allow}", // im lazy
"timeout": 1800
}
]
}
]
}
}
Not full repro, but if you imagine in the video i hit "approve" the agent would actually stay in plan mode vs exiting: https://www.youtube.com/watch?v=a_AT7cEN_9I
My app's decision control logic is based off of the docs: https://github.com/backnotprop/plannotator/blob/main/apps/hook/server/index.ts#L94
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.76 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
video reproduction
https://github.com/user-attachments/assets/8d0a4a13-22db-4fea-acc9-65dabdf6b275
I have the same issue - and have a related issue for that Allow Permission Mode Switching in PermissionRequest Hooks
Commenting to keep this alive
Wow, this is now working. Thank you guys
fixed in
2.1.7🙏
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.