Sessions
Every conversation and task in Opta is tracked as a session. Use the sessions command group to list, inspect, export, and manage your session history.
Overview
Sessions are the fundamental unit of interaction in Opta. Each opta chat or opta do invocation creates a new session (or resumes an existing one). Sessions persist all messages, tool calls, tool results, and metadata to disk so you can review, export, or continue them later.
Listing Sessions
opta sessions list shows all stored sessions, sorted by most recent first. Each entry displays the session ID, title (auto-generated from the first message), creation date, and message count.
Viewing a Session
opta sessions show displays the full contents of a session, including all messages, tool calls, and results. Use this to review what happened in a previous conversation or task.
Exporting Sessions
opta sessions export writes a session to a file in JSON format. This is useful for sharing sessions, archiving important conversations, or processing session data with external tools.
Deleting Sessions
opta sessions delete permanently removes a session from disk. This action cannot be undone.
Storage Location
Sessions are stored as JSON files in the daemon's configuration directory. Each session gets its own subdirectory containing the session data and any associated metadata.
Session Format
Sessions are stored as JSON, following the daemon v3 protocol schema. Each session contains an array of events including user messages, assistant responses, tool calls, and tool results.
Cross-Client Continuity
Sessions created in the CLI are accessible from any Opta client that connects to the same daemon. This means you can start a conversation in the CLI, then continue it in the Opta Local Web interface or the Opta Code Desktop app.
| Client | Read Sessions | Create Sessions | Resume Sessions |
|---|---|---|---|
| Opta CLI | Yes | Yes | Yes |
| Opta Local Web | Yes | Yes | Yes |
| Opta Code Desktop | Yes | Yes | Yes |