From 23058d4b0c10021abf71febd09ed934aea3c53ab Mon Sep 17 00:00:00 2001 From: GigiTiti-Kai <146460333+GigiTiti-Kai@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:59:39 +0900 Subject: [PATCH] fix: move session-complete from Stop to SessionEnd hook (#1330) The `session-complete` command in the Stop hook runs every turn, killing the SDK agent via SIGTERM. This causes the next summarize call to receive an empty response because the agent needs to restart. By moving `session-complete` to SessionEnd (which only fires on actual session termination), the SDK agent stays alive between turns and summarize works reliably. Fixes #1314 Co-authored-by: Claude Opus 4.6 --- plugin/hooks/hooks.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index 6f044d9b..271dc275 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -70,7 +70,13 @@ "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\" hook claude-code summarize", "timeout": 120 - }, + } + ] + } + ], + "SessionEnd": [ + { + "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\" hook claude-code session-complete",