pub enum ClaudeRecord {
Show 19 variants
User {
message: Message,
meta: RecordMeta,
},
Assistant {
message: Message,
meta: RecordMeta,
},
System {
subtype: Option<String>,
extra: BTreeMap<String, Value>,
},
Attachment {
extra: BTreeMap<String, Value>,
},
FileHistorySnapshot {
extra: BTreeMap<String, Value>,
},
FileHistoryDelta {
extra: BTreeMap<String, Value>,
},
AiTitle {
extra: BTreeMap<String, Value>,
},
PermissionMode {
extra: BTreeMap<String, Value>,
},
Mode {
extra: BTreeMap<String, Value>,
},
LastPrompt {
extra: BTreeMap<String, Value>,
},
QueueOperation {
extra: BTreeMap<String, Value>,
},
PrLink {
extra: BTreeMap<String, Value>,
},
FrameLink {
extra: BTreeMap<String, Value>,
},
AgentName {
extra: BTreeMap<String, Value>,
},
Started {
extra: BTreeMap<String, Value>,
},
Result {
extra: BTreeMap<String, Value>,
},
WorktreeState {
extra: BTreeMap<String, Value>,
},
ForkContextRef {
extra: BTreeMap<String, Value>,
},
Unknown,
}Expand description
One line of a Claude Code transcript.
Variants§
User
A user turn (plain text, or an array of content blocks incl. tool results).
Fields
meta: RecordMetaConversation-graph links and metadata.
Assistant
An assistant turn (text, thinking, and/or tool calls).
Fields
meta: RecordMetaConversation-graph links and metadata.
System
A system event (subtypes: compact_boundary, turn_duration,
api_error, away_summary, stop_hook_summary, …).
Attachment
An attachment record (pasted/added files, images, command output).
FileHistorySnapshot
A file-state snapshot enabling edit undo.
FileHistoryDelta
The per-file half of the same edit-undo state: one record per file
touched by a turn, pointing back at the ClaudeRecord::FileHistorySnapshot
it belongs to (snapshotMessageId) and naming the tracked path and its
backup (trackingPath, backup). Claude Code began emitting these on
2026-07-25; before that a snapshot carried the whole set. Like its
sibling it is a marker for /rewind, not conversation, so it is
modeled generically — the point is that it stops landing in the
anonymous ClaudeRecord::Unknown bucket.
AiTitle
Generated conversation title.
PermissionMode
Permission-mode marker.
Mode
Mode marker.
LastPrompt
The last typed prompt (UI restore).
QueueOperation
Prompt-queue operation (UI).
PrLink
PR link metadata.
FrameLink
Claude-hosted HTML frame link metadata (path + frameUrl). This is
session/UI state rather than a conversational turn, analogous to
ClaudeRecord::PrLink, but remains explicitly typed so audits name
its intentional cross-format residue instead of reporting an unknown
record discriminant.
AgentName
Subagent name marker.
Started
Subagent task start marker.
Result
Subagent task result marker.
WorktreeState
Git worktree state marker.
ForkContextRef
PARITY-10 (provenance P010): a lineage/provenance marker linking this
session to the conversation context it was forked from (e.g. Claude
Code’s --fork-session / rewind-and-branch flow). Extremely rare in
real corpora (observed 5 times in a ~12,300-file, ~1.3M-record
reference corpus) and its exact field shape is unconfirmed by any
sample this crate has seen — modeled generically (like
ClaudeRecord::WorktreeState/ClaudeRecord::AgentName) so every
field it carries, whatever they turn out to be, is captured in
extra rather than silently landing in the anonymous
ClaudeRecord::Unknown bucket.
Unknown
Any record type we do not model yet.
Implementations§
Source§impl ClaudeRecord
impl ClaudeRecord
Sourcepub fn tag(&self) -> Option<&'static str>
pub fn tag(&self) -> Option<&'static str>
The static discriminant name, or None for ClaudeRecord::Unknown.
Trait Implementations§
Source§impl Clone for ClaudeRecord
impl Clone for ClaudeRecord
Source§fn clone(&self) -> ClaudeRecord
fn clone(&self) -> ClaudeRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more