From c1aabf77d32d5e617ee781338f7b406226130f21 Mon Sep 17 00:00:00 2001 From: Vipul Delwadia Date: Sun, 29 Mar 2026 08:49:25 +1300 Subject: [PATCH] fix(hooks): use systemMessage instead of hookSpecificOutput for PostCompact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostCompact is not a valid hookEventName inside hookSpecificOutput — Claude Code only accepts PreToolUse, UserPromptSubmit, and PostToolUse there. Using systemMessage at the top level is the correct way to inject context after compaction, and avoids the "Hook JSON output validation failed" error. Co-Authored-By: Claude Sonnet 4.6 --- hooks/post-compact.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hooks/post-compact.sh b/hooks/post-compact.sh index 8769c6c465..7f0be2e99f 100755 --- a/hooks/post-compact.sh +++ b/hooks/post-compact.sh @@ -43,10 +43,7 @@ using_hyperpowers_escaped=$(escape_for_json "$using_hyperpowers_content") cat <\nContext was compacted. You have hyperpowers — always check skills before responding.\n\n${using_hyperpowers_escaped}${progress_context}\n" - } + "systemMessage": "\nContext was compacted. You have hyperpowers — always check skills before responding.\n\n${using_hyperpowers_escaped}${progress_context}\n" } EOF