fix(hooks): configure via settings.local.json not plugin hooks.json

Skills-dir plugins (~/.claude/skills/) may not execute hooks from
hooks/hooks.json. Per documentation, hooks need to be in settings files.

- install.sh: add hook registration in ~/.claude/settings.local.json
- Hooks use absolute paths to hub-guide scripts
- SessionStart matcher: startup|resume|compact
- PreToolUse matcher: Write|Edit
- Remove hooks/hooks.json from plugin (redundant for skills-dir)
This commit is contained in:
asepharyana
2026-07-26 12:06:29 +07:00
parent 95a91d7bf5
commit 6612cd9163
2 changed files with 69 additions and 47 deletions
-31
View File
@@ -1,31 +0,0 @@
{
"hooks": {
"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
}
]
}
]
}
}