2026-02-01 23:18:52 +00:00
|
|
|
{
|
|
|
|
|
"hooks": {
|
|
|
|
|
"PreToolUse": [
|
|
|
|
|
{
|
|
|
|
|
"matcher": "run_shell_command",
|
|
|
|
|
"hooks": [
|
|
|
|
|
{
|
|
|
|
|
"type": "command",
|
2026-02-01 23:35:08 +00:00
|
|
|
"command": "${extensionPath}/../../claude/code/hooks/prefer-core.sh"
|
2026-02-01 23:18:52 +00:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"description": "Block destructive commands (rm -rf, sed -i, xargs rm) and enforce core CLI"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"matcher": "write_to_file",
|
|
|
|
|
"hooks": [
|
|
|
|
|
{
|
|
|
|
|
"type": "command",
|
2026-02-01 23:35:08 +00:00
|
|
|
"command": "${extensionPath}/../../claude/code/scripts/block-docs.sh"
|
2026-02-01 23:18:52 +00:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"description": "Block random .md file creation"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"PostToolUse": [
|
|
|
|
|
{
|
|
|
|
|
"matcher": "replace_file_content && tool_input.TargetFile matches \"\\.go$\"",
|
|
|
|
|
"hooks": [
|
|
|
|
|
{
|
|
|
|
|
"type": "command",
|
2026-02-01 23:35:08 +00:00
|
|
|
"command": "${extensionPath}/../../claude/code/scripts/go-format.sh"
|
2026-02-01 23:18:52 +00:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"description": "Auto-format Go files after edits"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"matcher": "replace_file_content && tool_input.TargetFile matches \"\\.php$\"",
|
|
|
|
|
"hooks": [
|
|
|
|
|
{
|
|
|
|
|
"type": "command",
|
2026-02-01 23:35:08 +00:00
|
|
|
"command": "${extensionPath}/../../claude/code/scripts/php-format.sh"
|
2026-02-01 23:18:52 +00:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"description": "Auto-format PHP files after edits"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"matcher": "replace_file_content",
|
|
|
|
|
"hooks": [
|
|
|
|
|
{
|
|
|
|
|
"type": "command",
|
2026-02-01 23:35:08 +00:00
|
|
|
"command": "${extensionPath}/../../claude/code/scripts/check-debug.sh"
|
2026-02-01 23:18:52 +00:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"description": "Warn about debug statements (dd, dump, fmt.Println)"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|