bash-guardrails

by Rui He · ★ 0 · updated 11 Oct 2026

ToastsGuardswarnings

0

Tool-call guard rules (parser-based), written in CEL; add your own in ~/.claude/bash-guardrails.json or .claude/bash-guardrails.json. On by default: blocks malformed bash and find rooted at /. Opt-in: Monitor, find without -xdev, pgrep/pkill pitfalls, until-grep loops, sudo, run0 confirmation, and pointing cat/head/sed/awk, heredoc writes, sed -i and Python rewrites to the Read, Write and Edit...

install bash-guardrails

Install

git clone https://github.com/ruihe774/cc-bash-guardrails
claude --plugin-dir ./cc-bash-guardrails

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

What it hooks into

From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.

Events
session.starttool.call
API calls
$.env.get$.fs.read$.fs.stat$.session.root$.ui.ask$.ui.log$.ui.toast
Can see
Monitor|Bash calls
Reach
level 1 of 3 reads filesreads env varsdraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/ruihe774/cc-bash-guardrails
Path in repo
repository root
Source commit
3094067 the exact code the scan read
Author
Rui He @ruihe774
License
Unlicense
First published
Last pushed
First listed here

Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.