Claude Code Bash Guardian
Description
Automated security layer for Claude Code PreToolUse Bash Tool hooks. Provides bash command filtering, bypass prevention, and intelligent path control for safe, unattended AI agent sessions.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Claude Code Bash Guardian
[](LICENSE)
A security hook for **Claude Code's PreToolUse Bash Tool**. Designed for **unattended agent runs** (non-interactive sessions), it ensures safer automated operations by providing:
- Robust bash command filtering
- Advanced bypass prevention
- Intelligent path access control
**Hook Type:** PreToolUse (Bash Tool) **Operation Mode:** Fully automated, no user interaction **Target Users:** Developers using Claude Code (unattended / automated workflows)
⚠️ Security Disclaimer
**This tool provides defense-in-depth security for Claude Code bash operations, but is not infallible.**
While Claude Code Bash Guardian has been extensively tested against common attack patterns and bypass techniques, no security tool can guarantee 100% protection against all possible threats. Key considerations:
- Residual Risk: Despite comprehensive testing, false negatives (dangerous commands being allowed) remain theoretically possible due to the complexity of bash syntax and potential zero-day bypass techniques
- Threat Model: The primary threat actor is an AI agent making mistakes or being prompted inappropriately, not a deliberate attacker with system access
- Risk-Benefit Analysis: The security benefits of filtering automated agent commands significantly outweigh the residual risks in most development environments
- Best Practices:
- Always maintain current backups of critical data and code
- Use version control (git) to track and revert unwanted changes
- Run in isolated environments when working with sensitive systems
- Review logs periodically
- Test custom configurations thoroughly before production use
This tool is provided "as is" under the MIT License, without warranty of any kind. Users assume all risks associated with its deployment and operation.
🛡️ Security Features
- **Enhanced Wrapper Command Det
Related Skills
Fastapi Review
Review a FastAPI application for architecture, async correctness, dependency injection, Pydantic schemas, secu
Security Defense in Depth
Implement multi-layered testing and security best practices.
Security SecLists Official Repository
[OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
Security Threat Hunting with Sigma Rules
Use Sigma detection rules to hunt for threats and analyze security events
Security Maintenance Walkthrough - 2026-03-29
- Re-triaged the full 2026-03-15 security finding set against current `main` and wrote a fresh current-head re
Security Google Workspace Model Armor
Filter user-generated content for safety
Security Related Agents
Django Reviewer
Expert Django code reviewer specializing in ORM correctness, DRF patterns, migration safety, security misconfi
Token Auditor
Scans ui/src/ for hardcoded visual values, duplicate components, and shadcn replacement candidates; produces d
Gitnexus Security Boundary Reviewer
GitNexus security and trust-boundary reviewer. Use for auth, permissions, secrets, injection, unsafe parsing,