Skip to main content

Module transcript

Module transcript 

Source
Expand description

Transcript linking and token extraction.

Reads Claude Code transcript files (JSONL), extracts token usage (deduplicated by message.id), modified files, and spawned agent IDs.

Structs§

ConversationMessage
A conversation message suitable for display.
DiffResult
ThinkingBlock
A captured thinking/reasoning block from an assistant message.
TranscriptAnalysis
Results from parsing a transcript.

Functions§

archive_transcript_to_git
Copy a transcript file into .git/chub/transcripts/ for local review. The copy is stored as <session_id>.jsonl inside the repo’s .git directory so it won’t be committed but is available for LLM review.
calculate_attribution
Calculate line attribution between two commits.
claude_projects_dir
Find the Claude Code projects directory for a given repo path. Returns ~/.claude/projects/<sanitized-repo>/.
find_transcript
Find a Claude Code transcript file for a session.
get_diff_files
Get files modified since a given commit using git diff-tree.
parse_conversation
Parse a transcript into displayable conversation messages. Filters out system messages and deduplicates by UUID.
parse_transcript
Parse a Claude Code transcript file and extract token usage and metadata. Deduplicates by message.id (Claude streams may create multiple entries).
parse_transcript_range
Parse a range of a transcript (from byte offset, optionally limited lines).
transcript_line_count
Count lines in a transcript file.
transcript_size
Get the byte size of a transcript file.