ClaudeCode.History.SessionMessage (ClaudeCode v0.36.3)
View SourceA message from a session's conversation history, built via parentUuid chain walking.
Matches the Python SDK's SessionMessage type. Contains chain metadata
(uuid, session_id) alongside the parsed message content.
The :message field contains parsed content — for assistant messages this
includes TextBlock, ToolUseBlock, etc. structs; for user messages it
contains either a string or a list of content blocks.
Fields
:type- Message type::useror:assistant:uuid- UUID of this entry in the conversation chain:session_id- Session UUID this message belongs to:message- Parsed message content (seeClaudeCode.Message.AssistantMessageandClaudeCode.Message.UserMessagefor content structure):parent_tool_use_id- Tool use ID that triggered this message, if any
Summary
Functions
Creates a SessionMessage from a raw JSONL transcript entry.
Types
@type parsed_message() :: ClaudeCode.Message.AssistantMessage.message() | ClaudeCode.Message.UserMessage.message_param() | map()
@type t() :: %ClaudeCode.History.SessionMessage{ message: parsed_message(), parent_tool_use_id: String.t() | nil, session_id: String.t(), type: :user | :assistant, uuid: String.t() }