mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
a0b4da050c
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>
24 lines
800 B
JSON
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"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|