Files
davila7__claude-code-templates/cli-tool/components/hooks/security/dangerous-command-blocker.json
Moiri Gamboni a0b4da050c fix: dangerous-command-blocker hook references wrong script path (#367)
The installer (`installIndividualHook` in index.js) places companion
Python scripts in `.claude/hooks/`, but the hook config referenced
`.claude/scripts/`. This meant the hook would always fail with a
"file not found" error at runtime, silently rendering it non-functional.

Also removed the `2>&1` stderr redirect which masked the error by
merging stderr into stdout, causing the hook runner to report the
unhelpful "No stderr output" message instead of the actual cause.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:17:44 -08:00

24 lines
800 B
JSON

{
"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"
}
]
}
]
}
}