ai_sessions
AI coding threads recorded by the daemon, including subagents. Filter parent_session_external_id IS NULL for top-level session reporting; counters describe only each thread's own records.
-
id
Primary key - Unique identifier for the row.
-
external_id
Foreign key - External identifier for the session, provided by the AI tool.
-
parent_session_external_id
Foreign key - Immediate parent external_id in the same ai_tool namespace. The parent row may not exist. Null means no recorded parent; follow references to derive ancestry.
-
user_email
string - Email address of the user who conducted the session.
-
title
string - Title of the session.
-
directory
string - Working directory where the session took place.
-
ai_tool
string - Name of the AI tool used in the session.
-
ai_tool_version
string - Version of the AI tool used in the session.
-
started_at
date - Timestamp when the session started.
-
total_messages
number - Total number of messages exchanged in the session.
-
total_tokens_input
number - Total number of input tokens used in the session.
-
total_tokens_cached_input
number - Total number of cached input tokens used in the session.
-
total_tokens_output
number - Total number of output tokens used in the session.
-
summary
string - AI-generated summary of the session.
-
summary_generated_at
date - Timestamp when the session summary was generated.
-
evaluation_generated_at
date - Timestamp when the session evaluation was processed.
-
work_type_assignments_generated_at
date - Timestamp when the session work type assignments were generated.
-
last_message_timestamp
date - Timestamp of the most recent message in the session, denormalized for query performance.
-
messages_updated_at
date - Timestamp when the session messages were last updated.
-
evaluation_error
string - Error message from the session evaluation process.
-
daemon_version
string - Version of the daemon that created this record.
-
daemon_os
string - Operating system of the machine where the daemon ran.
-
primary_model
string - The model that generated the most tokens or messages in the session.
-
complexity
number - The complexity of the session, rated 1 (low), 2 (medium), or 3 (high).
-
complexity_error
string - Error message from the session complexity evaluation process.
-
complexity_generated_at
date - Timestamp when the session complexity was generated.
-
row_created_at
date - Timestamp when the record was created.
-
row_updated_at
date - Timestamp when the record was last updated.