A PreToolUse hook script exits 0 with no output. What has it decided?
Why B is the answer
Nothing: it reports no decision, and staying silent does not approve the call
The docs say a silent exit 0 has no decision to report and does not approve the call. To block, return a deny decision or exit with code 2.
In detail
- For a PreToolUse hook, a silent exit 0 reports no decision at all.
- The call continues through the normal permission flow, so silence is not an approval.
- To block a call, the hook must return a deny decision or exit with code 2.
- Be explicit in hooks that make decisions, and test both the allow and the block paths.
Use case
An illustrative scenario, not a real incident.
A team writes a PreToolUse hook that logs each call and exits 0. They assume it approves commands, yet Claude Code still prompts for permission. The hook made no decision, so the normal permission flow applied.
See it in different ways
flowchart LR
A["Claude requests a tool"] --> B{"PreToolUse hook"}
B -->|"Deny"| C["Blocked, reason returned"]
B -->|"Allow"| D["Tool runs"]sequenceDiagram
participant M as Claude
participant H as PreToolUse hook
participant T as Tool
M->>H: Requested tool call
alt Allowed by policy
H->>T: Call continues
T-->>M: Result
else Blocked
H-->>M: Deny, with a reason
endflowchart TD
Q{"What does the hook do?"}
Q -->|"Exits 0 with no output"| A0["No decision, normal permissions apply"]
Q -->|"Returns a deny decision"| A1["Call is blocked"]
Q -->|"Exits with code 2"| A2["Call is blocked"]Key point: Silence from a hook is not approval.
Why the other options are wrong
- A. The tool call is denied, and Claude receives an empty reason for the denial
- A denial needs an explicit deny decision or exit code 2.
- C. The whole session stops until a person reviews the requested tool call
- A hook stops a session only when it is written to do so. A silent exit does not.
- D. The tool call is approved and skips all later checks and permission prompts
- Silence does not approve the call or skip later checks. Permission rules still apply.

