MemoryReviewFire discards the session_id / transcript_path Claude Code hands it, and the transcript the reviewer actually read is never logged
Version: v7.1.1 (verified against 03a969dd96dc7ff701d92dbc8a8b8d6db4728834)
The defect
Claude Code supplies session_id and transcript_path on stdin to every Stop hook — both identify the transcript of the session that just fired. MemoryReviewFire reads neither. The string session_id, transcript_path, and any read of stdin appear zero times in the file.
It then spawns the reviewer without --input:
https://github.com/danielmiessler/LifeOS/blob/03a969dd96dc7ff701d92dbc8a8b8d6db4728834/LifeOS/install/hooks/MemoryReviewFire.hook.ts#L110-L119
function spawnReviewer(turnsReviewed: number): { spawned: boolean; reason: string } {
...
const proc = spawn("bun", [REVIEWER_PATH, "review", "--turns", String(turnsReviewed)], {
--input is a supported flag — the reviewer documents it at line 27. It just isn't passed. So the reviewer falls back to a guess:
https://github.com/danielmiessler/LifeOS/blob/03a969dd96dc7ff701d92dbc8a8b8d6db4728834/LifeOS/install/LIFEOS/TOOLS/MemoryReviewer.ts#L541
const transcript = opts.input ?? findMostRecentTranscript();
And findMostRecentTranscript() walks every project dir and picks the globally newest .jsonl by mtime:
https://github.com/danielmiessler/LifeOS/blob/03a969dd96dc7ff701d92dbc8a8b8d6db4728834/LifeOS/install/LIFEOS/TOOLS/MemoryReviewer.ts#L98-L126
The hook is handed the answer and throws it away to guess instead — and nothing records which transcript any given review actually consumed, so the guess is unauditable after the fact.
Repro (deterministic, ~15 seconds, no concurrency)
The obvious objection is that the newest-mtime file is usually the right one — a Stop hook fires right after the firing session wrote its own turn, so the heuristic is wrong in principle but mostly right in practice. That's true, and it's why this is easy to dismiss. It's also not a defence, because the selection depends on nothing but mtime:
# 1. What would the reviewer read right now?
# (findMostRecentTranscript, verbatim from MemoryReviewer.ts:98-126)
# -> ~/.claude/projects/<your-cwd-slug>/<this-session>.jsonl # correct, by luck
# 2. Plant any .jsonl in an unrelated project dir with a newer mtime:
mkdir -p ~/.claude/projects/-tmp-decoy-repro
echo '{"type":"user","message":{"role":"user","content":"DECOY"}}' \
> ~/.claude/projects/-tmp-decoy-repro/decoy-session.jsonl
touch -d '+1 hour' ~/.claude/projects/-tmp-decoy-repro/decoy-session.jsonl
# 3. Ask again:
# -> ~/.claude/projects/-tmp-decoy-repro/decoy-session.jsonl
I ran exactly this. Before planting the decoy the selector returned the firing session's own transcript; after, it returned decoy-session.jsonl — a file belonging to no session at all. The reviewer will ingest whatever file happens to carry the newest mtime, and its extracted content is what gets written to principal memory.
No concurrency is needed to demonstrate this. Concurrency is simply the case where it happens without anyone planting a file: with two sessions active, whichever wrote last owns the mtime, and the other session's Stop hook reviews it. But the defect stands on its own — the hook does not identify the transcript it is reviewing, and does not log which one it read.
Fix
Read the stdin payload and pin the transcript:
function readHookInput(): { session_id?: string; transcript_path?: string } {
try {
const raw = readFileSync(0, "utf8");
if (!raw.trim()) return {};
return JSON.parse(raw);
} catch { return {}; }
}
// transcript_path is authoritative; session_id resolves across project dirs
// (~/.claude/projects/<cwd-slug>/<session_id>.jsonl — the slug varies by cwd).
function resolveTranscript(hook): string | null {
if (hook.transcript_path && existsSync(hook.transcript_path)) return hook.transcript_path;
if (hook.session_id) return findTranscriptBySessionId(hook.session_id);
return null;
}
…then pass --input <transcript> to the reviewer.
That leaves one policy question, which is yours to make: when the transcript cannot be identified, the hook can either fall through to the existing mtime guess, or decline to spawn. I've implemented the latter locally, on the view that reviewing nothing beats reviewing an unidentified transcript — but the mtime fallback is the status quo and keeping it is a defensible call.
Either way, I'd also log the resolved transcript path per fire, so which-transcript-was-read stops being unanswerable.
I have this working locally and will open a PR if you want it.
Fixed in source. MemoryReviewFire now reads the Stop-hook stdin payload, passes --input <transcript_path> to the reviewer, and logs session_id + transcript_path in reviewer-fires.jsonl. The reviewer reads this session's transcript instead of guessing by global mtime, and what it read is auditable — exactly the concurrent-session failure you called out. Ships next release.
This and #1494 were both surgical. You're in the README Credits section now — thank you.
Following up because the fix does not appear to have shipped, and I hit this again on a fresh install.
Installed 7.1.1: hooks/MemoryReviewFire.hook.ts still contains no read of stdin. grep -c 'readHookInput\|session_id\|transcript_path\|--input' returns 0, and spawnReviewer still builds ["review", "--turns", N] with no --input.
Public main at d1d6240 (2026-07-23): same. LifeOS/install/hooks/MemoryReviewFire.hook.ts matches only review-state.json on that grep. If the fix lives in a private source tree that the public repo mirrors on release, this is just a heads-up that it has not landed here yet.
Field data from running it unfixed, in case it is useful for prioritising: on an install that normally runs several sessions in parallel, I logged every reviewer fire for 11 days. 88 fires; the last 25 read roughly 18 distinct transcripts. One directly observed case had the fire triggered by session A read session B's transcript. On one day, 3 of 7 fires read transcripts belonging to a bulk automated job rather than any conversation, extracting 1, 0 and 2 exchanges.
The downstream cost is that durable memory gets written from whichever conversation happened to touch disk last. Over the same window I traced the memory file commit by commit and it lost 12 standing rules to unrelated rewrites.
I have patched my own install along the lines you described (read the Stop payload, pass --input <transcript_path>, keep the mtime path as fallback, log session_id and the transcript in reviewer-fires.jsonl) and it verifies: pinning a transcript that is deliberately not the newest by mtime, the reviewer reads the pinned one. Happy to send it as a PR if that helps, or to close this again if the fix is already queued.
One related thing the fix as described would not cover, filed separately as #1711: the cadence state itself is a single global file with no session scoping.
Correcting my own comment above: the "not in main" observation was built on a wrong premise and I should not have led with it.
You explained the model when you closed #1644 on 2026-07-29: the public repo is generated from a private tree by rsync at release time. Under that model public main will never show a code fix between releases, so my grep proving the fix is absent from d1d6240 proves nothing about whether the fix exists. It was a predictable result presented as a finding. Apologies for the noise.
What still stands, narrowed to what I can actually verify from here:
- The installed 7.1.1 does not have the fix, which is expected since no release has cut since 2026-07-12. That is a statement about my install, not about your source tree.
- The field data from running it unfixed holds on its own: 88 reviewer fires over 11 days on a machine with several parallel sessions, the last 25 reading roughly 18 distinct transcripts, one directly observed case of session A's fire reading session B's transcript, and one day where 3 of 7 fires read a bulk automated job instead of a conversation. Over the same window the memory file lost 12 standing rules to unrelated rewrites. That is offered as severity data for the release queue, nothing more.
I have patched my own install in the shape you described and it verifies, so I am unblocked either way. #1711 is the piece I believe your fix does not cover, since it is about cadence rather than transcript selection, and I filed it separately for that reason.
Feel free to re-close this. I reopened the thread on a bad premise.