v1.2.0
Full Changelog: v1.1.1...v1.2.0
Autonomous Handoff on Context Compaction
Lorekeeper now automatically captures learnings when context gets compacted -- no manual intervention needed. Works on both Claude Code CLI and OMP.
What it does
When a session hits the context limit and compacts (or you run /compact), lorekeeper:
- Runs the full autonote pipeline on the pre-compaction transcript (condense > surface insights > classify > draft)
- Writes a note/doc/ADR capturing what was learned before compaction erased the details
- Saves a watermark so the SessionEnd autonote only processes new content after the compaction point
- (OMP only) Injects existing lorekeeper note titles into the compaction summary, so the post-compaction agent retains awareness of prior learnings
How it works
pre-compaction transcript
|
v
PostCompact hook (compact.{sh,ps1})
|
+---> Note/Doc/ADR written to qmd
|
+---> Watermark saved (.compact-watermark/{session_id})
|
v
SessionEnd autonote
skips pre-compact lines,
only processes new content
Claude Code CLI
PostCompacthook registered insettings.jsonwithasync: true- Matcher supports both
manual(/compact) andauto(context-full) triggers - No structural/signal gates -- compaction itself is the signal that work was substantial
- Compact summary from Claude is prepended to the condensed transcript for richer classification
OMP Extension
session.compactingevent: injects lorekeeper note/doc titles as context lines into the compaction summarizersession_compactevent: writes watermark + spawns the compact hook asyncTranscriptWritergains alineCountgetter for watermark tracking
Dedup & Watermarking
- Compact hook uses
{session_id}-compact-{timestamp}as its seen-key -- never collides with SessionEnd's autonote - Watermark file at
.compact-watermark/{session_id}stores the transcript line count at compaction time - Autonote at SessionEnd reads and deletes the watermark, then only processes lines after that offset
- Multiple compactions in one session work correctly (each overwrites the watermark)
Files changed
| File | Change |
|---|---|
hooks/compact.sh |
New -- PostCompact hook (bash) |
hooks/compact.ps1 |
New -- PostCompact hook (PowerShell) |
hooks/autonote.sh |
Watermark-aware line skipping |
hooks/autonote.ps1 |
Watermark-aware line skipping |
omp-plugin/src/index.ts |
session.compacting + session_compact handlers |
omp-plugin/src/transcript.ts |
lineCount getter |
omp-plugin/src/dispatch.ts |
"compact" in hook name union |
omp-plugin/src/paths.ts |
"compact" in script resolver |
install.sh |
Register PostCompact hook, copy compact scripts |
install.ps1 |
Register PostCompact hook, fix PS string interpolation bugs |
Install
Re-run the installer to wire the new hook:
# macOS/Linux
./install.sh
# Windows
.\install.ps1