Skip to content
BENIBIX Learn

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.

AI⌨️ Claude Code

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.

Example
Lucy runs Claude in the background. Her hook approves safe reads in a test folder, so the run does not stall on a prompt.
Why it matters
It lets your own logic stand in for you when you are away from the screen.
Full entry
AI⌨️ Claude Code

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.

Example
Emma runs in auto mode and wants a log of what it blocked. Her hook writes each denial to a file she reads later.
Why it matters
Auto mode decides alone. This is how you see what it turned down.
Full entry

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.