claudecode

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package claudecode collects developer-experience events from Claude Code's local session history (~/.claude/projects/<project>/<session>.jsonl).

The session files are an internal Claude Code format, not a stable public contract: parsing is defensive, unrecognized records are skipped, and all events carry history-mode provenance with reduced confidence.

Only metadata is extracted — models, token usage, tool names, timestamps, workspace and branch identifiers. Prompt text, assistant output, and tool results are never read into events.

Index

Constants

View Source
const DefaultConfidence = 0.9

DefaultConfidence is the provenance confidence for events reconstructed from local session history. Session files are complete transcripts, so confidence is high, but the format is internal and undocumented.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector reads Claude Code local session history.

func New

func New(opts Options) (*Collector, error)

New returns a Collector for the given options.

func (*Collector) Collect

Collect implements omnidevx.Collector. It scans every project's session files, emitting events within the requested period. Unparseable lines and files are reported as diagnostics, never silently dropped.

func (*Collector) Source

func (c *Collector) Source() omnidevx.Source

Source implements omnidevx.Collector.

type Options

type Options struct {
	// Dir is the Claude Code home directory. Defaults to ~/.claude.
	Dir string
}

Options configures the collector.

type SessionReader added in v0.4.0

type SessionReader struct {
	// contains filtered or unexported fields
}

SessionReader lists Claude Code sessions from the local store. It reads prompt text and titles, so it is separate from the metadata-only Collector; see the sessions package for the content-access contract.

func NewSessionReader added in v0.4.0

func NewSessionReader(opts Options) (*SessionReader, error)

NewSessionReader returns a SessionReader for the given options.

func (*SessionReader) Harness added in v0.4.0

func (r *SessionReader) Harness() sessions.Harness

Harness implements sessions.Reader.

func (*SessionReader) List added in v0.4.0

List implements sessions.Reader.

Jump to

Keyboard shortcuts

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