Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
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.
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)
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 allowing dangerous commands over avoiding false positives. A few extra prompts for manual confirmation are acceptable; lost work is not.
Strips absolute paths: /usr/bin/git status → git status
Preserves argument paths
Stage 3: Quick Rejection Filter
SIMD-accelerated substring search for "git" or "rm"
Commands without these bypass regex entirely (99%+ of commands)
Stage 4: Pattern Matching
Safe patterns checked first (short-circuit on match → allow)
Destructive patterns checked second (match → deny)
No match → default allow
Exit Codes
Code
Meaning
0
Command is safe, proceed
2
Command is blocked, do not execute
CLI Usage
Test commands manually:
# Show version with build metadata
dcg --version
# Test a commandecho'{"tool_name":"Bash","tool_input":{"command":"git reset --hard"}}' | dcg
Example Block Message
════════════════════════════════════════════════════════════════════════
BLOCKED dcg
────────────────────────────────────────────────────────────────────────
Reason: git reset --hard destroys uncommitted changes. Use 'git stash' first.
Command: git reset --hard HEAD~1
Tip: If you need to run this command, execute it manually in a terminal.
Consider using 'git stash' first to save your changes.
════════════════════════════════════════════════════════════════════════
Contextual Suggestions
Command Type
Suggestion
git reset, git checkout --
"Consider using 'git stash' first"
git clean
"Use 'git clean -n' first to preview"
git push --force
"Consider using '--force-with-lease'"
rm -rf
"Verify the path carefully before running manually"