-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Summary
The daemon's /list endpoint only returns startedBy, happySessionId, and pid for each session. The working directory is available in memory (TrackedSession.spawnOptions.directory) but not exposed in the response.
Why
External tools (TUIs, scripts, dashboards) that list sessions need the working directory to:
- Resume sessions correctly —
claude --resumemust run from the original directory since session files are stored per-project (~/.claude/projects/<encoded-cwd>/) - Display useful context — showing which project a session is working in
- Avoid brittle workarounds — currently requires reading
/proc/{pid}/cwd(Linux-only, fails for dead processes) or reverse-engineering Claude's project directory encoding
Current state
controlServer.ts /list response:
children: z.array(z.object({
startedBy: z.string(),
happySessionId: z.string(),
pid: z.number()
}))TrackedSession already has:
spawnOptions?: SpawnSessionOptions; // contains directory: stringAnd the /session-started webhook receives metadata which may also contain the path.
Suggested change
Add directory (optional) to the /list response:
children: z.array(z.object({
startedBy: z.string(),
happySessionId: z.string(),
pid: z.number(),
directory: z.string().optional(),
}))Populated from child.spawnOptions?.directory for daemon-spawned sessions, and from webhook metadata for terminal-started sessions.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels