RoaringFerrum

Claude Code Bash Guardian — Security skill for Claude Code

Security community

Automated security layer for Claude Code PreToolUse Bash Tool hooks.

How to install Claude Code Bash Guardian

This entry records only its repository, not the path inside it, so there is no exact command to give. Open RoaringFerrum/claude-code-bash-guardian and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Bash Guardian does

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.

Alternatives in Security

  • Security Scan Report — Generated: 2026-04-10 20:48 UTC Skills scanned: 134 Total findings: 836 Critical: 32 High: 50 Safe skills: 100 18.1k ★
  • Security Guardian — Comprehensive security analysis for RTK CLI tool, focusing on command injection, shell escaping, hook security 11.9k ★
  • Skills Audit Report — Date: 2026-02-15 Auditor: Automated Skill Quality Audit Scope: Recently added skills in business-growth/, fina 5.3k ★

README

Claude Code Bash Guardian

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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