Skip to main content
Managing sessions and changes

Managing Sessions

Overview

Every run of Qoder CLI CN produces a session, recording the full history of that conversation — your inputs, Qoder's replies, and tool calls. Sessions can be continued, resumed, named, branched, and cleaned up, letting you switch flexibly between tasks and pick up where you left off after an interruption. Sessions are stored per project. Each session has a unique session id, and session records are kept in per-project directories under the user config directory (default ~/.qoder-cn/projects/<project>/<session-id>.jsonl).

Starting a new session

Running qodercn in the project root starts a new session, with the session id generated automatically:
qodercn
In an interactive session, use /new to start a fresh session; /clear clears the conversation history and likewise starts a new session — the two are similar in effect.

Naming a session

Use -n (--name) to give the session a recognizable display name:
qodercn -n "Login refactor"
Within a session, you can also rename the current session with /rename.

Specifying a session id

Use --session-id to use a specific session id, handy for scripts or automation that reference a fixed session:
qodercn --session-id 00000000-0000-0000-0000-000000000000

Continuing and resuming

Continue the most recent session

Use -c (--continue) to continue the current project's most recent session directly:
qodercn -c

Resume a specific session

Use -r (--resume) to resume a previous session by id:
qodercn -r <session-id>
Running qodercn --resume without an id opens the session browser, letting you pick the session to resume from a list. In an interactive session, the /resume command also opens the session browser; /continue continues the most recent session.

Branching a session

Use --fork-session to create a new branch from a resumed session instead of continuing on the original. This lets you explore a different direction from a historical point while leaving the original session untouched:
qodercn -r <session-id> --fork-session
In an interactive session, you can also branch from the current session with /branch.

Exporting a session

Use /export to export the current conversation to a file or copy it to the clipboard, for sharing, archiving, or continuing analysis elsewhere:
/export

Listing and deleting

Use --list-sessions to list the currently available sessions:
qodercn --list-sessions
Use --delete-session to delete a session by its index in the list:
qodercn --delete-session <index>

Session storage location

Session records are stored per project under the user config directory:
~/.qoder-cn/projects/<flattened-project-path>/<session-id>.jsonl
~/.qoder-cn/projects/<flattened-project-path>/<session-id>/state.json
The .jsonl file stores the conversation record, and state.json stores the session state. The user config directory defaults to ~/.qoder-cn and can be customized with the QODERCN_CONFIG_DIR environment variable.

Commands and flags at a glance

Command / flagPurpose
qodercnStart a new session
-c, --continueContinue the most recent session
-r, --resume [id]Resume a specific session; opens the session browser without an id
-n, --name <name>Set the session display name
--session-id <id>Use a specific session id
--fork-sessionCreate a branch from a resumed session
--list-sessionsList available sessions
--delete-session <index>Delete a session by index
/newStart a new session within a session
/clearClear the conversation history and start a new session
/renameRename the current session
/branchCreate a branch from the current session
/resume, /continueResume / continue sessions
/exportExport the current conversation