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.
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
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 Claude Code plugin from the benweese marketplace: safety hooks that stop Claude from committing secrets and, if you turn them on, from touching secret files, running destructive commands without asking, or leaving lint errors behind.
claude plugin install guardrails --marketplace benweese/claude-plugins
Or claude plugin marketplace add benweese/claude-plugins, then claude plugin install guardrails@benweese. Start a new session afterwards.
| Guardrail | Default | What happens |
|---|---|---|
| Secret blocker | On (installing the plugin is the opt-in) | Before Claude runs git commit, it scans what that commit will contain: the staged changes, plus tracked changes for git commit -a / --all, plus the paths a chained git add … && git commit stages. A match blocks the commit and shows the file, line and rule, with the secret masked |
| Protected files | Off | Claude can't read or change .env*, *.pem, *.key, id_* or credentials* (reading one would put the secret into the conversation). .env.example, .env.sample and .env.template are allowed |
| Dangerous commands | Off | Blocked: merging a pull request (gh pr merge, or gh api to the merge endpoint or the merge / auto-merge GraphQL mutations), any git push to the repo's default branch (read from git), and plain force-pushes (--force, -f, +branch) to any other branch. Asked first: git reset --hard, git clean -fd / -fdx, git checkout -- ., git restore ., and rm -rf on /, ~, $HOME or the repo root |
| Lint after edit | Off | After an edit, your lintCommand runs on the file (or the project's ESLint for JS/TS files). Errors go back to Claude to fix |
Secret scanning: with gitleaks installed it uses gitleaks (and says so); otherwise built-in patterns for private keys, AWS keys, GitHub tokens, Anthropic / OpenAI keys, Slack tokens, Google API keys and long password = "…"-style values. If gitleaks fails to run, it falls back to the built-in patterns and says that too. Nothing is sent anywhere.
Which repo a commit runs in. The secret blocker scans each commit in the repo it will actually run in. It follows cd, pushd, env -C, sudo -D and git -C, and unwraps common wrappers: env, command, sudo (with its options), nohup, time, timeout, nice, ionice, stdbuf, chrt, taskset, setsid, exec, ! and shell keywords (if, then, while, do …), plus \git and /usr/bin/git, nested in any order. bash -c '…' (also sh, zsh, dash, ksh) and eval '…' strings are parsed like command lines of their own, aliases included, up to 3 levels deep. Deeper nesting with git in it asks. xargs running a commit asks with "can't see xargs arguments; secrets not checked", because the arguments come from input the hook can't see. Anything else that mentions git commit and can't be parsed asks: "can't parse this commit; secrets not checked". Git aliases are expanded the way git does: git ci with alias.ci = commit (in the repo's, your global or the system config, or an inline git -c alias.ci=commit) is checked as a commit, and the alias's own arguments count (alias.ci = commit -a). A shell alias (!…) that runs git at all (it can commit without the word commit appearing, e.g. !f() { git "$@"; }; f), an alias loop, or an alias lookup that takes too long asks: "can't parse this commit; secrets not checked". The command's own GIT_CONFIG_GLOBAL=…, HOME=… or GIT_CONFIG_KEY_0=… prefixes count when looking up an alias, and so do earlier export / unset of those variables in the same command line. They carry over like cd does, except out of a ( … ) subshell or a pipeline stage. A value set from a variable or substitution (GIT_CONFIG_GLOBAL=$X git ci) asks. A script run with source / . isn't followed. An alias in a repo that can't be determined (cd "$X" && git ci) asks too. Not covered: a shell alias that calls another alias (!git ci), and aliases for push (the dangerous-command checks don't expand aliases). When it can't tell which repo a commit runs in, it now asks instead of letting the commit through unchecked. Examples: cd "$(git rev-parse --show-toplevel)" && git commit, cd "$DIR", cd -, popd, a folder that doesn't exist yet, GIT_DIR=…, or a cd inside ( … ). The prompt says "can't tell which repo this commits in; secrets not checked". The hook reads the command text before it runs, so it can't expand variables or run substitutions. Guessing would mean scanning the wrong repo and passing a commit it never checked. An env -S "…" string that mentions git asks for the same reason ("can't parse env -S").
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub benweese/claude-plugins --plugin guardrailsPlugins from other owners that cover similar ground