Skip to main content

Module claude_code

Module claude_code 

Source
Expand description

Claude Code: ~/.claude/projects/<encoded-cwd>/<session>.jsonl.

Claude’s on-disk payload is already the Anthropic Messages shape, so the codec is close to the identity — it is the reference every other harness normalizes toward. Each line is one Record; user/assistant lines carry an ApiMessage whose content is a string or an array of Anthropic blocks. Non-message lines (summaries, titles, snapshots) are preserved verbatim in Record::Other so native ↔ disk stays lossless even though the codec ignores them.

Structs§

ApiMessage
The wrapped Anthropic message. content is preserved as raw JSON (string or block array); the codec is what turns it into typed Blocks.
ClaudeCode
The Claude Code harness marker.
ClaudeStore
Reads and writes Claude Code sessions under a projects root (default ~/.claude/projects).
EntryLine
A user or assistant line: the per-line envelope plus the wrapped Anthropic message. Unknown envelope keys collect in extra.
SummaryLine
A summary line.

Enums§

Record
One JSONL line. Known line types are typed; anything else is kept whole in Record::Other so the file round-trips without loss.