Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 3.28 KB

File metadata and controls

119 lines (85 loc) · 3.28 KB

Session Management

Qwen Code Rust persists conversations to disk so you can resume work across sessions, fork conversations to explore alternatives, and view usage insights.

Storage

Sessions are stored as JSON files in ~/.qcr/sessions/. Each session file contains:

  • A UUID identifier
  • Title (auto-generated from the first user message, or set with /title)
  • Full message history
  • Model/provider info
  • Metadata (project path, token counts, fork info)
  • Timestamps (created, last updated)

Listing sessions

/sessions

Shows all saved sessions sorted by last update time (most recent first). Each entry displays the session ID, title, message count, model, and timestamp. Forked sessions are shown with a fork of <parent> annotation.

Resuming a session

/resume <session-id>

Loads the full conversation history from the selected session. You continue from exactly where you left off, including all tool results and context.

Sessions auto-save periodically and when the session ends.

Forking a conversation

/fork

Creates a new session that starts with a copy of the current conversation history. The fork:

  • Gets a new UUID
  • Records the parent session ID for traceability
  • Is titled "fork: <original title>"
  • Appears in /sessions with a fork annotation

When to use: You want to try an alternative approach without losing your current progress. Fork the conversation, experiment in the fork, and keep the original intact.

After forking, you are working in the new forked session. The original session remains unchanged.

Session insights

/insights

Displays local analytics computed from all saved sessions (no LLM call required):

Metric Description
Total sessions Number of saved sessions (including forks)
Total messages Combined user + assistant + tool messages across all sessions
Avg messages/session Mean conversation length
Total tool calls How many tool invocations across all sessions
Est. tokens used Rough token estimate (from metadata or chars/4)
Most used tools Top 10 tools by call count
Sessions per day Daily session counts for the last 7 days
Recent topics First user message from the 5 most recent sessions

Example output:

Session Insights
================

Total sessions:       42
  Forked sessions:    3
Total messages:       1,847
  User messages:      312
  Assistant messages: 410
Avg messages/session: 44.0
Total tool calls:     1,024
Est. tokens used:     2.1M

Most used tools:
  Shell: 312
  ReadFile: 287
  EditFile: 198
  Grep: 127

Sessions per day (recent):
  2026-03-17: 8 session(s)
  2026-03-16: 5 session(s)
  2026-03-15: 3 session(s)

Recent topics:
  - Add webhook notification system for order events
  - Fix the failing integration tests in auth module
  - Review PR #234 for security issues

Deleting sessions

Sessions can be deleted from disk by removing the corresponding JSON file:

rm ~/.qcr/sessions/<session-id>.json

Session metadata

Each session stores arbitrary key-value metadata. Common metadata keys:

Key Description
project Absolute path to the project directory
token_count Total tokens used (when reported by the provider)

Metadata is preserved when forking sessions.