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.

Actions and bindings

An action is one behaviour the system performs. Most are hook behaviours. Actions are defined independently of hook events and bound to them many-to-many (ADR 0017), all in the app model:

The current event → actions table is generated into hook-events.md ("What we do").

Catalogue

ActionDoesWrites
write-event-markerAppend a small type: "event" doc for the eventCouchDB
update-countsBump per-session counters (events, prompts, errors, tools)/tmp
flush-transcript-chunkTail the transcript into chunk docs, batched by size and time (mid-flight-chunking.md)CouchDB
write-summaryAt session end, compute the rollup and token usage and write summary:<id> (plus summary.json in S3 when blobs are on)CouchDB, S3
upload-blobsUpload the byte-exact transcript.jsonlS3
seed-session-startReset counters and chunk offset; record the resolved targets and last-write time for the statusline/tmp, CouchDB
inject-recall-policyPrime the session with the recall policy and how much history this directory has; omitted when recall is off, the directory is excluded or empty, or the webapi is slow (ADR 0029)stdout (context)
reconcile-sessionWrite the missing summary:<id> for a session that never fired SessionEnd, from its event markers and (when present) its S3 transcript. Not bound to an event, because a dead session fires none. It is the reconcile CLI command, and the change follower runs it on a sweep (tools.md).CouchDB (via the webapi)
announce-recordingPrint the session-start banner: where the session is recorded, or that it isn't.stdout (transcript)
check-hook-compatAdd the hook-spec check to that banner: one line when the running Claude Code matches the spec this build was made for, a short drift summary when it doesn't (compatibility.md). Skipped after a compaction.stdout (transcript)

Planned, with no handler yet: enrich-metadata (post host and harness metadata), extract-feature (URLs, repos, PRs, slash commands, models), detect-memory-write (Edit/Write to memory files, CLAUDE.md, AGENTS.md), app-log (app-logging.md), index-for-search (search indexing already happens in the webapi's change follower).

What is wired

Fourteen events: SessionStart, UserPromptSubmit, PostToolUse, PostToolUseFailure, Stop, StopFailure, SubagentStart, SubagentStop, PostModelSwitch, CwdChanged, DirectoryAdded, PreCompact, PostCompact, SessionEnd. flush-transcript-chunk runs on the turn events (UserPromptSubmit, PostToolUse, PostToolUseFailure, Stop) and a final flush at SessionEnd. StopFailure, PreCompact and PostCompact only write markers, which explain sessions with an unusual shape (API errors, compaction). PostModelSwitch, CwdChanged and DirectoryAdded only write markers too: what the session ran on, and where, after it started.

Adding behaviour

Add an action to ACTIONS, a handler to HANDLERS and a row to BINDINGS, then run bun run gen:hooks && bun run gen:hook-events. Never hand-edit hooks.json. Rules: