You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`scripts/hooks/precompact-flush.mjs` now emits the memory-flush nudge as top-level `systemMessage` instead of `hookSpecificOutput.additionalContext`.** Claude Code's PreCompact hook schema only accepts `additionalContext` under `hookSpecificOutput` for `UserPromptSubmit` and `PostToolUse` events — PreCompact has no `additionalContext` shape, so the host was rejecting every response with `Hook JSON output validation failed — (root): Invalid input` and dropping the nudge on the floor. The disk-dump side-effect still ran (that's why the companion `precompact-distill.mjs` reported success), but the pre-compaction "save your context" reminder never reached the transcript. Switched to `systemMessage`, which is accepted for all event types and lands in the transcript ahead of the compacted summary, so the reminder still survives compaction.
8
+
9
+
### Tests
10
+
11
+
New assertions cover: (a) PreCompact nudge lands in `systemMessage` and nothing is emitted under `hookSpecificOutput`, (b) `AGENT_KNOWLEDGE_PRECOMPACT_NUDGE=0` suppresses the nudge entirely. Guards against regressing to the broken `hookSpecificOutput.additionalContext` shape.
0 commit comments