From 9e9c110704437b87de60bb5452e2817fb237a1d2 Mon Sep 17 00:00:00 2001 From: olegshmuelov Date: Sun, 9 Aug 2026 14:10:39 +0300 Subject: [PATCH] fix(brains): re-inject the core prompt after Claude Code compaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude Code fires SessionStart with source=compact after auto and manual compaction, but the Claude hook map matched only startup, resume and clear, so a compacted session never re-received core.md — it survived as whatever the compaction summary happened to keep. SessionStart is the core prompt's only delivery path, and the Codex map has carried compact all along. The contract test pins this matcher verbatim, so the constant moves with the JSON. --- plugins/brains/.claude-plugin/plugin.json | 2 +- plugins/brains/.codex-plugin/plugin.json | 2 +- plugins/brains/hooks/claude-hooks.json | 2 +- tests/plugin-contract/run.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/brains/.claude-plugin/plugin.json b/plugins/brains/.claude-plugin/plugin.json index 031fcbd..13a9465 100644 --- a/plugins/brains/.claude-plugin/plugin.json +++ b/plugins/brains/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "brains", "description": "Your memory layer: Gmail, Calendar, Drive, and prior Claude conversations as queryable pages, with reflexive recall, hook-driven turn-by-turn capture and inbox delivery, and boards/automations/workflows on top.", - "version": "2.8.0", + "version": "2.8.1", "author": { "name": "brains (ssvlabs)" }, diff --git a/plugins/brains/.codex-plugin/plugin.json b/plugins/brains/.codex-plugin/plugin.json index 9096243..bf854c3 100644 --- a/plugins/brains/.codex-plugin/plugin.json +++ b/plugins/brains/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "brains", - "version": "2.8.0", + "version": "2.8.1", "description": "Your personal memory layer for Codex: query Gmail, Calendar, Drive, and prior conversations, then build boards, automations, and workflows.", "author": { "name": "brains (ssvlabs)", diff --git a/plugins/brains/hooks/claude-hooks.json b/plugins/brains/hooks/claude-hooks.json index 3f2a3f0..d761545 100644 --- a/plugins/brains/hooks/claude-hooks.json +++ b/plugins/brains/hooks/claude-hooks.json @@ -2,7 +2,7 @@ "hooks": { "SessionStart": [ { - "matcher": "startup|resume|clear", + "matcher": "startup|resume|clear|compact", "hooks": [ { "type": "command", diff --git a/tests/plugin-contract/run.ts b/tests/plugin-contract/run.ts index 17b0589..529260d 100644 --- a/tests/plugin-contract/run.ts +++ b/tests/plugin-contract/run.ts @@ -117,7 +117,7 @@ type HookGroup = { const CLAUDE_HOOK_EVENTS: Record = { SessionStart: [ { - matcher: "startup|resume|clear", + matcher: "startup|resume|clear|compact", hooks: [ { type: "command",