Destructive Command Guard is a safety hook for AI coding agents that blocks dangerous git and shell commands from being executed.
The tool addresses the risk of AI agents accidentally running destructive commands that could delete or corrupt code and data. It works by intercepting commands before execution across multiple AI coding platforms including Claude Code, GitHub Copilot CLI, VS Code Copilot Chat, Cursor, Gemini CLI, Grok, and others. The hook evaluates commands against a set of dangerous patterns and prevents those matching destructive criteria from running, allowing safe commands to proceed normally.
Developers using AI agents should adopt this tool if they want an additional safety layer protecting their repositories and file systems from accidental destruction. It suits any workflow where AI agents have terminal or git access, particularly in development environments where a single errant command could cause significant data loss. The tool is designed to integrate seamlessly with existing agent setups through automated installation that detects the platform and configures hooks for supported agents.
The project is written in Rust and maintains active support across a broad ecosystem of AI agent platforms, with native integration paths for multiple tools and compatibility layers for others. Development includes ongoing expansion of platform support, as evidenced by native integrations for emerging agents and documented integration recipes for additional tools. The codebase demonstrates attention to cross-platform compatibility, with explicit support for Linux, macOS, Windows via WSL, and native Windows through separate installation methods.