Claude Code · tool · fg-0488

Exit code 2 from a PermissionRequest hook does not deny the permission

The permission flow continues unchanged after the hook exits 2

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

PermissionRequest is one of the events where exit code 2 is not honored; a deny has to come back as a decision object in JSON. PostToolUse, Notification, and SessionStart cannot block either.

Fix

Print a hookSpecificOutput decision with behavior deny and exit 0, or move the check to PreToolUse, where exit 2 blocks the call.

Apply

{"hookSpecificOutput": {"hookEventName": "PermissionRequest", "decision": {"behavior": "deny", "message": "Deploys need a human"}}}

Affects: Claude Code hooks, as of 2026-10

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp