Skip to content

v1.2.0

Choose a tag to compare

@sizzlorox sizzlorox released this 23 May 04:25
· 3 commits to main since this release

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:

  1. Runs the full autonote pipeline on the pre-compaction transcript (condense > surface insights > classify > draft)
  2. Writes a note/doc/ADR capturing what was learned before compaction erased the details
  3. Saves a watermark so the SessionEnd autonote only processes new content after the compaction point
  4. (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

  • PostCompact hook registered in settings.json with async: true
  • Matcher supports both manual (/compact) and auto (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.compacting event: injects lorekeeper note/doc titles as context lines into the compaction summarizer
  • session_compact event: writes watermark + spawns the compact hook async
  • TranscriptWriter gains a lineCount getter 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