You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
claudbg/.beans/claudbg-xpzp--sessions-list...

43 lines
1.6 KiB
Markdown

---
# claudbg-xpzp
title: '`sessions list` should show sub-agent run count per session'
status: todo
type: bug
priority: normal
created_at: 2026-03-30T04:40:53Z
updated_at: 2026-03-30T04:43:26Z
parent: claudbg-tci9
blocked_by:
- claudbg-33n0
---
## Problem
`sessions list` has no column showing how many sub-agent runs a session spawned, making it impossible to identify sessions that used the Agent tool.
## Expected behavior
Add a `Sub-agents` column to `sessions list` showing the count of sub-agent JSONL files associated with each session. Zero for sessions with no sub-agents.
## Disk structure (important)
The actual subagent files live at:
```
~/.claude/projects/<project-dir>/<session-uuid>/subagents/agent-<id>.jsonl
```
Note: there is a *directory* named `<session-uuid>` (without `.jsonl`) alongside the session file that contains the `subagents/` folder.
The existing `discover_agents_for_session(session_file)` function currently looks in the *wrong place* (see separate bug). Once that is fixed, the agent count can be obtained by calling `discover_agents_for_session` for each session and taking `.len()`.
## Implementation notes
- In `sessions list`, after syncing sessions, call `discover_agents_for_session(&session_ref.file_path)` for each session to get the count.
- Add the count as the last column in the table row.
- Update JSON output to include `subagents` field.
- This is blocked on the subagent path discovery bug being fixed first.
## Relevant files
- `src/commands/sessions.rs``list()` function
- `src/parser/discovery.rs``discover_agents_for_session`