claudesessions

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package claudesessions discovers and defensively parses Claude Code session transcripts under ~/.claude/projects/<encoded-cwd>/<uuid>.jsonl.

Unlike Codex rollout files (a type/payload wrapper per line), Claude Code writes one flat JSON object per line whose fields live at the top level (type, uuid, sessionId, cwd, version, gitBranch, timestamp, message{role,content}, ...). The transcript is the durable record; Claude Code rediscovers a dropped-in file with no registry to update.

Claude Code is closed-source and its format moves quickly, so all parsing here is best-effort: unknown fields are ignored, bad lines become warnings rather than fatal errors, and a single unreadable file never aborts a scan. The per-line "version" is surfaced so format drift is visible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scan

Scan discovers Claude Code transcripts under <home>/projects/<encoded-cwd>/. Every *.jsonl file in a project folder is a session (a logical conversation may also include sidechain lines inside the same file). Results reuse the shared sessions.Session / sessions.ScanResult types and are sorted most-recent-first.

Scan is defensive: an unreadable directory or a single unparseable transcript produces a warning and is otherwise skipped, never aborting the whole scan.

Types

type ScanOptions

type ScanOptions struct {
	IncludeArchived      bool
	DecompressCompressed bool
}

ScanOptions controls how a Claude home is scanned. It mirrors the Codex sessions.ScanOptions shape for symmetry, though Claude Code has no archived or compressed sessions today (the fields are accepted and ignored).

Jump to

Keyboard shortcuts

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