PermissionRequest vs PermissionDenied
People think PermissionDenied fires every time a call is refused, as the other half of PermissionRequest. It does not. PermissionRequest fires when Claude Code is about to ask you, and it can answer yes or no for you. PermissionDenied fires only when auto mode says no. Your own no, a deny rule or a hook's block never fires it. It cannot undo the no, but it can let Claude try again.
PermissionRequest Hook
The event just before Claude Code asks you. A hook can answer.
PermissionRequest is the hook event that fires when Claude Code is about to ask you to approve a tool call. A hook here can answer for you, with allow or deny. If no one can see a prompt, such as in a background run, and no hook answers, the call is denied. Exit code 2 does nothing here, so answer with JSON.
PermissionDenied Hook
The event when auto mode refuses a tool call.
PermissionDenied is the hook event that fires when auto mode refuses a tool call. It does not fire when you say no to a prompt yourself, or when a rule or another hook blocks the call. The hook gets the tool, its input and the reason. It can tell Claude that it may try the call again.
In one line
- PermissionRequest Hook
- The event just before Claude Code asks you. A hook can answer.
- PermissionDenied Hook
- The event when auto mode refuses a tool call.