Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By kattakathv1.2.1MITIn 1 marketplace
Supervising dispatcher for command-type Claude Code hooks: crash safety so a throwing hook can never wedge a session, every block passed through intact, and a 3-strikes loop breaker so a mis-firing Stop gate cannot trap an agent forever.
You run one by typing its /name in Claude Code.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A supervising dispatcher for command-type Claude Code hooks.
A hook that throws, hangs, or exits non-zero can wedge a session. A gate that
blocks on the same reason forever can trap an agent in a loop it cannot escape.
superhook wraps your existing hook and removes both failure modes without
changing what the hook decides when it is working.
0 or 2, never wedge the session. The wrapper emits no decision, only
a systemMessage, so the call goes through the normal permission flow
("staying silent doesn't approve it" —
hooks reference).
Before 1.1.0 it emitted decision: "approve", which on PreToolUse maps to
allow and skips the permission prompt. Always logged.decision: "block" or
hookSpecificOutput.permissionDecision: "deny") and an exit-2 block (reason
on stderr, the documented convention) reach the harness unchanged. Before 1.1.0
an exit-2 block was treated as a crash and approved.Stop/SubagentStop only — if the same block reason fires 3
times in a row, let the agent stop, loudly (systemMessage + log). A Stop
block can trap an agent; a PreToolUse deny cannot — Claude just runs
something else. So a repeated PreToolUse deny is logged as loop-detected
and never downgraded. Before 1.1.0 the third identical retry of a
hard-blocked command was turned into an allow. Upstream also caps Stop loops
itself (8 consecutive continuations, CLAUDE_CODE_STOP_HOOK_BLOCK_CAP —
Stop input); this breaker
is lower and leaves a log line, which is why it stays.superhook.log as a JSON
line (rotating, 5 MB × 3 backups). The wrapper never edits hook files itself.The PreToolUse entry sets "onFailure": "block"
(docs,
Claude Code 2.1.295+). If the wrapper itself cannot start or hits the 20 s
harness timeout, the Bash call is blocked instead of silently running unguarded.
An inner-hook crash is still crash-safe (item 1): the wrapper exits 0. Stop does
not get the field — upstream ignores it there, since Claude cannot repair a hook
that will not run.
Each inner budget sits below its hooks.json timeout: Stop 600 s inside
630 s, PreToolUse 15 s inside 20 s. A harness timeout discards the output and
writes no log line, so the wrapper has to give up first to record the incident.
Before 1.1.0 Stop had a 60 s harness timeout around a 600 s inner budget, so a
cold nix flake check was cancelled and the gate silently never ran.
Node.js on PATH. Every script here runs with node, and the Claude Code CLI is a native binary that does not ship one. Without node, the PreToolUse entry dies at exec node (exit 127), and onFailure: "block" turns that failure into a block: in a repo with .claude/hooks/pretooluse-bash-guard.js, every Bash call is blocked until node is installed. That is fail-closed working as designed, so a SessionStart hook written in POSIX sh (scripts/node-check.sh, no node needed) says so at session start: it is silent when command -v node succeeds, and otherwise prints a systemMessage naming the floor plugins that cannot run (superhook, nix-flake-kit, brain-signals).
The hook scripts import nothing at run time. CI type-checks them (tsc --checkJs, tsconfig.hooks.json at the repo root) against the hook input and output types in Anthropic's @anthropic-ai/claude-agent-sdk; those types exist only in JSDoc comments.
Installing this plugin is the whole wiring. hooks/hooks.json declares four
entries that auto-merge into your effective hook set; nothing goes in your
settings.json:
| Event | Matcher | Wraps |
|---|---|---|
Stop | — | <repo>/.claude/hooks/stop-gate.js |
PreToolUse | Bash | <repo>/.claude/hooks/pretooluse-bash-guard.js |
SessionStart | — | scripts/superhook-digest.js (reads superhook.log) |
SessionStart | — | scripts/node-check.sh (warns when node is missing; not a wrapper) |
The supervisor is a wrapper, so it has to be told which script to supervise.
Rather than make that a per-project setting, the plugin fixes it by convention:
each entry looks for one specific filename under the repo's own
.claude/hooks/. Put your gate at that path and it is supervised; put it
anywhere else and the plugin ignores it.
Each wrapper command (all but node-check.sh) does three things, in order:
npx claudepluginhub kattakath/skills --plugin superhookBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground