Documentation
¶
Overview ¶
Package transcript reads the tail of a Claude Code transcript (.jsonl) for display metadata: title, first prompt, model, branch, context size, and whether a turn is open. Transcripts can be tens of MB; only the last 64KB is read, and results are cached by file size and mtime so a 1s poll is cheap.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MungeProjectDir ¶
MungeProjectDir converts a cwd into Claude Code's projects-dir name (slashes and dots become dashes).
func Newest ¶
Newest returns the transcript path for (cwd, sessionID): <sessionID>.jsonl under the cwd's project dir, else under any project dir (a session that cd'd into a worktree keeps its transcript where it started), else the most recently modified .jsonl in the cwd's project dir, or "" when none.
Types ¶
type Info ¶
type Info struct {
Title string // Claude's generated aiTitle
FirstPrompt string // first plain user prompt seen in the tail
Model string
Branch string
PermissionMode string
ContextTokens int64
LastActivity time.Time // timestamp of the last substantive line, else file mtime
TurnOpen bool // last substantive line was not a turn_duration
Known bool // file existed and was parsed
}
Info is what the tail of a transcript tells us.