checkpoint: use compact_transcript path field instead of boolean · Entire
checkpoint: use compact_transcript path field instead of boolean
0eaaf1b→main·
Replace the has_compact_transcript boolean with a compact_transcript string holding the path to transcript.jsonl, placed alongside the transcript (full.jsonl) pointer in the root metadata.json sessions[] entries. Omitted when no compact transcript was written. This mirrors the existing transcript pointer rather than signalling presence separately.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Sessions
d1553195a011View transcript
Changes
5
MCLAUDE.md+1/-1
api/checkpoint
Mmetadata.go+8/-11
cmd/entire/cli/checkpoint
Mpersistent.go+8/-6
Mpersistent_compact_transcript_test.go+8/-6
docs/architecture
Msessions-and-checkpoints.md+4/-4
494 unmodified lines
- Worktree-specific branches - each git worktree gets its own shadow branch namespace, preventing conflicts
- Supports multiple concurrent sessions - checkpoints from different sessions in the same directory interleave on the same shadow branch
- Condenses session logs to permanent
entire/checkpoints/v1branch on user commits - Each committed session stores the raw transcript (
full.jsonl, read by CLI rewind/resume/explain) plus a best-effort compact transcript (transcript.jsonl, generated viatranscript/compactand pre-sliced to the checkpoint'scheckpoint_transcript_start). Both are pushed with the v1 branch. The rootmetadata.jsonsessions[].transcriptpointer keeps targetingfull.jsonl; when the compact transcript was generated the session entry also carrieshas_compact_transcript: true(omitted otherwise) so external readers can locatetranscript.jsonlnext to it. - Uses the
post-rewriteGit hook to keep local session linkage aligned after amend/rebase rewrites - Builds git trees in-memory using go-git plumbing APIs
- Rewind restores files from shadow branch commit tree (does not use
git reset)
MCLAUDE.md+1/-1
380 unmodified lines
SessionFilePaths Struct
type SessionFilePaths struct {
Metadata string `json:"metadata"`
Transcript string `json:"transcript,omitempty"`
ContentHash string `json:"content_hash,omitempty"`
Prompt string `json:"prompt"`
HasCompactTranscript bool `json:"has_compact_transcript,omitempty"`
CompactTranscript string `json:"compact_transcript,omitempty"`
}
403 unmodified lines
// Write transcript. The pointer targets full.jsonl, which CLI // rewind/resume/explain read by filename. The compact transcript.jsonl is // also written into the tree (so it is pushed) and signalled to external // readers via the HasCompactTranscript flag below.
79 unmodified lines
// Root metadata.json still points at full.jsonl; the compact transcript is
// written into the tree (and pushed) and flagged via has_compact_transcript.
215 unmodified lines
It is written into the checkpoint tree and pushed alongside full.jsonl. The
root metadata.json sessions[].transcript pointer keeps targeting full.jsonl; when a compact transcript was generated the session entry also carries a compact_transcript path pointing at transcript.jsonl (omitted otherwise) so external readers can find it next to full.jsonl.
{
"metadata": "/ab/c123def456/0/metadata.json",
"transcript": "/ab/c123def456/0/full.jsonl",
"compact_transcript": "/ab/c123def456/0/transcript.jsonl",
"content_hash": "/ab/c123def456/0/content_hash.txt",
"prompt": "/ab/c123def456/0/prompt.txt",
"has_compact_transcript": true
}