Description
dcg, the Destructive Command Guard, is a hook for AI coding agents that blocks dangerous git and shell commands before they run. It is meant to protect your work from accidental deletion when an agent runs commands on your machine. The README describes it as a high-performance hook that blocks destructive commands before they execute. dcg supports a long list of agents and tools, including Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Cursor IDE, Hermes Agent, OpenCode, Amp, Crush, Oh My Pi and Antigravity CLI. Each one has its own install option, such as dcg install with a flag for that agent, and the README links to integration notes for each. Some tools are supported in a more limited way: Aider gets git hooks only, and Continue is detection only. Quick install works on Linux, macOS and Windows through WSL. The installer detects your platform, downloads the matching binary and configures the agent hooks it finds. The project is public on GitHub.…
Highlights
- Blocks destructive git and shell commands before they execute
- Hooks for Claude Code, Codex CLI, Gemini CLI, Cursor and more
- Quick install that detects your platform
- Works on Linux, macOS and Windows through WSL
- Integration notes for each supported agent
Ratings & Reviews
No ratings yet
Be the first to rate Destructive Command Guard.
People also visit

git-guardrails-claude-code
设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D
Destructive Command Guard FAQ
What does dcg do?
It is a hook for AI coding agents that checks commands before they run and blocks destructive git and shell commands, to protect your files from accidental deletion.
Which agents does it work with?
The README lists Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Cursor IDE, Hermes Agent, OpenCode, Oh My Pi, Crush, Amp and others.
How do I install it?
Use the quick install in the README, which detects your platform, downloads the right binary and configures supported agent hooks. Per-agent install options are also listed.
Does it work on Windows?
Yes, through WSL. The README lists Linux, macOS and Windows through WSL.
Are all agents fully supported?
No. The README says Aider gets git hooks only and Continue is detection only. Others have their own integration level.
Where are the integration details?
The README links to a separate integration document for each supported tool, such as the OpenCode and Crush integration notes.
Is it open source?
Yes. The project is public on GitHub.
What are the best Destructive Command Guard alternatives?
Popular alternatives to Destructive Command Guard include CC Safety Net, Wcgw and Tirith. See all Destructive Command Guard alternatives









