# dcg (Destructive Command Guard)

> A hook that blocks destructive shell, git and filesystem commands before AI coding agents run them

Source: https://talira.ai/catalog/dcg-destructive-command-guard-yzwf7k7w
Every listing: https://talira.ai/catalog.md

- Kind: Source available
- Types: Command-line tool
- Categories: [ai / agents / security](https://talira.ai/categories/ai/agents/security), [developer tools / ai coding / sandboxing](https://talira.ai/categories/developer-tools/ai-coding/sandboxing)
- Platforms: linux, macos, windows[^2]
- Licence: MIT License (with OpenAI/Anthropic Rider) (source-available)[^1]
- Pricing: Free[^1]
- Pricing notes: Free to use under its licence, which grants no rights to OpenAI, Anthropic, their affiliates or anyone acting on their behalf.
- Free tier: yes[^1]
- Self-hostable: no
- Made by: [Jeffrey Emanuel](https://talira.ai/orgs/jeffrey-emanuel.md)

dcg (Destructive Command Guard) is a Rust hook that AI coding agents call before running a shell command, and that blocks destructive ones such as `git reset --hard`, `rm -rf ./src` or `DROP TABLE` with an explanation and a safer alternative. It works out of the box for git and filesystem commands, and has more than 50 optional rule packs for databases, Kubernetes, Docker, cloud CLIs and Terraform. It scans heredocs and inline scripts, tells a command apart from the same words used as data, explains why a command was blocked (`dcg explain`) and has a scan mode for pre-commit hooks and CI. Its installer sets it up for [Claude Code](https://talira.ai/catalog/claude-code-jqv5000a.md), [Codex](https://talira.ai/catalog/codex-8m7d8cdk.md), Gemini CLI, GitHub Copilot CLI, [Cursor](https://talira.ai/catalog/cursor-x8ypqq22.md), [OpenCode](https://talira.ai/catalog/opencode-fn6hh4gp.md), [Amp](https://talira.ai/catalog/amp-bzzdf2yc.md) and other agents, on Linux, macOS and Windows. Its licence is MIT with a rider that grants no rights to OpenAI, Anthropic or anyone acting for them.

## Links

- GitHub: https://github.com/Dicklesworthstone/destructive_command_guard

## Problems it solves

- my AI coding agent ran git reset --hard and wiped my uncommitted work
- stop coding agents running rm -rf, force pushes and other destructive commands
- block an AI agent from dropping database tables or deleting Kubernetes namespaces
- an AI agent ran a destructive command I didn't expect and broke my working copy
- explain why a command my coding agent tried was blocked
- scan scripts in pull requests for dangerous commands in CI

## Features

- pre-execution hook for Claude Code, Codex CLI, Gemini CLI, Copilot CLI, Cursor and more
- blocks destructive git and filesystem commands with no configuration
- 50+ optional packs: databases, Kubernetes, Docker, AWS, GCP, Azure, Terraform
- heredoc and inline script scanning
- dcg explain shows why a command is blocked
- scan mode for pre-commit hooks and CI
- per-agent profiles with extra packs and allowlists

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.69 out of 1.
Signals: maintenance 1.00, adoption 0.76, momentum 0.84, community 0.34, backing 0.30, extensibility 0.20.

- last commit today
- 1102 commits in the last 90 days
- latest release v0.17.1 today
- 6.4k GitHub stars
- fast-growing: 6.4k stars in 10 months
- 6 contributors
- made by Jeffrey Emanuel

## Sources

[^1]: https://github.com/Dicklesworthstone/destructive_command_guard/blob/main/LICENSE (checked 24 Nov 2026)
[^2]: https://github.com/Dicklesworthstone/destructive_command_guard (checked 24 Nov 2026)
