Claude Transcripts docs GitHub
Work in progressUnder active development — not tested as ready for use. Breaking changes land without notice, stored data may need to be discarded between revisions, and there is no auth or security model.

Backfill

backfill adopts the transcripts Claude Code already keeps on disk (~/.claude/projects/**/<id>.jsonl) as first-class history: sessions from before you installed, or from while the stack was down.

claude-transcripts backfill --dry-run                   # preview: adopt / skip / repair per session
claude-transcripts backfill                             # adopt everything not already stored
claude-transcripts backfill --force --session <id>      # rebuild one adopted session
claude-transcripts backfill --repair                    # finish sessions an interrupted write left short

All flags: cli.md.

What it writes

For each session, the same shape a live recording has, delivered through the webapi's /api/ingest/* routes (indexed for search within system.search.flushIntervalMs, 3 min by default, like any other write):

Timestamps are the transcript's own, never the time of the backfill. --host and --actor set attribution. Token usage is computed with the same sumTranscriptTokens the hook uses, so counts match a live recording.

Subagents

Subagents are recorded the way the live hook records them: a SubagentStart and a SubagentStop marker each (agent_id, and agent_type when known), plus a PostToolUse / PostToolUseFailure marker for every tool call made inside one, counted into the summary's tool_counts. Backfill finds them in every layout Claude Code has used: <session>/subagents/agent-<id>.jsonl (with its .meta.json), agent-<id>.jsonl beside the session files, and isSidechain lines inside the session transcript itself. An agent-*.jsonl file is never adopted as a session of its own.

What a transcript can't give back:

A subagent's own transcript file is not uploaded or chunked; the live hook doesn't store it either. Sidechain lines inside the session transcript are part of it, so they are. Sessions adopted by an older CLI have no subagent markers; --force rebuilds them.

Model switches and directory changes

A PostModelSwitch marker (from_model, to_model) is written where the model that answers the session's main chain changes, and a CwdChanged marker (old_cwd, new_cwd) where its working directory does; each later marker carries the cwd in force then. Subagent lines and Claude Code's own placeholder turns (<synthetic>) are not switches. The summary lists every model as models. What a transcript can't give back: the switch's source and cost estimate, the exact moment (the marker takes the first line that shows the new value), and DirectoryAdded, which leaves no trace in the file. Sessions adopted by an older CLI have none of these; --force rebuilds them.

Re-running

reconcile

A session killed or crashed before SessionEnd has its event markers and chunks but no summary:<id>, so it reads as incomplete with no token totals. reconcile writes the summary it never got:

claude-transcripts reconcile                  # every session that reads as incomplete
claude-transcripts reconcile <id>… [--force]  # these sessions; --force also takes a running one
claude-transcripts reconcile --dry-run --json

Automatically: the webapi's change follower runs the same command every hour on up to 50 sessions that read as incomplete (system.sessions.reconcile, configuration.md). It needs the CLI beside the webapi; the app image ships it. A session the command fails on isn't retried until the webapi restarts.

Not built