transcript

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package transcript reads Claude Code session transcript JSONL files and extracts the structural metadata and text body the capture uploader needs.

The transcript format is one JSON object per line. We tolerate unknown shapes: each line is parsed leniently and we pull what we recognize (role/type, text content, tool name + tool input paths/commands). Lines we cannot parse are skipped, never fatal — a hook must never fail the session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parsed

type Parsed struct {
	// Text is the concatenated human-readable conversation (user + assistant
	// text), suitable for redaction + distillation.
	Text string
	// FilesTouched are unique file paths referenced by Edit/Write/Read tools.
	FilesTouched []string
	// Commands are unique shell commands referenced by Bash tools.
	Commands []string
	// MessageCount is the number of transcript lines parsed.
	MessageCount int
}

Parsed is the distilled structural view of a transcript.

func Read

func Read(path string) (*Parsed, error)

Read parses a transcript file at path. A missing/unreadable file returns an empty Parsed and the error, so callers can decide whether to spool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL