← ClaudeAtlas

dcglisted

Destructive Command Guard - High-performance Rust hook for Claude Code that blocks dangerous commands before execution. SIMD-accelerated, modular pack system, whitelist-first architecture. Essential safety layer for agent workflows.
aiskillstore/marketplace · ★ 329 · AI & Automation · score 79
Install: claude install-skill aiskillstore/marketplace
# DCG — Destructive Command Guard A high-performance Claude Code hook that intercepts and blocks destructive commands before they execute. Written in Rust with SIMD-accelerated filtering for sub-millisecond latency. ## Why This Exists AI coding agents are powerful but fallible. They can accidentally run destructive commands: - **"Let me clean up the build artifacts"** → `rm -rf ./src` (typo) - **"I'll reset to the last commit"** → `git reset --hard` (destroys uncommitted changes) - **"Let me fix the merge conflict"** → `git checkout -- .` (discards all modifications) - **"I'll clean up untracked files"** → `git clean -fd` (permanently deletes untracked files) DCG intercepts dangerous commands *before* execution and blocks them with a clear explanation, giving you a chance to stash your changes first. ## Critical Design Principles ### 1. Whitelist-First Architecture Safe patterns are checked *before* destructive patterns. This ensures explicitly safe commands are never accidentally blocked: ``` git checkout -b feature → Matches SAFE "checkout-new-branch" → ALLOW git checkout -- file.txt → No safe match, matches DESTRUCTIVE → DENY ``` ### 2. Fail-Safe Defaults (Default-Allow) Unrecognized commands are **allowed by default**. This ensures: - The hook never breaks legitimate workflows - Only *known* dangerous patterns are blocked - New git commands work until explicitly categorized ### 3. Zero False Negatives Philosophy The pattern set prioritizes **never