[BUG] Agent Teams: tmux/auto teammates crash on spawn — non-TTY stdin triggers --print with no prompt (2.1.195)

Open 💬 4 comments Opened Jun 29, 2026 by noamsto

Summary

With teammateMode: "tmux" (or "auto" inside tmux), every spawned teammate dies on launch with:

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

The tmux pane exits with status 1 and shows "Pane is dead". The teammate never starts.

The root cause is that the teammate subprocess is launched with a non-TTY stdin. Claude Code treats a non-TTY stdin as headless/--print mode, but the spawn path does not feed the teammate's initial prompt on that channel — so it reaches --print with neither stdin input nor a prompt argument, and aborts.

This is not specific to my setup: the existing report chain includes a Vertex AI backend variant with no tmux/wrapper involved (#27729). Those reports — #27729 → #29293 → #58724 — were each auto-closed as duplicates by the triage bot and locked, and no fix ever shipped. It still reproduces on the latest release.

Environment

  • Claude Code 2.1.195
  • OS: NixOS (Linux), tmux as the terminal multiplexer
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • teammateMode: "auto" (tmux present, so the split-pane backend is selected)

Reproduction

  1. CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, teammateMode: "auto" (or "tmux"), inside a tmux session.
  2. Ask Claude to spawn any named teammate (Agent tool with a name).
  3. A new tmux pane opens, then immediately dies: "Pane is dead (status 1)".
  4. Capturing the dead pane's scrollback shows the --print error above.

Decisive isolation (stdin TTY is the only variable)

I captured the exact command Claude ran for the pane (tmux pane_start_command) and replayed it three ways. Only stdin differs:

| How the identical command was run | stdin | Result |
|---|---|---|
| Under a real PTY (script -qec '<cmd>' /dev/null) | TTY | ✅ Teammate TUI boots normally and runs |
| <cmd> </dev/null | not a TTY | ❌ Error: Input must be provided … --print, exit 1 |
| The real teammate pane Claude spawned | (effectively non-TTY) | ❌ same error, exit 1, dead pane |

The launch line itself is correct (right binary, flags, --model, settings) — it succeeds the moment stdin is a TTY. So the bug is that the tmux/auto spawn backend gives the teammate a non-TTY stdin (and/or fails to pass the initial prompt on the channel it expects).

Expected

A teammate spawned in tmux/auto mode starts interactively in its pane and receives its initial task (via the mailbox / prompt), the same way it does in in-process mode.

Actual

The teammate process enters --print mode due to non-TTY stdin, finds no prompt, and exits 1 — leaving a dead pane. Team work is impossible in split-pane mode.

Workaround

Set teammateMode: "in-process" (also the default since 2.1.179). Teammates then run in the main session and work correctly — at the cost of split-pane visibility.

Note for triage

Please do not auto-close this as a duplicate of #27729 / #29293 / #58724 — those are the same unresolved bug, were closed by the dedupe bot without a fix, and are now locked so they can't be reopened. This report adds a minimal stdin-TTY isolation that should make the fix straightforward (allocate a PTY for the teammate pane, or pass the prompt as an argument instead of relying on stdin).

View original on GitHub ↗

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