cortex sessions
List and manage past chat sessions. Each session maintains its own message history in a dedicated per-session SQLite database.
Usage
cortex sessions # List recent sessions
cortex sessions --limit 50 # Show more sessions
Options
| Option | Description |
|---|---|
--limit | Maximum sessions to show (default: 20) |
--help | Show help for this command |
Session Lifecycle
- Create — A new session is created when you start
cortex chatwithout--resume - Active — Session is in active use, receiving messages
- Closed — Session is ended (exit chat) and marked with a
closed_attimestamp - Resumed — A closed session can be reopened with
cortex chat --resume <session_id>
Per-Session Database
Each session gets a dedicated SQLite database (sess_<id>.db) stored in the data directory. This keeps session data isolated and allows efficient loading of history when resuming.
Examples
# List recent sessions
cortex sessions
# Show more sessions
cortex sessions --limit 50
# Resume a session (via chat command)
cortex chat --resume sess_a1b2c3d4