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.

Mid-flight chunking

The hook copies the transcript into CouchDB chunk docs while the session runs, rather than only at SessionEnd. A crashed or killed session loses at most the last unflushed delta instead of everything, and a running session's transcript can be read and searched. The byte-exact transcript still goes to S3 at SessionEnd. Decision: ADR 0027, which narrows ADR 0014.

Every hook payload carries transcript_path, and Claude Code writes the transcript as JSONL as it goes, so any event can read it from disk. Event docs stay small markers; content comes from the file.

How a flush works

Chunks are not deduplicated: Claude Code writes several entries per streamed message, and merging them (by message.id, as sumTranscriptTokens does) is a read-time job. Keeping each chunk faithful to its slice keeps chunks append-only.

Resumes

On SessionStart with source startup or clear, the offset resets to 0. On resume or compact it carries over: SessionEnd releases the lock but keeps the state file. If the state is gone (a reboot cleared /tmp), the hook asks CouchDB for the highest byte_end among the session's chunks (_all_docs over the chunk:<sessionId>: prefix, descending, limit 1) and continues from there; if CouchDB doesn't answer within 2 s, it starts at 0. An offset past the end of the file (a rewritten transcript) is never used. Restarting at 0 on a resume re-slices the transcript on new boundaries with new ids, duplicating content (#168), which is why the offset is recovered.

Flags

Both default on, in features (configuration.md):

Change them in config/config.json (or the instance's app.json) and re-run setup or install.

Not done