claude-code - 💡(How to fix) Fix Agent Teams: Named agent spawn reports success but no process is created [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55666Fetched 2026-05-03 04:47:36
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

Either the agent process should actually be spawned, or the Agent tool should return an error indicating spawn failure.

Fix Action

Fix / Workaround

  • 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.

Tested across 2 independent CC sessions, 15+ dispatch attempts total.

Code Example

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

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"
    })
  4. Observe: CC returns "Spawned successfully. agent_id: test-agent@team-name. The agent is now running."

  5. Check: /tmp/test.txt does not exist. No process running. Inbox file created with unread message.

  6. 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

ConditionNamed (name param)Unnamed (no name)
CC response"Spawned successfully"Returns inline result
Process created❌ No✅ Yes
Task completed❌ No✅ Yes
Inbox createdYes (unread)N/A
Members arrayNot addedN/A

Tested across 2 independent CC sessions, 15+ dispatch attempts total.

extent analysis

TL;DR

The issue can be worked around by omitting the name parameter when calling the Agent function, allowing the agent to run inline and complete successfully.

Guidance

  • The problem seems to be related to the agent spawn mechanism when using named agents with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
  • To verify the issue, check if the agent process is created and the task is completed when omitting the name parameter.
  • The workaround of omitting the name parameter allows unnamed agents to use an inline/async code path that works reliably, but this means SendMessage cannot be used for follow-up communication with the agent.
  • Reviewing the config.json members array and the inbox files can help understand how named agents are handled differently than unnamed ones.

Example

No code snippet is provided as the issue seems to be related to the internal workings of the Agent function and the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable.

Notes

The issue is not version-specific and has been tested on multiple versions of Claude Code. The workaround provided may have limitations, such as the inability to use SendMessage for follow-up communication with the agent.

Recommendation

Apply the workaround by omitting the name parameter when calling the Agent function, as this allows the agent to run inline and complete successfully, despite the trade-off of not being able to use SendMessage for follow-up communication.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Agent Teams: Named agent spawn reports success but no process is created [1 participants]