Sessions & Resuming
A session captures a conversation: the project it belongs to, the message history, the model configuration, and — for the TUI — the latest plan and shared task list. Sessions let you stop and resume work later.
How sessions are created
Section titled “How sessions are created”- In the TUI, launching
kolega-code .starts a fresh session by default. Your work is saved when you quit (Ctrl+Q,/quit, or/exit). - With
ask, a session is only persisted if you pass--saveor--session. Seekolega-code ask.
Sessions are stored as JSON, one file per session, in your state directory. See
Settings & API Keys for the exact
location and the KOLEGA_CODE_STATE_DIR override.
Resuming in the TUI
Section titled “Resuming in the TUI”# Resume the most recent session for this projectkolega-code . --resume
# Resume a specific thread or session IDkolega-code . --resume <thread-or-session-id>A few rules:
--resumewith no ID resumes the latest session for the project. If there are none, the CLI reports that.- A session belongs to the project it was created in — resuming it from a different project directory is rejected.
--newforces a fresh session (this is the default behavior).--session <ID>is a legacy alias for--resume <ID>; you can’t combine--resumeand--sessionin the same command.
Managing sessions
Section titled “Managing sessions”Use the sessions subcommand to list, delete, or export
saved sessions:
kolega-code sessions list --project .kolega-code sessions export <session_id> --output run.jsonkolega-code sessions delete <session_id>