# PermissionRequest Hook

> The event just before Claude Code asks you. A hook can answer.

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

## Think of it like

It is like a friend who gets the door for you.

## Definition

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.

## Example code

```json
{
  "hookSpecificOutput": {
    "hookEventName": "PermissionRequest",
    "decision": { "behavior": "allow" }
  }
}
```

A hook that says yes for you.

## Why it matters

It lets your own logic stand in for you when you are away from the screen.

## Common mistake

Exiting 2 to deny. That is ignored here. Return a deny decision in JSON.

## Three principles

- **Before a prompt.** When one is due.
- **Answer for you.** Allow or deny.
- **No exit 2.** Use JSON.

## Related terms

- [Permission Prompt](https://learn.benibix.com/term/ai/permission-prompt)
- [PreToolUse Hook](https://learn.benibix.com/term/ai/pretooluse-hook)
- [Notification Hook](https://learn.benibix.com/term/ai/notification-hook)

## Told apart from

- [PreToolUse vs PermissionRequest](https://learn.benibix.com/compare/pretooluse-hook-vs-permissionrequest-hook): People think both fire before each tool call. PreToolUse does. PermissionRequest fires only when Claude Code is about to ask you. So a call your rules allow never reaches it. Use PreToolUse to check each call. Use PermissionRequest to answer the prompts you would get.
- [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/permissionrequest-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.
