# PermissionDenied Hook

> The event when auto mode refuses a tool call.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** PermissionDenied

## Think of it like

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

## 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

Emma runs in auto mode and wants a log of what it blocked. Her hook writes each denial to a file she reads later.

## Example code

```json
{
  "hookSpecificOutput": {
    "hookEventName": "PermissionDenied",
    "retry": true
  }
}
```

Let Claude try the denied call again.

## Why it matters

Auto mode decides alone. This is how you see what it turned down.

## Common mistake

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

## Three principles

- **Auto mode only.** Its refusals.
- **Not your no.** Or a rule.
- **Can allow a retry.** retry: true.

## Related terms

- [Auto Mode](https://learn.benibix.com/term/ai/auto-mode)
- [PermissionRequest Hook](https://learn.benibix.com/term/ai/permissionrequest-hook)
- [PreToolUse Hook](https://learn.benibix.com/term/ai/pretooluse-hook)

## Told apart from

- [PermissionRequest vs PermissionDenied](https://learn.benibix.com/compare/permissionrequest-hook-vs-permissiondenied-hook): 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.

---

Source: https://learn.benibix.com/term/ai/permissiondenied-hook
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
