transcript

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package transcript reads Claude Code's session transcripts (JSON lines). A transcript is untrusted input: it is read only when it is a regular file under the projects folder, never through a link, and never more than a bounded amount.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContinuedIn added in v1.3.3

func ContinuedIn(path string) (string, bool)

ContinuedIn is the id of the session that a resume moved this conversation into, from the last "continued-in" line at the end of the transcript. The id is untrusted: the caller checks it.

func Cwd added in v1.6.2

func Cwd(path string) string

Cwd is the folder the conversation was started in: the first cwd field of a line, within the first part of the transcript. It is untrusted: the caller checks it.

func Find added in v1.6.2

func Find(configDir, id string) string

Find is the transcript of a session, under any project of <configDir>/projects, or "" when there is none that Valid accepts. The caller has checked that id is a session id, so it cannot leave the folder.

func FirstPrompt

func FirstPrompt(path string) string

FirstPrompt is the first line of the first real user message: messages that start with a tag (command and system wrappers) or are blank are skipped. A line that is not JSON is skipped.

func Recent

func Recent(path string) (string, bool)

Recent is the end of the conversation for the summarizer: the user and assistant text of the last 40 lines, "type: text" each, every physical line cut to 600 characters, and the last 6000 bytes of that, on a character boundary.

func Valid

func Valid(path, configDir string) bool

Valid says whether path may be read: it starts with the literal <configDir>/projects/, has no /../ in it (checked on the raw string, before any cleaning), and is a regular file that is not a link.

Types

This section is empty.

Jump to

Keyboard shortcuts

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