Unknown hook name exits 2 and blocks the tool instead of failing open #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
main.goexits 2 on a missing or unknownos.Args[1].Exit 2 from a PreToolUse hook is read by Claude Code as block this tool call. This plugin wires 1 PreToolUse hook, so a
hooks.json/binary skew removes the matched tool in every running session on the host.Note the file already fails open one line later —
an unreadable stdin is silence, exit 0— so the unknown-name path is the one branch violating the contract the rest of the file keeps.Verified directly:
echo '{}' | bin/hooks not-a-real-hook→ exit 2; no args → exit 2.Third independent occurrence fleet-wide — see oleks/claude-plugin-anxious#182 and kotkan/claude-plugin-decision-flow#85.
Acceptance: unknown/missing entry point prints a loud diagnostic to stderr naming the key and every registered name, then exits 0; a
listsubcommand exposes the registered names. Mirrordecision-flow@0.35.1(f655067).