TeamCreate spawns teammates that silently exit due to incorrect command generation

Resolved 💬 5 comments Opened Mar 15, 2026 by gaganpulse Closed Apr 13, 2026

Description

TeamCreate in Claude Code v2.1.76 spawns teammate agent processes that silently exit immediately. The teammate pane opens in tmux but the process exits with no error output.

Root Cause

The command TeamCreate generates to spawn a teammate uses the full node binary path directly with env:

env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 /Users/gaganpulse/.nvm/versions/node/v22.22.0/bin/claude --agent-id researcher-1@standby-team --agent-name researcher-1 --team-name standby-team --agent-color green --parent-session-id <session-id> --agent-type general-purpose --dangerously-skip-permissions --model opus

The correct command should invoke claude from PATH:

cd /Users/gaganpulse && claude env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 /Users/gaganpulse/.nvm/versions/node/v22.22.0/bin/claude --agent-id researcher-1@standby-team --agent-name researcher-1 --team-name standby-team --agent-color green --parent-session-id <session-id> --agent-type general-purpose --dangerously-skip-permissions --model opus

Steps to Reproduce

  1. Start Claude Code CLI v2.1.76
  2. Use TeamCreate to create a team
  3. Spawn a teammate using the Agent tool with team_name parameter
  4. Observe the tmux pane opens but the teammate process exits immediately

Expected Behavior

The teammate process should stay alive in the tmux pane and be responsive to messages via SendMessage.

Actual Behavior

The teammate process spawns and immediately exits. The tmux pane shows the command and then returns to the shell prompt.

Environment

  • Claude Code CLI: v2.1.76
  • Node.js: v22.22.0
  • OS: macOS (Darwin 23.5.0)
  • Installation: npm global (@anthropic-ai/claude-code)

Workaround

Use the Agent tool with run_in_background: true instead of TeamCreate to spawn parallel workers. This works correctly but routes all communication through the team lead rather than allowing direct interaction with teammates.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗