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. These docs describe the intended design as much as the current state.

27. Full-content chunks in CouchDB (per-turn content, not just byte ranges)

Date: 2026-07-22

Status

Accepted — implemented on both the write and read paths.

The hook + backfill embed entries[] when couchFullContentChunks is on, validated at the webapi. Every consuming view has landed:

Per-turn search over entries[] is live in Meilisearch's turns index (ADR 0009).

Content chunks are the default for both writers (the hook and backfill), so history adopted from here on needs nothing extra.

Remaining, and only where history was adopted before this landed or with --no-content: those sessions carry byte-range-only chunks, fall back to S3 on read, and contribute nothing to content search. backfill can't redo them — it skips any session that already has a summary doc — so closing this needs either a re-process flag on backfill or a migration that rebuilds chunks from the S3 transcript. Not built, because no known deployment is in that state.

Context

A session is stored two ways. The byte-faithful transcript lives in S3 as a single transcript.jsonl object (ADR 0014), and CouchDB holds append-only metadata: event markers, a summary doc at SessionEnd, and — added since — chunk docs written mid-flight for crash resilience (mid-flight-chunking.md).

The mid-flight chunking mechanism is already built: the hook flushes chunk docs as the session grows, ingest is idempotent with stable ids (chunk:<session>:<byteStart>), and backfill reconstructs the same chunks for adopted history. But a chunk doc today records only a byte-range slicebyte_start, byte_end, entry_count — a pointer into the S3 transcript. It does not contain the messages.

The consequence: CouchDB cannot see an individual turn. Anything that needs per-turn structure — speaker-split views (user vs Claude), per-turn search indexing, map-reduce feature extraction, prompt/instruction provenance — is blocked, because the only place the turns exist in parsed form is the S3 blob, and map-reduce can't run over S3. The couchFullContentChunks feature flag was added in anticipation of this but nothing populates content yet.

This is the remaining half of the logging rework (roadmap #4).

Decision

Promote chunk docs from byte-range pointers to full-content chunks: parse the transcript entries and store their content in CouchDB, so map-reduce views operate directly on turns.

Consequences