[BUG] Agent Teams: Teammates fail to spawn with "Input must be provided either through stdin or as a prompt argument when using --print"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using Agent Teams (via TeamCreate + Task with team_name), spawned teammates immediately crash with:
Error: Input must be provided either through stdin or as a prompt argument when using --print
This happens in both teammateMode: "auto" (tmux split-pane) and teammateMode: "in-process" modes. The teammate subprocess starts but never receives the initial prompt.
The spawned command looks like this:
env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/Users/user/.local/share/claude/versions/2.1.62 \
--agent-id cases-researcher@team-name \
--agent-name cases-researcher \
--team-name team-name \
--agent-color green \
--parent-session-id <session-id> \
--agent-type general-purpose \
--model claude-opus-4-6
The --agent-* flags appear to internally trigger --print mode, which requires input via stdin or as a prompt argument. However, the spawning mechanism doesn't pipe the prompt to stdin, causing the immediate failure.
Note: Regular subagents (Task tool without team_name) work correctly. Only teammate spawning is affected.
What Should Happen?
Teammates should spawn successfully and receive their initial prompt, either via stdin pipe or the mailbox system, and begin working on assigned tasks.
Error Messages/Logs
➜ ~ cd /Users/user && env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/Users/user/.local/share/claude/versions/2.1.62 \
--agent-id cases-researcher@team-name \
--agent-name cases-researcher \
--team-name team-name \
--agent-color green \
--parent-session-id <session-id> \
--agent-type general-purpose \
--model claude-opus-4-6
Error: Input must be provided either through stdin or as a prompt argument when using --print
➜ ~
Steps to Reproduce
- Enable agent teams:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
- Start Claude Code inside tmux (or set
"teammateMode": "in-process")
- Use
TeamCreateto create a team
- Use
Tasktool withteam_nameparameter to spawn a teammate
- Observe the teammate process crashes immediately with the error above
Tested with both:
teammateMode: "auto"(inside tmux) → errorteammateMode: "in-process"→ same error
Environment
- Claude Code Version: 2.1.62
- OS: macOS (Darwin 24.0.0, arm64, Apple Silicon M1)
- Terminal: tmux 3.6a
- Model: claude-opus-4-6
- Shell: zsh
Is this a regression?
I don't know — this is my first attempt using Agent Teams on v2.1.62.
Related Issues
- #25131 — Catastrophic agent lifecycle failures
- #24989 — Team feature hardcodes claude as subprocess binary
- #23572 — teammateMode: "tmux" silently falls back to in-process
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗