Skip to content

Commit 0796ca5

Browse files
cahaselerclaude
andcommitted
fix: use correct plugin hooks.json structure with matcher/hooks arrays
Plugin hooks require the nested structure with matcher and hooks array, not the flat name/script/description format. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bbd825f commit 0796ca5

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

hooks/hooks.json

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,66 @@
33
"hooks": {
44
"PostToolUse": [
55
{
6-
"name": "edit-validation",
7-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/edit-validation.ts",
8-
"description": "Validates TypeScript and Biome compliance after file edits"
6+
"matcher": "Edit|Write",
7+
"hooks": [
8+
{
9+
"type": "command",
10+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/edit-validation.ts"
11+
}
12+
]
913
}
1014
],
1115
"PreToolUse": [
1216
{
13-
"name": "pre-tool-validation",
14-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-validation.ts",
15-
"description": "Validates branch protection and task file integrity before tool use"
17+
"matcher": "Edit|Write|Bash",
18+
"hooks": [
19+
{
20+
"type": "command",
21+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-validation.ts"
22+
}
23+
]
1624
},
1725
{
18-
"name": "powershell-guidance",
19-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/powershell-guidance.ts",
20-
"description": "Windows only: Converts Linux commands to PowerShell or provides guidance"
26+
"matcher": "Bash",
27+
"hooks": [
28+
{
29+
"type": "command",
30+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/powershell-guidance.ts"
31+
}
32+
]
2133
}
2234
],
2335
"UserPromptSubmit": [
2436
{
25-
"name": "autoflow-control",
26-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/user-message.ts",
27-
"description": "Detects autoflow mode activation and deactivation"
37+
"matcher": "*",
38+
"hooks": [
39+
{
40+
"type": "command",
41+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/user-message.ts"
42+
}
43+
]
2844
}
2945
],
3046
"PermissionRequest": [
3147
{
32-
"name": "autoflow-permissions",
33-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/permission-request.ts",
34-
"description": "Denies permissions in autoflow mode with helpful message"
48+
"matcher": "*",
49+
"hooks": [
50+
{
51+
"type": "command",
52+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/permission-request.ts"
53+
}
54+
]
3555
}
3656
],
3757
"Stop": [
3858
{
39-
"name": "autoflow-evaluator",
40-
"script": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/stop.ts",
41-
"description": "Evaluates if Claude should continue working in autoflow mode"
59+
"matcher": "*",
60+
"hooks": [
61+
{
62+
"type": "command",
63+
"command": "bun run ${CLAUDE_PLUGIN_ROOT}/hooks/stop.ts"
64+
}
65+
]
4266
}
4367
]
4468
}

0 commit comments

Comments
 (0)