Security·terminal · desktop·MIT
guardrails
Refuses cf writes, attribution lines in commits and PRs, and claude/ branch names.

guardrails refuses three kinds of shell command before they run: Cloudflare writes through cf, commits and pull requests that carry an attribution line, and branches named claude/…. Claude gets the reason back as the tool result, so it can drop the trailer or rename the branch and try again.
What it blocks
- Cloudflare writes.
cf deploy,cf migrateandcf init. The author keeps deploys on each project’s Wrangler flow;wranglercommands are not checked. - Attribution lines. A
git commit,gh prorgh issuecommand whose text containsCo-Authored-Byor “Generated with Claude”, in any letter case. AnyCo-Authored-Bycounts, so a trailer crediting a person is refused too. claude/branches.git checkout -b,git switch -c,git branchorgit pushwith a branch that starts withclaude/, including refspecs such asHEAD:claude/fixandrefs/heads/claude/fix. Claude is told to use a purpose prefix such asfix/,style/orchore/instead.
These are the author’s own conventions, and they are fixed in the code. To change one, edit hooks/register.ts in the plugin. Reading credential files is left to the same author’s secret-guard.
Install
Needs Claude Code 2.1.287 or later.
claude plugin marketplace add arasovic/claude-code-mods
claude plugin install guardrails@claude-code-mods
Restart Claude Code. There is nothing to run: every Bash call is checked from then on.
If you already added this marketplace for session-meter or another mod from the repo, skip the first command. Other repos, such as karanb192/claude-code-mods, also name their marketplace claude-code-mods. If claude plugin marketplace list shows one of those, remove it first with claude plugin marketplace remove claude-code-mods.
How it works
A single tool.call hook watches Bash calls and nothing else. Before the command runs, it tests the command text against three regular expressions. On a match, the call is refused with guardrails: and a one-line reason, and the command never runs.
That text is all it reads. It stores nothing, makes no network calls and adds nothing to the conversation unless it refuses a call.
Limitations
- It checks the command text only.
git commit -F message.txtwith the trailer inside the file, a shell alias or a script that commits all get through. For a hard guarantee, the author points to permission deny rules insettings.json. - The patterns match anywhere in the text, so
git commit -m "docs: explain cf deploy"is refused as a Cloudflare write. - Only Bash is covered. A pull request opened through an MCP server or any other tool is not checked.
Similar Claude Mods
loop-guard
After the same failure twice, a hidden note tells Claude to change approach.
Assertion Guardian
Refuses test edits that drop assertions, add skips or change expected values.
wp-credential-guard
Masks WordPress logins for the model and puts the real values back into Bash commands.
collision-guard
Asks before Claude edits a file another open chat just changed.
Popular Claude Mods
The whole directory →Agent Time Machine
Every tool call on a branching timeline with snapshots: inspect, restore, branch, rerun.
firstmate-calm
Hides tool rows and swaps the spinner for a sailboat. Toggle with /calm, zero tokens.
aside
Ask about the session so far in a read-only side pane. Nothing reaches the main thread.
env
Claude manages your .env keys and asks you for values it never gets to see.


