What is this?
dcg (Destructive Command Guard) is a high-performance Rust hook that intercepts and blocks catastrophic shell and git commands (like 'git reset --hard' or 'rm -rf') before AI coding agents can execute them, protecting uncommitted work.
Is dcg a hook I plug into my agent, or a separate app I have to run manually?
It is a hook binary that your coding agent calls automatically before executing a command (PreToolUse-style), not something you invoke by hand; it wires into agents like Claude Code, Codex CLI, Gemini CLI, Cursor, and Copilot.
Which coding agents does it actually support?
Claude Code, Codex CLI 0.125.0+, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Cursor IDE, Hermes Agent, Grok (xAI), Posit Assistant, Antigravity CLI, OpenCode, Oh My Pi, and Crush, with limited support for Aider and detection-only for Continue.
What if dcg blocks a command I actually need to run?
You can bypass it per-command with the DCGBYPASS=1 env var or an allow-once code from the block message, or permanently whitelist a rule with 'dcg allowlist add'; removing the hook entirely disables all protection.
Does it run natively on Windows, or only through WSL?
Both: the cross-platform quick-install script works on Linux, macOS, and Windows via WSL, and there is also a dedicated native Windows PowerShell installer that enables Windows-specific filesystem and system packs by default.
How does the pack system work?
Destructive command patterns are organized into 50+ toggleable 'packs' by category (git, filesystem, databases, Kubernetes, Docker, cloud storage, Terraform, etc.); only core.filesystem, core.git, and system.disk are on by default, and the rest are opt-in via a config.toml.
How much latency does the check add to each command?
dcg uses SIMD-accelerated filtering and lazy-compiled regex patterns to add sub-millisecond latency, so it is not noticeable during normal agent use.
What are similar projects?
lean-ctx, brag, agent-skills, testsprite-cli, no-mistakes, OpenResearch, reason-network, codegraph
Which topics is it in?
copilot, gemini-cli, containers, ci, shell, git, kubernetes, cursor, database, rust, codex, agent