[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_
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗