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.