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 Adminhead Verified Orgv0.7.3In 1 marketplace
Mod that denies Bash used to smuggle encoded or env-var payloads, destroy systems, infra and data, kill processes by name, or pass grep --no-ignore, and denies any Bash or file-tool touch of Claude Code's credentials file. With toolSteering on (off by default), it also denies Bash that shows file contents (use Read) or writes and edits files (use Write/Edit). Commands the parser is unsure about go, with common secrets masked, to Ollama and then to Haiku. With the defaults the Ollama stage is skipped, because the default model is a :cloud one and ollamaCloud is off: set ollamaModel to a local model, or turn ollamaCloud on, to use it. A :cloud model or a non-local Ollama URL is used only with ollamaCloud on.
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.
Rules primerprimer
With tool steering on, add a short note on the read and write rules to the Bash tool's description, so the model and its subagents avoid the denied commands. Off: the description is unchanged.
booleandefault true
Enable the modenabled
Off removes every bash-rules check: destructive and smuggled commands, the credentials-file check on Bash and the file tools, the asks, the model stages and the usage log. Only an exact false turns it off. Takes effect after a reload or in a new session.
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; runs programs; makes network requests; reads files; reads environment variables (CLAUDE_CONFIG_DIR, HOME); calls a model on your account; changes what Claude reads (system prompt, context, reminders).
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.
booleandefault true
Usage logusageLog
Append each Bash decision (command with secrets masked, stage, rule or model verdict, outcome) to ~/.local/state/claude-usage/bash-rules-<date>.jsonl, for usage-report. Off: nothing is written.
booleandefault true
Ollama URLollamaUrl
Base URL of the Ollama server for the first model check. Empty skips Ollama.
stringdefault http://localhost:11434
Ollama confidenceconfidence
Below this confidence (0 to 1) the fallback model decides instead.
number0–1default 0.8
Model checksmodelStages
Send commands the parser is unsure about to Ollama, then the fallback model. Off: parser only, and unsure commands run.
booleandefault true
Ollama cloudollamaCloud
Allow the Ollama check to send commands off this machine: a :cloud model (forwarded to ollama.com) or an Ollama URL that is not localhost. Off: those are skipped and the fallback model decides.
booleandefault false
Ollama modelollamaModel
Model for the first check. A :cloud model sends the command to ollama.com, so it is skipped unless Ollama cloud is on. Empty skips Ollama.
stringdefault clef:cloud
Tool steeringtoolSteering
Deny Bash that shows file contents or writes and edits files, and point at Read, Write and Edit instead. Off: those commands run; smuggled payloads, dangerous commands and the credentials-file check stay denied.
booleandefault false
Fallback modelfallbackModel
Model alias or id for the second, final check, billed to the session. Empty skips it.
stringdefault haiku
Ollama timeout (ms)ollamaTimeoutMs
How long to wait for Ollama before falling back (at most 9000, the hook's time budget).
number500–9000default 8000
A mod that checks every Bash call before it runs. It denies destructive commands, kill-by-name, smuggled payloads, grep --no-ignore, and any touch of Claude Code's credentials file. With toolSteering on (off by default), it also denies Bash used to read or write files, with a deny message that names the built-in tool to use instead. It supersedes bash-danger-guard.
Searching is left to the shell. Claude Code no longer has Grep or Glob tools: its Bash grep and find are shell functions that run the search tools bundled in the claude binary, so grep, rg, find, fd and ls all run.
/plugin install bash-rules --marketplace Adminhead/claude-plugins
baseline installs it for you.
| Category | Examples | Instead |
|---|---|---|
read (only with toolSteering on) | sed -n 1,5p f, cat f, head/tail of a file, awk '{print}' f | Read (offset/limit) |
write (only with toolSteering on) | cat > f <<EOF, echo x >> f, echo x | tee f, sed -i, perl -pi, python -c "open(...,'w')" | Write, Edit |
| smuggle | echo … | base64 -d | sh, X=$(curl …); $X, X='a; b'; bash -c "$X", S=$(which bash); $S -c "$code", $(curl …), python -c "exec(b64decode(…))" | a scratch script written with Write; for a program in a variable, the program name in the command, or mise exec -- tool |
| destructive | rm -rf / (also /private/etc on macOS, /mnt, /proc), rm of system files, ~/.ssh or shell rc files, find /etc | xargs rm, npx rimraf ~, rsync -a --delete /tmp/empty/ ~/ (a delete-mode rsync into /, a system directory or a home directory; ~/proj/ and a remote host pass), disk wipes, sudo, terraform destroy, kubectl delete ns, helm uninstall, docker system prune -a, docker compose down -v, docker volume rm $(docker volume ls -q), dropdb, dropuser, DROP TABLE via a client (also psql < <(echo 'DROP TABLE t') and an unquoted echo DROP TABLE t | psql) or in a psql -f/mysql < script file, prisma migrate reset, rails db:drop, manage.py flush, mongosh --eval 'db.x.drop()' | hand it to the user |
| kill by name | pkill -f vite, killall node, killall5, fuser -km /mnt/usb, tmux kill-server, tmux kill-session -a, kill $(pgrep -f node), pgrep x | xargs kill, kill -1; kill 1234, kill $(cat app.pid) and kill $(lsof -t -i:5173) pass | pgrep -a <name>, then kill <pid> of the process you started |
| credentials | any command that touches ~/.claude/.credentials.json (cat, jq, cp, a python -c that opens it, rm, a glob or brace list such as ~/.cla*/.credentials.json, in any letter case); ls, stat and test on it pass. Read, Edit, MultiEdit, Write and NotebookEdit of the file (also under $CLAUDE_CONFIG_DIR), and, where a Grep tool exists, a Grep of it, of its directory, or of a directory above it with a glob or type: json that can match it. A Grep of a directory above it with neither runs with glob: "!**/.credentials.json" added | read rate_limits from the JSON Claude Code passes to a statusline command |
| flag | grep --no-ignore (Claude Code's grep is ugrep, which rejects it with exit 2 and no output) | grep --no-ignore-files, or rg --no-ignore |
With toolSteering off, shell redirects that write files are not denied, including appends to ~/.bashrc or ~/.ssh/authorized_keys; the danger rules cover only rm of critical paths.
The rules see through wrappers such as timeout, nice, env, xargs, busybox, flock, taskset, systemd-run, watch, parallel, npx, pnpm dlx and bundle exec (also pnpm --filter web exec), and they check the script of flock -c, npx -c, npm exec -c, a quoted watch command and a parallel command template as they check sh -c. Path names are compared without letter case, and a brace list (/{etc,x}) is written out. An echo or printf that feeds xargs or parallel counts as the paths it hands over (echo ~ | xargs rm -rf, echo ~ | xargs -I{} rm -rf {}/.ssh, xargs -I{} sh -c 'rm -rf {}'). A single brace list in an rm, rimraf, shred, unlink or rsync that is too long to write out (over 1024 characters or 257 alternatives) is denied as too complex; a long list in another command, or several lists in one word, is left as written.
A variable counts as hiding what it runs only when its value could be code. The danger rules always read the command as written and with the values of a flat script written in, and any hit stands.
npx claudepluginhub adminhead/claude-plugins --plugin bash-rulesBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.