Skip to content

v0.5.1 — the number was lying

Choose a tag to compare

@SignedAdam SignedAdam released this 06 Aug 21:07
· 19 commits to main since this release

Bug fix for compact --in-place, shipped in 0.5.0.

The compaction worked; the number lied

The preserved tail — the entries kept verbatim so a live session can go on
appending — kept its original usage blocks. Those describe the session before
the rewrite, and everything that reads a transcript takes its peak from them: the
context badge, a status line, the warning hook.

So a session compacted from 438k to 64k went on reporting 438k, forever. One real
204 KB session was still claiming 788,693 tokens. The compaction had worked
perfectly every time and looked like it had done nothing.

usage is metadata, not chain structure, so removing it from the tail cannot
affect the append path. ContextMetrics already falls back to a size estimate for
files with no usage, so the app now reports the real size.

--resume that would be refused

A session that is still running refuses claude --resume <id> — always the case
for a background agent, which never exits on its own. --in-place now checks
before printing the command, and offers --fork-session or ending the agent
first.

A wrong test

The regression check asserted a strictly linear parent chain. Real transcripts
never have one: every Esc-and-retry leaves a parent pointing at an earlier entry,
and an untouched 26 MB session "fails" that check 103 times. It now asserts what
actually matters — that no parentUuid points at an entry the rewrite removed.

60 checks in scripts/cli_check.sh.