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 Singh-APv1.0.0MITIn 1 marketplace
A seatbelt for YOLO mode: blocks catastrophic shell commands (rm -rf ~, mkfs, dd to a disk, fork bombs) and asks before risky ones (force-push, reset --hard, DROP TABLE, curl | sh), even with permissions bypassed.
Trending plugins
7-day copy clicks
Code that runs inside Claude Code on every session, as you, unsandboxed.
Claude Code asks for these when you enable the plugin. Sensitive values are stored in your system keychain.
Risky commandsrisky
What to do with risky (not catastrophic) commands: confirm asks you, block refuses, allow lets them run.
One of confirm, block, allow
stringdefault confirm
Extra block patterncustomBlock
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls.
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 case-insensitive regular expression; matching commands are always blocked. Empty: none.
stringdefault
Extra confirm patterncustomConfirm
A case-insensitive regular expression; matching commands ask first. Empty: none.
stringdefault
A seatbelt for YOLO mode. Blocks the shell commands nobody means to run, and asks before the ones you might regret, even with
--dangerously-skip-permissions.
● Bash(rm -rf ~/)
⎿ Error: bash-guard blocked this command because it recursively deletes ~/.
╭─ bash-guard ────────────────────────────────────────────────╮
│ bash-guard: this command force-pushes over a protected │
│ branch. │
│ │
│ $ git push --force origin main │
│ │
│ Run it? │
│ ❯ 1. Run it │
│ 2. Block it │
╰──────────────────────────────────────────────────────────────╯
Permission prompts get tuned out, and bypass mode turns them off. bash-guard is a mod: it sits on every Bash tool call (subagents included) below the permission system, so it holds even when nothing else does.
rm -rf on /, ~, $HOME or system dirs · rm --no-preserve-root · mkfs · dd of=/dev/disk… · > /dev/sda · fork bombs · chmod/chown -R on system dirs · shutdown/reboot · kill -9 -1 · find / -delete · diskutil erase… · gh repo deletereset --hard · clean -f · checkout -- . · stash clear · branch -D · history rewrites · curl … | sh · DROP TABLE / TRUNCATE / DELETE without WHERE · FLUSHALL · terraform destroy · kubectl delete · helm uninstall · cloud delete-* / terminate-* · docker system prune · npm|cargo publish · sudo · rm -rf * / .git · crontab -r · overwriting ~/.zshrc&&/;/| chains, $(…) and backticks, bash -c "…", eval, sudo/env/xargs/nohup wrappers. git commit -m "rm -rf /" is fine; echo $(rm -rf ~) is not./bash-guard <command> dry-runs any command against the rules; /bash-guard shows what it blocked this session and all time./plugin marketplace add Singh-AP/awesome-claude-mods
/plugin install bash-guard@awesome-claude-mods
Requires Claude Code 2.1.287 or later.
Set these in /config, or under pluginConfigs in settings.json.
| Option | Default | What it does |
|---|---|---|
risky | confirm | Risky commands: confirm asks you, block refuses, allow runs them. Catastrophic commands are always blocked. |
customBlock | empty | Regex. Matching commands are always blocked, e.g. deploy\.sh.*--prod. |
customConfirm | empty | Regex. Matching commands ask first. |
| Event | Why |
|---|---|
tool.call on Bash | Parses the command, returns { deny } for a block, asks with $.ui.ask for a confirm, else next(e) |
command.run | /bash-guard status and dry-run |
$.store | Keeps the all-time blocked count |
The analyzer (hooks/analyze.ts) is pure TypeScript with no $, so you can import it into your own mod.
claude plugin test mods/safety/bash-guard # 101 tests
./cleanup.sh) is checked by name, not by contents.7-day copy clicks
npx claudepluginhub singh-ap/awesome-claude-mods --plugin bash-guardBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.