Back to Hooks

Ai Bash Guard

Hooks security 70

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.

Install Command
npx claude-code-templates@latest --hook security/ai-bash-guard
View on GitHub
claude-code — ai-bash-guard

Content

JSON
{
"description": "AI-powered bash command security guard. Before any Bash command runs, a lightwei..."
"hooks": {
"PreToolUse": [1 item]
}
}

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.