Back to Hooks

Dangerous Command Blocker

Hooks security 420 downloads
Install
npx claude-code-templates@latest --hook security/dangerous-command-blocker

Metadata

Description

Advanced protection against dangerous shell commands with multi-level security. Blocks catastrophic operations (rm -rf /, dd, mkfs), protects critical paths (.claude/, .git/, node_modules/), and warns about suspicious patterns. Features: catastrophic command blocking, critical path protection, smart pattern detection, and detailed safety messages.

Code

{ "description": "Advanced protection against dangerous shell commands with multi-level security. Blocks catastrophic operations (rm -rf /, dd, mkfs), protects critical paths (.claude/, .git/, node_modules/), and warns about suspicious patterns. Features: catastrophic command blocking, critical path protection, smart pattern detection, and detailed safety messages.", "supportingFiles": [ { "source": "dangerous-command-blocker.py", "destination": ".claude/hooks/dangerous-command-blocker.py", "executable": true } ], "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "python3 .claude/hooks/dangerous-command-blocker.py" } ] } ] } }

Stack Builder

0

Your stack is empty

Click + on components to add them