Agent Shipped

Directory · Hooks

dcg (Destructive Command Guard)

Rust pre-execution hook that blocks destructive shell, git, filesystem, database, and cloud commands run by AI coding agents.

★ 6,382 stars · last updated 2026-11-27 · Free, open source · View on GitHub

Best for

Install

curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/main/install.sh?$(date +%s)" | bash -s -- --easy-mode

Our take

Widely starred and actively maintained, with native hook integrations for a long list of agents and per-agent profiles configured in ~/.config/dcg/config.toml. It distinguishes commands used as data (grep "rm -rf") from executed ones and scans heredocs and inline scripts, with bypass options like DCG_BYPASS=1 and allow-once codes. The license is custom rather than a standard open source license, so check terms before adopting; native Windows uses a separate PowerShell installer.

Similar hooks

Get the field guide

Join builders who use coding agents every day. Free, twice a week, unsubscribe in one click.

No spam. The CLAUDE.md starter pack comes in your confirmation email. Not seeing it? Check spam or Promotions.