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 hook performs. 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)
announce-recordingPrint the session-start banner: where the session is recorded, or that it isn't. The only action that writes to stdout.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), reconcile-session (finalise a session that never ended).

What is wired

Eleven events: SessionStart, UserPromptSubmit, PostToolUse, PostToolUseFailure, Stop, StopFailure, SubagentStart, SubagentStop, 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).

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: