Here's the current state of the compact transcript format and how the UI should parse it. Note that part of this is uncommitted work on the push-compact-for-v1 branch (the committed.go/paths.go/checkpoint.go diff), so the metadata pointer behavior described below ships with that change.
Where the files live
On the entire/checkpoints/v1 branch, each checkpoint is a directory <2-char-shard>/<10-char-rest>/ containing:
a1/b2c3d4e5f6/
├── metadata.json # CheckpointSummary (root, aggregated)
├── 1/ # one dir per session
│ ├── metadata.json # CommittedMetadata (per-session)
│ ├── full.jsonl # raw agent transcript (unchanged, kept for CLI rewind/resume/explain)
│ ├── transcript.jsonl # NEW: compact transcript, scoped to this checkpoint
│ ├── prompt.txt
│ └── content_hash.txt
How the UI finds the right file: root metadata.json
The root metadata.json (CheckpointSummary) has a sessions array of SessionFilePaths:
{ "metadata": "/a1/b2c3d4e5f6/1/metadata.json",
"transcript": "/a1/b2c3d4e5f6/1/transcript.jsonl",
"content_hash": "...", "prompt": "..." }
With the pending change, transcript points at the compact transcript.jsonl when one was generated, otherwise at full.jsonl. Checkpoints written by older CLI versions always point at full.jsonl. So the UI should follow the pointer and sniff the format rather than hardcode the filename: parse the first line and check for "v": 1 — that field only exists in the compact format. Compact generation is best-effort: it's skipped (with a fallback pointer to full.jsonl) if generation fails, output is empty, or the result exceeds 50MB.
Two distinct metadata.json files exist — don't confuse them. The per-session one (your metadata-example.json) carries agent, token_usage, transcript_lines_at_start, initial_attribution. Importantly, the UI does not need transcript_lines_at_start to slice anything: transcript.jsonl is already truncated to the checkpoint's own slice of the session (the compactor applies checkpoint_transcript_start at write time, per agent format).
Compact line format (Entire Transcript Format, v1)
Every line is self-describing JSON, normalized across all agents (Claude Code, Codex, Gemini, OpenCode, Cursor, Droid, Copilot, Pi):
{"v":1, "agent":"claude-code", "cli_version":"0.5.1", "type":"user|assistant",
"ts":"...", "id":"msg_xxx", "input_tokens":123, "output_tokens":45, "content":...}
type: "user" — content is an array: a text block {"id": "<promptId>", "text": "..."} plus pass-through image blocks. IDE context tags are stripped.
type: "assistant" — content is an array of blocks. Streaming fragments with the same message id are already merged into one line; thinking blocks are dropped. input_tokens/output_tokens are present when the agent reports usage.
Tool usage — what the UI parses
Tool calls appear only inside assistant content as tool_use blocks, with the tool result already inlined (no separate result lines to correlate):
{"type":"tool_use", "id":"toolu_...", "name":"Bash",
"input":{"command":"git log -1 --format=\"%B\"", "description":"Show full last commit message"},
"result":{"output":"...", "status":"success"}}
result.status is "success" or "error". result is absent if no tool result followed (e.g. interrupted).
- Rich optional metadata:
result.file ({"filePath": "...", "numLines": 42} for Read/Edit) and result.matchCount (Grep).
input is the verbatim tool input — only type/id/name/input are kept from the raw block.
So to highlight entire search usage, scan assistant lines for tool_use blocks and match:
name == "Bash" and input.command matches entire search (also covers entire checkpoint search)
name == "Task" / "Agent" with input.subagent_type == "entire-search" (the search subagent)
name == "Skill" with input.skill == "search"
Generic tool-usage stats are just (block.name, block.result?.status) over all tool_use blocks — no agent-specific handling needed, that's the point of the format.
Caveats
- The
transcript-output.jsonl in the repo root is stale. It's from an older iteration of the format (separate user_tool_result lines, user content as a plain string). The canonical current format is what cmd/entire/cli/transcript/compact/testdata/*_expected.jsonl shows — use those as UI fixtures, not the repo-root file.
- Legacy checkpoints (and the >50MB / generation-failure fallback) give you raw
full.jsonl, which is per-agent format — the UI should treat anything without "v":1 on line one as "no structured tool parsing available" rather than trying to parse it.
ts is passed through raw from the agent, so treat it as an opaque RFC3339-ish string; it can be absent.
- Field order on each line is stable (struct order:
v, agent, cli_version, type, ts, id, input_tokens, output_tokens, content), but parse it as JSON, not positionally.