PreToolUse vs PermissionRequest
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.
PreToolUse Hook
The event before a tool runs. A hook can say yes, no or ask.
PreToolUse is the hook event that fires after Claude picks a tool call and before it runs. A hook here can allow the call, deny it, ask you, or defer it. It can also change the tool's input. When hooks disagree, deny wins, then defer, then ask, then allow. Your deny and ask rules are still checked, whatever the hook says.
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.
In one line
- PreToolUse Hook
- The event before a tool runs. A hook can say yes, no or ask.
- PermissionRequest Hook
- The event just before Claude Code asks you. A hook can answer.