- 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