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 gwattsv0.9.10MITIn 1 marketplace
Auto-approves Bash commands with chained or wrapped sub-commands when each one matches your allow rules. Runs as a PreToolUse hook on every Bash call and defers anything not allow-matched to Claude Code.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
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 PreToolUse hook that auto-approves a Bash tool call when every command inside it -- including the ones Claude Code's own permission check doesn't look at -- is already covered by your rules or is known-safe. Fewer prompts on compound and wrapped commands, without loosening a single rule.
Recent Claude Code versions handle much of this natively. This hook is designed to complement that, not duplicate it:
Native already covers (so this hook stays out of the way -- it emits no decision and lets native handle it):
git add -A && git commit -m 'fix' is approved when both halves match. Native splits on &&, ||, ;, |, |&, &, and newlines. (This is anthropics/claude-code#16561, now shipped -- the original reason this plugin existed.)ls, cat, grep, find, wc, read-only git, etc. run without a prompt.timeout, time, nice, nohup, stdbuf, and bare xargs.This hook adds what native's operator-splitting and name-matching don't reach:
$(...), `...`, <(...), subshells, loops, if/case bodies, and function bodies. echo "$(curl evil.com)" gets its inner curl checked instead of being auto-approved as a read-only echo.find -exec/-execdir CMD and xargs with flags (xargs -n1 grep), both of which native leaves as a prompt.xargs payload's appended stdin args, and mutating find actions (-delete, -fprintf, -ok)..git/.claude.The guiding rule: only ever upgrade a call to allow/deny, or force a prompt for a hazard native can't catch -- never add a prompt native wouldn't have shown on its own. It's a convenience-and-triage layer that shaves prompts off the safe common cases and flags the ones worth a look, not a hard security boundary (see Limitations).
The plugin registers a PreToolUse hook that intercepts every Bash tool call. It parses the command using mvdan.cc/sh/v3 (the parser behind shfmt), walks the full AST to extract every sub-command, and checks each one against your allow/ask/deny patterns from settings files.
Rules are evaluated in the same order as Claude Code: deny → ask → allow. The first matching rule wins.
For each tool call, the hook returns one of four outcomes:
allow -- every sub-command is either a known-safe command or matches an allow pattern. The command runs without prompting.deny -- a sub-command matches an explicit deny pattern. The tool call is cancelled outright and Claude receives feedback explaining why.ask -- a sub-command matches an ask pattern, or an otherwise-allowed command has an output redirect that fails a safety check. The hook forces Claude Code's permission prompt.Defer keeps the hook additive for top-level commands -- it only upgrades those to allow/deny and never adds a prompt native wouldn't have shown. But it defers only where native is known to see the same command. Where the hook detects a hazard native's own matching can't be trusted to enforce, it forces ask instead:
echo "$(curl evil.com)" prompts, because native would otherwise auto-approve the read-only echo without inspecting the curl;xargs payload whose static form matches only an exact rule that doesn't cover the stdin args native strips-and-approves blind to;find action (-delete, -fprintf, -ok, ...) or an unreadable find payload that could otherwise ride a broad Bash(find *).In auto mode (permission_mode: auto in the hook input) the classifier reads the full text of any command the hook gives no decision on, so nested commands and unsafe write targets defer to it rather than prompting. Explicit ask rules, writes the hook can resolve into .git/.claude, and the xargs and find hazards above still prompt, and deny rules still win. A relative write after cd can't be resolved, so it defers too. Other permission modes are unchanged.
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.
compound-bash@gwatts is listed by gwatts/claude — review the source before installing
npx claudepluginhub gwatts/claude --plugin compound-bashPlugins from other owners that cover similar ground