Unknown hook name exits 2 and blocks the tool instead of failing open #5

Closed
opened 2026-08-18 23:47:43 +03:00 by oleks · 0 comments
Owner

main.go exits 2 on a missing or unknown os.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 list subcommand exposes the registered names. Mirror decision-flow@0.35.1 (f655067).

`main.go` exits 2 on a missing or unknown `os.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 `list` subcommand exposes the registered names. Mirror `decision-flow@0.35.1` (`f655067`).
oleks added the bug label 2026-08-18 23:47:43 +03:00
oleks closed this issue 2026-08-19 00:02:42 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oleks/claude-plugin-fleet-integration#5