fix(hooks): restore with proper SessionStart matchers
- Add matcher: startup|resume|compact for SessionStart (per docs) - PreToolUse reads from stdin per documented hook input format - Remove arg, use stdin-based approach - Scripts read event JSON from stdin as documented - Plain text output, no special characters
This commit is contained in:
+27
-19
@@ -1,23 +1,31 @@
|
||||
{
|
||||
"hooks": {
|
||||
"SessionStart": [{
|
||||
"matcher": "startup|clear|compact",
|
||||
"hooks": [{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/detect-project.sh\"",
|
||||
"shell": "bash",
|
||||
"timeout": 10,
|
||||
"async": false
|
||||
}]
|
||||
}],
|
||||
"PreToolUse": [{
|
||||
"matcher": "Write|Edit",
|
||||
"hooks": [{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/detect-file-type.sh\" \"$TOOL_INPUT\"",
|
||||
"shell": "bash",
|
||||
"timeout": 10
|
||||
}]
|
||||
}]
|
||||
"SessionStart": [
|
||||
{
|
||||
"matcher": "startup|resume|compact",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/detect-project.sh\"",
|
||||
"shell": "bash",
|
||||
"timeout": 10,
|
||||
"async": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/detect-file-type.sh\"",
|
||||
"shell": "bash",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user