Skip to content

v1.108.57 — PreCompact hook reads a persisted live session journal (#334)

Choose a tag to compare

@jgravelle jgravelle released this 17 Jun 14:21
· 52 commits to main since this release

Reported by @mmashwani with a source-cited probe of the hook process boundary.

Fixed

#334 — the PreCompact CLI hook can now see real session state.

The hook-precompact command runs as a separate process from the MCP server, so it read a fresh, empty in-process SessionJournal and emitted a healthy-looking but empty Files explored: 0 | Searches: 0 snapshot at compaction time.

The live server process now persists a compact journal snapshot to a small, atomically written _session_live.json in CODE_INDEX_PATH (save_live_journal — throttled, best-effort, independent of session_resume). The hook reads it back (snapshot_from_live) and renders it through the same formatter the live MCP tool uses, so the out-of-process snapshot matches what the running server sees, including structural-landmark enrichment seeded from the persisted journal. When no live journal is readable, the hook emits an explicit "no live session journal" message instead of an apparently-successful zero-state snapshot.

The new file write is disclosed in the README's background-behavior section; disable with JCODEMUNCH_LIVE_JOURNAL=0.

10 tests in tests/test_v1_108_57.py, including a real cross-process check (seed a journal in one process, read it from a fresh hook-precompact subprocess).

Install: pip install -U jcodemunch-mcp or uvx jcodemunch-mcp