From 212e7a1d9c1cb3ebf54d55a169153945af0ee42a Mon Sep 17 00:00:00 2001 From: Layyes <146821254+worldfunction4@users.noreply.github.com> Date: Sat, 13 Jun 2026 12:27:18 +0800 Subject: [PATCH 1/2] fix: add path fallback for manual installation in hooks.json When users manually copy hooks to .claude/ instead of installing via plugin, ${CLAUDE_PLUGIN_ROOT} is not set and the SessionStart hook silently fails. This adds a fallback to ${CLAUDE_PROJECT_DIR}/.claude/hooks/ so the hook works in both plugin and manual install modes. If neither path exists, it silently succeeds. --- hooks/hooks.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/hooks.json b/hooks/hooks.json index 1974826..d5b1091 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -5,7 +5,8 @@ "hooks": [ { "type": "command", - "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh" + "command": "SCRIPT=\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] || SCRIPT=\"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] + && bash \"$SCRIPT\" || true" } ] } From b7833777b1c6056bec0a00cc80aa283e38b853bc Mon Sep 17 00:00:00 2001 From: Layyes <146821254+worldfunction4@users.noreply.github.com> Date: Sat, 13 Jun 2026 12:30:34 +0800 Subject: [PATCH 2/2] Fix command execution in hooks.json --- hooks/hooks.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hooks/hooks.json b/hooks/hooks.json index d5b1091..5e57bf8 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -5,8 +5,7 @@ "hooks": [ { "type": "command", - "command": "SCRIPT=\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] || SCRIPT=\"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] - && bash \"$SCRIPT\" || true" + "command": "SCRIPT=\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] || SCRIPT=\"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ]&& bash \"$SCRIPT\" || true" } ] }