ai-bash-guard
AI-powered bash command security guard. Before any Bash command runs, a lightweight Claude subagent evaluates it for destructive or irreversible patterns — recursive deletes, force pushes to protected branches, database drops, and credential exposure — and blocks execution with a clear explanation if flagged. Uses PreToolUse with type:agent, which is the only hook pattern that can block tool execution via AI reasoning.
- Score
- Unranked
- Evidence
- No signals yet
- Last commit
- Not known
- Listed
Install
armory install ai-bash-guard --cli claudewrites the file to.claude/hooks/ai-bash-guardListed as compatible
# fetches the hook script into:
.claude/hooks/ai-bash-guard
# then register it in your settings.json "hooks" block.↳ Add the hook entry to settings.json, then restart the harness.
Needs the armory CLI · not on npm yet, build it from cli/ in the repository
What it is
AI-powered bash command security guard. Before any Bash command runs, a lightweight Claude subagent evaluates it for destructive or irreversible patterns — recursive deletes, force pushes to protected branches, database drops, and credential exposure — and blocks execution with a clear explanation if flagged. Uses PreToolUse with type:agent, which is the only hook pattern that can block tool execution via AI reasoning.
When to use it
AI-powered bash command security guard. Before any Bash command runs, a lightweight Claude subagent evaluates it for destructive or irreversible patterns — recursive deletes, force pushes to protected branches, database drops, and credential exposure — and blocks execution with a clear explanation if flagged. Uses PreToolUse with type:agent, which is the only hook pattern that can block tool execution via AI reasoning.
How to install / invoke
# Wire this hook script into .claude/settings.json
curl -sL https://raw.githubusercontent.com/davila7/claude-code-templates/main/cli-tool/components/hooks/security/ai-bash-guard.json -o .claude/hooks/ai-bash-guard.json
Notes
Extracted from davila7/claude-code-templates, security category.