Agent Teams: tmux-spawned teammates exit immediately — stdin not piped

Resolved 💬 3 comments Opened Mar 6, 2026 by iosnofresco Closed Mar 9, 2026

Description

When using Agent Teams (TeamCreate + Agent with team_name), teammates spawned in tmux panes exit immediately with:

Error: Input must be provided either through stdin or as a prompt argument when using --print

The initial prompt IS written to the teammate's mailbox file (~/.claude/teams/{team}/inboxes/{agent}.json) but the CLI never reads it — it expects stdin input that the tmux pane doesn't provide.

Repro Steps

  1. Enable agent teams:

``json
// ~/.claude/settings.json
{
"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" },
"teammateMode": "tmux"
}
``

  1. In a Claude Code session:
  • Use TeamCreate to create a team
  • Use Agent with team_name and name to spawn a teammate
  • The teammate's tmux pane launches the CLI and immediately exits to shell prompt
  1. Manual reproduction (confirms the error):

```bash
/opt/homebrew/bin/claude \
--agent-id test@test-team \
--agent-name test \
--team-name test-team \
--agent-color blue \
--parent-session-id <session-id> \
--dangerously-skip-permissions \
--model claude-opus-4-6 \
2>/tmp/agent-err.log </dev/null

cat /tmp/agent-err.log
# => Error: Input must be provided either through stdin or as a prompt argument when using --print
```

  1. Piping the prompt via stdin works correctly:

``bash
echo "Count files" | /opt/homebrew/bin/claude \
--agent-id test@test --agent-name test --team-name test \
--parent-session-id <id> --dangerously-skip-permissions \
--model claude-opus-4-6 --print
# => Works fine, produces output
``

Expected Behavior

The tmux spawner should either:

  1. Pipe the mailbox message (~/.claude/teams/{team}/inboxes/{agent}.json) to the CLI's stdin
  2. Or pass the initial prompt as a --print argument
  3. Or the CLI should detect --agent-id/--team-name flags and poll the mailbox for its initial task

Environment

  • Claude Code: v2.1.70 (homebrew) and v2.1.63 (Desktop app) — both affected
  • macOS Darwin 25.2.0
  • tmux installed via homebrew
  • teammateMode: "tmux" in settings (also tested without — defaults to tmux)

Workaround

Plain Agent calls (without team_name) work as subprocesses and are not affected. Only the TeamCreate + named teammate flow is broken.

Additional Context

  • The mailbox file IS correctly created with the initial prompt before the CLI launches
  • Removing teammateMode from settings doesn't help — tmux appears to be the only mode
  • The CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 env var is set

View original on GitHub ↗

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