The Destructive Command Guard (dcg) is a high-performance hook designed to block destructive git and shell commands from being executed by AI coding agents, protecting code from accidental deletion.
Source: README View on GitHub →dcg is gaining attention due to its unique focus on preventing accidental destructive actions in AI-assisted coding environments. It addresses the pain point of catastrophic command execution by AI coding agents, fills the gap in safety features for these tools, and stands out with its performance optimizations and extensive support for various AI coding agents.
Source: Synthesis of README and project traitsBlocks dangerous git/filesystem commands out of the box, providing immediate protection without additional configuration.
Source: READMEIncludes a variety of security packs for databases, Kubernetes, Docker, cloud services, and more, offering comprehensive protection against a wide range of destructive actions.
Source: READMEAchieves sub-millisecond latency through SIMD-accelerated filtering and lazy-compiled regex patterns, ensuring minimal impact on coding workflows.
Source: READMEDetects and blocks destructive commands based on context, allowing for more nuanced protection without blocking legitimate commands.
Source: READMEProvides clear explanations and suggestions on stderr when blocking commands, aiding users in understanding why a command was blocked and how to proceed safely.
Source: READMESeparates machine-readable hook output from rich UI output, ensuring compatibility with various AI coding agents and environments.
Source: READMESupports Codex CLI as a first-class hook target, ensuring seamless integration and compatibility with the tool's expected behavior.
Source: READMEFallbacks to plain output for CI, pipes, dumb terminals, and no-color environments, ensuring functionality across different systems.
Source: READMEIntegrates with pre-commit hooks and CI systems to catch dangerous commands before they are committed, enhancing code safety in the development process.
Source: READMENever blocks the workflow due to timeouts or parse errors, ensuring that the tool does not inadvertently disrupt development processes.
Source: READMEAllows users to understand why a command is blocked by providing detailed explanations with `dcg explain "command"`.
Source: READMEThe architecture of dcg is modular, with a three-tier architecture that includes a core engine for command interception and blocking, a set of security packs for specific contexts, and a user interface for configuration and interaction. The data flow involves command input, context analysis, rule evaluation, and output generation.
Source: Code tree + dependency filesCenter: project; inner ring: core feature modules; outer ring: key dependencies. Auto-generated from core_features and tech_stack.key_deps.
serderegexaho-corasicktokiodcg is suitable for developers using AI coding agents such as Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, Cursor IDE, Hermes Agent, Grok (xAI), and related tools. It is useful in scenarios where code safety is critical, such as in development environments where AI coding agents are used to assist with coding tasks, and in CI/CD pipelines to prevent accidental destructive actions before code is committed.
Source: READMEv0.6.5 (2026-07-03): Bumped actions/cache dependency version.
Source: GitHub ReleasesDestructive Command Guard is a valuable tool for developers using AI coding agents, offering a robust solution for preventing accidental destructive actions. Its focus on performance and configurability makes it a strong choice for teams looking to enhance code safety in their development workflows.
The Destructive Command Guard (dcg) is a high-performance hook designed to block destructive git and shell commands from being executed by AI coding agents, protecting code from accidental deletion.
destructive_command_guard's core features include: Zero-Config Protection, 50+ Security Packs, Sub-Millisecond Latency, Smart Context Detection, Rich Terminal Output.
dcg is gaining attention due to its unique focus on preventing accidental destructive actions in AI-assisted coding environments.
dcg is suitable for developers using AI coding agents such as Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, Cursor IDE, Hermes Agent, Grok (xAI), and related tools.