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”On a fresh launch, the startup card shows up to three recent sessions from the
same project. Click a title, or focus it with Tab and press Enter, to resume.
An already-open session stays locked: close it in the other instance, then
click again. Resuming asks for confirmation before discarding an unsent draft or
attachments, or changing to the session’s saved worktree. These choices disappear
once you start a conversation and do not return when you clear the thread.
You can also choose a session when launching:
# Resume the most recent session for this projectkolega-code . --resume
# Resume a specific session using the Resume ID from `sessions list`kolega-code . --resume <session-id>A few rules:
- Quitting the TUI prints the exact resume command for the session you just closed, including its ID — copy it to be sure you get this session back.
--resumewith no ID resumes the latest session for the project. If there are none, the CLI reports that.sessions listlabels the session ID to copy as Resume ID. Previously saved commands that use a thread ID remain supported for compatibility.- 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>