Claude Code · tool · fg-0488

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

If you see The permission flow continues unchanged after the hook exits 2, the cause and the fix for Claude Code are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
The permission flow continues unchanged after the hook exits 2The hook's stderr reason is discarded
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"}}}
Affected
Claude Code hooks, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun