Skip to content
BENIBIX Learn

PermissionDenied Hook

AI⌨️ Claude CodeConfiguration

Also known as PermissionDenied

The event when auto mode refuses a tool call.

Think of it like

It is like a note. It says the guard sent someone away.

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.

Definition

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 code

json
{
  "hookSpecificOutput": {
    "hookEventName": "PermissionDenied",
    "retry": true
  }
}
Let Claude try the denied call again.

Common mistake

Expecting it to fire when you click No. It only fires on auto mode's own refusals.

Key takeaways

  1. 1
    Auto mode only. Its refusals.
  2. 2
    Not your no. Or a rule.
  3. 3
    Can allow a retry. retry: true.

Compare