a guardrail / hook pack for AI coding-agent CLIs · works with Claude Code hooks
rm -rf/-fr in any flag order, mkfs, writes to a block device, fork bombs.
Example: sudo rm -rf / is denied outright.
main/master.
Example: git push --force origin main is denied; git push origin main asks first.
.env or writing an AWS access key literal is denied.
terraform destroy is denied; NODE_ENV=production migrations ask first.
npm publish asks; npm publish --access public is denied unless explicitly allowed.
curl https://example.com/i.sh | bash is denied.
docker exec, a remote shell, or a subprocess the agent spawns opaquely — only the top-level tool call the CLI hands it is inspected.As a Claude Code plugin (nothing is written into your repository; disable it from /plugin at any time):
/plugin marketplace add trimkeep/claude-plugins
/plugin install handrail@trimkeep
Or as plain files you can read and edit in-repo:
No curl | bash — Handrail blocks exactly that pattern, so it ships the same way it expects everyone else to install things:
git clone https://github.com/trimkeep/handrail-kit
cd handrail-kit
./install.sh /path/to/your/project
This copies the six hook scripts into <your-project>/.claude/hooks/handrail/ and merges the hooks block into <your-project>/.claude/settings.json, backing up an existing file first. Running it again is a no-op if nothing changed.
To remove it:
./uninstall.sh /path/to/your/project
Every hook treats what it doesn't understand as dangerous, not safe: missing jq, empty stdin, stdin that isn't valid JSON, or a tool call with no tool_input all make the hook deny rather than pass the call through.
And every hook only ever removes permission — it denies outright, or asks the human to confirm; none of the six scripts ever emits a decision that grants permission on its own. See test/hooks.test.js on GitHub for the assertions this makes, per hook, against the shipped fixtures.
The early-access pack (v0.9) adds the full rule set on top of the six free hooks: a protected-path guard, per-role write scopes, secret detection in edits, and a wider dangerous-command matrix. v1.0 ships to every buyer within 14 days of purchase, at no extra cost, and every purchase includes 12 months of updates.
Handrail v0.9 — early-access price: $19 one-time. Early access is limited to the first 20 buyers; when it closes, this page will say so — no live counter, no countdown. Handrail v0.9 comes with a voluntary 14-day, no-questions refund, processed through Polar in addition to — not in place of — any statutory withdrawal right shown at checkout; refunds deactivate your licence key.
Early access is open — first 20 buyers.
Checkout runs on Polar, the merchant of record; see Polar's terms and privacy policy.
No, everything is local. Secret detection, command checks and every decision happen on your machine; no scan result, prompt content, command, file path or file content is transmitted to us or anyone else.
Each hook is a small bash + jq script that inspects one tool call. It runs and exits before the agent's own request would otherwise complete — in practice, no noticeable delay.
Yes. Hooks are plain shell scripts under .claude/hooks/handrail/. Add your own alongside them and wire them into .claude/settings.json the same way — settings.example.json shows the shape.
It fails closed: missing jq, empty stdin, invalid JSON, or a tool call with no tool_input all deny the call rather than pass it through.
Handrail v0.9 comes with a voluntary 14-day, no-questions refund, processed through Polar in addition to — not in place of — any statutory withdrawal right shown at checkout; refunds deactivate your licence key.
No. Handrail works with Claude Code and other agent CLIs in plain text only; it is not affiliated with, endorsed by, or a product of Anthropic.