claudecode

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 5 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 claudecode adapts Claude Code's session JSONL format (one JSON object per line under ~/.claude/projects/<sanitized-cwd>/<session-id>.jsonl) into the shapes internal/ingest knows how to store.

The format carries far more than conversation: alongside `user` and `assistant` turns, a real session file interleaves harness/UI bookkeeping types (`mode`, `permission-mode`, `atis-latch`, `last-prompt`, `ai-title`, `file-history-snapshot`, `file-history-delta`, `attachment`, ...) that this adapter treats as non-conversational and skips. `ai-title` is the one exception worth keeping: it's an agent-generated session title, exactly what sessions.title wants ("first user prompt, trimmed, or agent-provided").

A subtlety discovered from a real file: a single logical assistant turn that both thinks and calls a tool isn't one line with a multi-block content array — Claude Code writes each content block as its OWN line, sharing message.id and requestId with an incrementing apiBlockIndex. This adapter treats each line as at most one block; it never needs to reassemble them, because each block becomes its own messages row anyway (messages.kind already distinguishes text/tool_call/tool_result/thinking).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

func New

func New() Adapter

func (Adapter) Agent

func (Adapter) Agent() string

func (Adapter) ParseLine

func (a Adapter) ParseLine(raw []byte) (ingest.ParseResult, error)

Jump to

Keyboard shortcuts

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