Skip to content
BENIBIX Learn

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.

AI⌨️ Claude Code

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.

Example
Jack's hook reads each Bash command. If it touches the live database, the hook denies it and tells Claude why.
Why it matters
It is the last stop before a tool acts. Your own code can look at the exact call there.
Full entry
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

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.