Session Management

Code Desktop provides a visual interface for browsing, searching, and inspecting daemon sessions. The workspace rail and timeline view give you full visibility into every conversation and task.

Workspace Rail

The workspace rail is a sidebar panel that lists all sessions managed by the daemon. Each session entry displays:

  • Session title -- derived from the first user message or a custom name
  • Session ID -- the unique identifier for the session
  • Status indicator -- active (green), idle (grey), or errored (red)
  • Last activity -- relative timestamp of the most recent turn
  • Turn count -- total number of turns in the session

Clicking a session in the rail loads its timeline in the main content area. The currently selected session is highlighted with a violet accent border.

The workspace rail includes a search input at the top that filters sessions in real time. Search matches against both the session title and the session ID, making it easy to find specific conversations in a long list.

Timeline Cards

When a session is selected, the main content area displays its turns as a chronological timeline. Each turn is rendered as a card containing:

  • User message -- the prompt sent to the model
  • Model response -- the generated reply, rendered with full markdown support
  • Tool calls -- collapsible tool invocation cards (see below)
  • Metadata -- model name, timestamp, and turn index

The timeline scrolls vertically with the most recent turn at the bottom. New turns appear automatically as they stream in via the WebSocket connection.

Streaming Indicators

When the daemon is actively processing a turn, the timeline displays streaming indicators:

  • A pulsing accent border on the active turn card
  • A live token counter showing tokens generated so far
  • Progressive markdown rendering as tokens arrive

Streaming events are received via the WebSocket connection. The client subscribes to events for the active session and routes them by event type (turn.token, turn.tool_call, turn.done, etc.).

Turn Statistics

When a turn completes (indicated by a turn.done event), the turn card displays summary statistics:

StatisticDescription
tokensTotal tokens generated in the response
speedGeneration speed in tokens per second
elapsedWall-clock time from request to completion
toolCallsNumber of tool invocations during the turn

Tool Cards

Tool invocations are displayed as collapsible cards within the turn timeline. Each tool card has two variants:

  • tool-call -- shows the tool name and arguments the model passed
  • tool-result -- shows the output returned to the model

The primary field is toolName, matching the v3 protocol contract. Cards are collapsed by default to keep the timeline compact, and expand on click to reveal full details.

V3 protocol events
Tool cards render from envelope.event data in the WebSocket stream. The event type field is event, not kind -- this matches the daemon v3 protocol contract.

Session Export

Sessions can be exported in two formats:

  • JSON -- full structured data including all turns, tool calls, metadata, and statistics
  • Markdown -- human-readable transcript with formatted code blocks and tool call summaries

Export is triggered from the session context menu in the workspace rail. The exported file is downloaded directly in the browser.