Skip to main content

Module parser

Module parser 

Source
Expand description

Parser for Claude Code session JSONL files.

Each line is a JSON object with type field determining its structure. We only care about user and assistant entries for backfill.

Structs§

AssistantEntry
AssistantMessage
ParsedSession
A parsed session with all meaningful entries extracted.
SummaryEntry
UserEntry
UserMessage

Enums§

ContentBlock
SessionEntry
Top-level entry in a Claude Code session JSONL file. Uses untagged enum because the type field values don’t map cleanly to Rust enum variants.

Functions§

extract_assistant_texts
Extract all text blocks from an assistant message.
extract_tool_uses
Extract tool_use calls from an assistant message.
extract_user_text
Extract text content from a user message. Content can be a plain string or an array of content blocks.
parse_session
Parse a Claude Code session JSONL file into structured entries.