ad78412522
1.16.0 只掛 Grep|Glob|Read,但「用 curl/wrangler 亂試方法」走 Bash → hook 不觸發, 上線隔天即被繞過(leo 2026-07-21 實證:wiki 早記著寄信已驗證可用,我沒查又自創)。 matcher 補 Bash,只認高風險指令(wrangler|curl|npx|acr|gh|deploy|push)。 本 repo 亦需警覺:動外部系統前先看 hook 推的 wiki 命中,別自創方法。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
49 lines
1.1 KiB
JSON
49 lines
1.1 KiB
JSON
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash .claude/hooks/pre-write-guard-no-table.sh",
|
|
"timeout": 5
|
|
},
|
|
{
|
|
"type": "command",
|
|
"command": "bash .claude/hooks/sdd-guard.sh",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash .claude/hooks/pre-bash-guard-no-table.sh",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Grep|Glob|Read|Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/wiki-first-search.sh"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Task",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/subagent-wiki-guard.sh"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |