ListAgents omits running in-process subagents despite cross-session messaging being enabled (v2.1.227)
Environment
- Claude Code 2.1.227, Linux (Ubuntu VM), terminal CLI session, model
claude-fable-5 - Cross-session messaging demonstrably enabled:
ListAgentsreturns peer-session rows (local + Remote Control), and teammate idle-notifications from subagents are delivered into the conversation.
What happened
The model spawned two subagents via the Agent tool (background/mailbox mode, named agents). Both ran fine — the terminal UI showed them, and their transcripts under ~/.claude/projects/<project-slug>/<session-uuid>/subagents/agent-*.jsonl grew continuously.
While they were provably running, the model called ListAgents twice, minutes apart. Both calls returned only the Peer sessions (N) section. The running in-process subagents never appeared.
Expected (per docs)
The tools reference for ListAgents (v2.1.224+) says it lists the agents the model can message with SendMessage, including subagents in the session, in sessions where cross-session messaging is enabled. The tool's own in-prompt description likewise says it lists "in-process subagents you spawned".
Actual
Only peer sessions are listed; running in-process subagents are silently absent.
Impact
The model has no working liveness surface for its own subagents (TaskList/TaskOutput track only Bash background tasks and reject the mailbox agent id). In our session the model concluded from the empty listing that both agents had died and respawned the same verification task — twice. Net effect: roughly 3× token spend and several minutes lost, caused purely by the listing contradicting reality.
Related (context, not duplicates): #17011, #25147, #58729 document the broader lack of a model-side subagent monitoring API. This report is narrower: the documented surface that does exist (ListAgents) omits the subagents it documents.
Workaround
Treat listing absence as non-evidence; probe liveness via transcript growth (ls -la ~/.claude/projects/<project>/<session>/subagents/agent-*.jsonl) and rely on completion notifications only.
Repro sketch
- In a session with cross-session messaging enabled, have the model call
Agent(subagent_type: "general-purpose", name: "probe", run_in_background: true, prompt: <any multi-minute task>). - While the agent is visibly running in the UI, have the model call
ListAgents. - Observe: only
Peer sessionsrows; noproberow.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗