Skip to content

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.

  • 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 --save or --session. See kolega-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.

Terminal window
# Resume the most recent session for this project
kolega-code . --resume
# Resume a specific thread or session ID
kolega-code . --resume <thread-or-session-id>

A few rules:

  • --resume with 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.
  • --new forces a fresh session (this is the default behavior).
  • --session <ID> is a legacy alias for --resume <ID>; you can’t combine --resume and --session in the same command.

Use the sessions subcommand to list, delete, or export saved sessions:

Terminal window
kolega-code sessions list --project .
kolega-code sessions export <session_id> --output run.json
kolega-code sessions delete <session_id>