Skip to main content

Module sessions

Module sessions 

Source
Expand description

The Claude Code sessions daemon service.

A thin adapter that hosts the cross-window SessionsRegistry under the daemon’s lifecycle and exposes the ingest ops (observe/end/window/ window-unregister) and the read op (list) over the control socket, plus a tray submenu with a per-session “focus” action for sessions embedded in a VS Code window.

All registry state and liveness logic (the two Mutex<HashMap>s, TTL reaping, the entry caps, the Source join) lives in crate::sessions; this adapter only routes ops, enriches a session’s repo from its cwd via git2 (the disk I/O the engine deliberately avoids, off the registry lock on a blocking thread — the worktrees git_status precedent, #1186), renders the menu/status, and drives the shared VS Code launcher. Like the Snowflake and worktrees services it is a cheap, in-memory adapter — no async setup, no secret persisted.

Phase 3 additionally starts the engine-owned transcript watcher (start_watcher) so sessions started before the daemon — or working through the hook-silent “thinking window” — are still discovered and marked active. See ADR-0052.

Structs§

SessionsService
Hosts the cross-window SessionsRegistry as a DaemonService.

Constants§

SERVICE_NAME
The sessions service name (the control-socket routing key).