Agent Teams: tmux-spawned teammates exit immediately — stdin not piped
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
- Enable agent teams:
``json``
// ~/.claude/settings.json
{
"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" },
"teammateMode": "tmux"
}
- In a Claude Code session:
- Use
TeamCreateto create a team - Use
Agentwithteam_nameandnameto spawn a teammate - The teammate's tmux pane launches the CLI and immediately exits to shell prompt
- 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
```
- 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:
- Pipe the mailbox message (
~/.claude/teams/{team}/inboxes/{agent}.json) to the CLI's stdin - Or pass the initial prompt as a
--printargument - Or the CLI should detect
--agent-id/--team-nameflags 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
teammateModefrom settings doesn't help — tmux appears to be the only mode - The
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1env var is set
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗