Agent Teams: Named agent spawn reports success but no process is created

Resolved 💬 1 comment Opened May 2, 2026 by couvares Closed Jun 1, 2026

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

  1. Launch Claude Code with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  2. Call TeamCreate to create a team
  3. Call Agent with a name parameter:

``
Agent({
name: "test-agent",
description: "Test",
prompt: "Write 'ALIVE' to /tmp/test.txt"
})
``

  1. Observe: CC returns "Spawned successfully. agent_id: test-agent@team-name. The agent is now running."
  2. Check: /tmp/test.txt does not exist. No process running. Inbox file created with unread message.
  1. Control: Call Agent WITHOUT name parameter (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: false indefinitely
  • Named agent is NOT added to config.json members array
  • 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: "..."}) without name runs 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-name labels) but none correspond to running processes
  • Workaround: Omit the name parameter. Unnamed agents use an inline/async code path that works reliably. Trade-off: cannot use SendMessage for 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗