From ed5189ebe9c89ebaa66bb5cb1dda23ae0e968c55 Mon Sep 17 00:00:00 2001 From: secyunshu Date: Fri, 13 Mar 2026 11:03:44 +0800 Subject: [PATCH] fix: merge SessionStart hooks to run sequentially (#1341) The SessionStart hook was incorrectly split into two separate matchers with the same pattern "startup|clear|compact", causing them to run in parallel per Claude Code's hook execution model. This resulted in a race condition where both hooks tried to bind to port 37777 simultaneously, causing "port in use" errors on first startup. This fix consolidates all SessionStart commands into a single matcher, ensuring they execute sequentially. Fixes regression introduced in commit d93bde0. Co-authored-by: yunshu Co-authored-by: Claude Opus 4.6 --- plugin/hooks/hooks.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index 271dc275..01a6b719 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -21,12 +21,7 @@ "type": "command", "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"", "timeout": 300 - } - ] - }, - { - "matcher": "startup|clear|compact", - "hooks": [ + }, { "type": "command", "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" start",