Documentation
¶
Index ¶
Constants ¶
const LabelMaxLen = 200
LabelMaxLen is the max length of the label string after sanitization.
const TailReadBytes int64 = 64 * 1024
TailReadBytes is the upper bound on how many bytes we read from the end of a JSONL file.
Variables ¶
This section is empty.
Functions ¶
func ProjectsDir ¶
ProjectsDir returns the directory where Claude Code stores transcripts.
Types ¶
type Session ¶
type Session struct {
ID string
ProjectDir string
JSONLPath string
CWD string
CWDBasename string
Label string
LastTime time.Time
LastEpoch int64
CWDExists bool
}
Session is a parsed view of one Claude Code session transcript.
func FindByID ¶
FindByID scans every project directory looking for a session whose filename matches the given UUID. Returns the parsed session or nil.
func ParseSessionTail ¶
ParseSessionTail reads the tail of one JSONL transcript and returns a Session, or (nil, nil) when the session should be excluded (no user messages / no label).
func Scan ¶
Scan walks every project directory under ~/.claude/projects and parses each session JSONL in parallel. Sessions returned are sorted by last activity (newest first).
func ScanFiltered ¶
ScanFiltered behaves like Scan but only parses files whose path is in the allow-set. Empty allow returns nothing.