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 ¶
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 (*Collector) Collect ¶
func (c *Collector) Collect(ctx context.Context, req omnidevx.CollectRequest) (*omnidevx.CollectionResult, error)
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.
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
func (r *SessionReader) List(ctx context.Context, opts sessions.ListOptions) ([]sessions.Session, []omnidevx.Diagnostic, error)
List implements sessions.Reader.