pub struct SessionSummary {
pub session_id: String,
pub project_slug: String,
pub message_count: usize,
pub first_timestamp: Option<String>,
pub last_timestamp: Option<String>,
pub title: Option<String>,
pub first_user_preview: Option<String>,
pub total_cost_usd: Option<f64>,
pub total_tokens: Option<u64>,
pub size_bytes: u64,
}Expand description
Summary of one session’s .jsonl file.
Fields§
§session_id: StringFilename stem – the session UUID Claude Code assigned.
project_slug: StringThe owning project’s slug (directory name).
message_count: usizeCount of user + assistant entries (excludes
queue-operation, attachment, ai-title, last-prompt, etc.).
first_timestamp: Option<String>First timestamp seen in the file (any entry type), as the raw string Claude Code wrote.
last_timestamp: Option<String>Last timestamp seen.
title: Option<String>Auto-generated title if Claude Code emitted an ai-title
entry; None otherwise.
first_user_preview: Option<String>First ~160 chars of the first user message’s text content,
flattened to a single line. Useful as a fallback display name
when title is None (which is most sessions today since
claude-code only writes ai-titles intermittently). None when
the session has no readable user message.
total_cost_usd: Option<f64>Sum of message.usage.total_cost_usd across every assistant
entry. Always None on current claude-code (the field is written
as null); kept in the shape so we can plumb it through if the
upstream behavior changes. Use total_tokens for a usage proxy.
total_tokens: Option<u64>Sum of input + output + cache tokens across every assistant
entry. None when the session has no assistant entries. Cheap to
derive from message.usage, which claude-code DOES write.
size_bytes: u64File size in bytes.
Trait Implementations§
Source§impl Clone for SessionSummary
impl Clone for SessionSummary
Source§fn clone(&self) -> SessionSummary
fn clone(&self) -> SessionSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more