[FEATURE] PermissionRequest hook payload should include tool_use_id
Resolved 💬 5 comments Opened Dec 14, 2025 by jswny Closed Mar 15, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
- Currently there is no way to correlate a tool use with a PermissionRequest hook, since the
tool_use_idis not propagated - This means that currently it is impossible to handle the case where an external tool is configured to resolve a PermissionRequest, but the user resolves it in Claude Code itself
- In that case, the hook process is just left there to hang as an orphan, with no way to detect this case
Proposed Solution
- Add
tool_use_idto the payload of a PermissonRequest hook so that it can be correlated to a PostToolUse for the external tool to know that particular tool use has already been actioned
Alternative Solutions
- Send a signal to the PermissionRequest hook that is orphaned (user actioned it in Claude Code manually), such as some system signal, killing the process immediately, sending some additional STDIN, etc
- Attempt to correlate the tool use ID from capturing PreToolUse and PostToolUse and trying to match on the tool name and tool input. This is possible but very hacky and non-deterministic
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
- I have a “permission manager” app setup that accepts all permission requests and sends them to a small GUI queue for me to action
- Sometimes, I’m already in the Claude Code session and it’s easier for me to manually action things
- Currently, there are no ways to detect this “orphaned permission request hook” scenario has occurred, so I can’t deterministically remove queued items from the GUI that have been actioned from Claude Code
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗