Expand description
spool hook pre-compact — persist self-tagged memories before
context compaction so they survive the window trim.
§Pipeline
- Read active context from stdin (Claude Code passes the about-to-be- compacted conversation as a text blob).
- Run
self_tag::detectto find explicit memory markers. - Redact secrets, dedupe against existing ledger entries.
- Persist surviving signals as
acceptedviaLifecycleService. - Write
<cwd>/.spool/last-pre-compact.unixmarker.
§Why this matters
Context compaction is lossy. If the user said “记一下: X” early in a session and the compactor drops that turn, the memory is lost unless we capture it here. The Stop hook also captures self-tags, but it runs after the session ends — pre-compact fires during the session, before the window shrinks.