Agent Teams: Named agent spawn reports success but no process is created
Bug Description
When using CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, the Agent tool with a name parameter returns "Spawned successfully. The agent is now running." but no process is actually created. The inbox infrastructure is set up (inbox files created, messages routed) but no process exists to consume them. Unnamed agents (same session, same task) work correctly.
Steps to Reproduce
- Launch Claude Code with
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Call
TeamCreateto create a team - Call
Agentwith anameparameter:
````
Agent({
name: "test-agent",
description: "Test",
prompt: "Write 'ALIVE' to /tmp/test.txt"
})
- Observe: CC returns "Spawned successfully. agent_id: test-agent@team-name. The agent is now running."
- Check:
/tmp/test.txtdoes not exist. No process running. Inbox file created with unread message.
- Control: Call
AgentWITHOUTnameparameter (same prompt) — works correctly, file is created.
Observed Behavior
- CC returns "Spawned successfully" and "The agent is now running"
- Inbox file created at
~/.claude/teams/<team>/inboxes/<name>.json - Messages written to inbox remain
read: falseindefinitely - Named agent is NOT added to
config.jsonmembersarray - No tmux pane is created for the teammate
- No child process is spawned
- CC's internal status bar shows phantom agent registrations that accumulate across the session
Expected Behavior
Either the agent process should actually be spawned, or the Agent tool should return an error indicating spawn failure.
Environment
- macOS (Apple Silicon, darwin25)
- Claude Code v2.1.119 and v2.1.126 (reproduces on both)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1- Installed via
~/.local/share/claude/versions/(not Homebrew) - Binary path is valid and accessible at spawn time
Additional Context
- Not session-age-dependent: Reproduces on fresh post-compaction sessions and on 30+ hour sessions
- Not version-specific: Tested on v2.1.119 and v2.1.126
- Unnamed agents work: In the same session,
Agent({prompt: "..."})withoutnameruns inline and completes successfully - Related to #48889: That issue documents the teammate spawn mechanism (tmux pane +
process.execPath). In our case, no tmux pane is even attempted — the spawn mechanism never triggers despite CC reporting success - Phantom accumulation: Repeated named agent dispatches add entries to CC's internal agent registry (visible in status bar as
@agent-namelabels) but none correspond to running processes - Workaround: Omit the
nameparameter. Unnamed agents use an inline/async code path that works reliably. Trade-off: cannot useSendMessagefor follow-up communication with the agent.
Controlled Test Results
| Condition | Named (name param) | Unnamed (no name) |
|---|---|---|
| CC response | "Spawned successfully" | Returns inline result |
| Process created | ❌ No | ✅ Yes |
| Task completed | ❌ No | ✅ Yes |
| Inbox created | Yes (unread) | N/A |
| Members array | Not added | N/A |
Tested across 2 independent CC sessions, 15+ dispatch attempts total.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗