Problem
If I'm reading the hook flow right, Stop's parse-transcript.sh runs after any compaction has already collapsed the pre-compact transcript into a single isCompactSummary marker. A long agentic run that compacts mid-stream seems to lose that detail before memsearch ever sees it. I believe a lot of valuable memories can be lost in long running sessions.
Trace
One real session, one /compact:
$ wc -l session.jsonl
644
$ grep -n '"isCompactSummary":true' session.jsonl
527:{...} # compaction marker
$ bash parse-transcript.sh session.jsonl | wc -l
7 # what Stop sends to the summarizer
The ~526 pre-compact lines (the agentic work) never reach the summarizer — only the trailing post-compact turn does.
Suggestion
A PreCompact hook mirroring stop.sh's pipeline could capture full state at each compaction boundary, before the JSONL is collapsed. Its input also carries a trigger field (manual/auto) worth recording on the entry.
Happy to be told I've misread something, or to take a stab at a PR.
Problem
If I'm reading the hook flow right,
Stop'sparse-transcript.shruns after any compaction has already collapsed the pre-compact transcript into a singleisCompactSummarymarker. A long agentic run that compacts mid-stream seems to lose that detail before memsearch ever sees it. I believe a lot of valuable memories can be lost in long running sessions.Trace
One real session, one
/compact:The ~526 pre-compact lines (the agentic work) never reach the summarizer — only the trailing post-compact turn does.
Suggestion
A
PreCompacthook mirroringstop.sh's pipeline could capture full state at each compaction boundary, before the JSONL is collapsed. Its input also carries atriggerfield (manual/auto) worth recording on the entry.Happy to be told I've misread something, or to take a stab at a PR.