Destructive Command Guard (dcg) blocks dangerous git and shell commands for AI coding agents. It provides a modular pack system, multi-tool integration, and config-driven protections.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
Destructive Command Guard (dcg) is a high-performance hook that blocks destructive commands before they execute, protecting work across various AI coding agents and tooling. It supports integration with Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Cursor IDE, Hermes Agent, Posit Assistant, Grok (xAI), Antigravity CLI, OpenCode, Pi, Aider, Continue, and related tools. It aims to prevent destructive commands such as destructive git operations and filesystem actions by intercepting commands and providing denials and safer alternatives.
How it works
dcg uses a modular pack system to organize destructive command patterns by category. Packs can be enabled or disabled in a configuration file. It blocks commands before execution and can output denials with explanations and suggested safe actions. The repository includes a default set of packs that guard against catastrophic commands, including core.filesystem, core.git, system.disk, and Windows-specific packs when running on Windows. It provides environment-based bypass and allowlist mechanisms to bypass protections for specific invocations.
Getting started
Quick Install (as shown in README):
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)" | bash -s -- --easy-mode
Windows (native, PowerShell):
& ([scriptblock]::Create((irm "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.ps1"))) -EasyMode -Verify
The README also describes enabling additional packs via a config TOML file, for example:
[packs]
enabled = [
"database.postgresql", # Blocks DROP TABLE, TRUNCATE
"kubernetes.kubectl", # Blocks kubectl delete namespace
"cloud.aws", # Blocks aws ec2 terminate-instances
"containers.docker", # Blocks docker system prune
]
Agent-specific configuration examples show how to adjust trust levels and allowlists per agent.
Recent releases
- v0.9.2 (2026-08-03): Second hardening patch from the continuing adversarial-review campaign over the v0.9.x line. Three independent reviewers probed the v0.9.1 fixes A/B against the released binaries on both ev
- v0.9.1 (2026-08-02): Hardening patch: an adversarial review of the v0.9.0 changes (three independent reviewers probing the released binary A/B against v0.8.0) surfaced eight defects introduced by that release
- v0.9.0 (2026-08-02): Closes the entire post-v0.8.0 issue backlog: two new agent surfaces and six user-reported defects, all with regression coverage.
Traction
5562 stars, 221 forks, 6 open issues.
Behind the repo
Dicklesworthstone is the author; the project originated from a Python script and expanded into a Rust implementation with a modular pack system, sub-millisecond execution via SIMD-accelerated filtering, and regex-driven pattern matching.
Caveats
License is listed as custom (license: custom badge). No explicit license text provided in the facts. Created 2026-01-07; last_push 2026-08-04. Language: Rust. Open issues: 6. No listed license in the summary beyond the badge.






