[BUG] Agent Teams (tmux): teammate spawn fails with "respawn pane failed: fork failed: Device not configured" (ENXIO) on stale pane references

Open 💬 0 comments Opened Jul 14, 2026 by CanicheStudio

Environment

  • Claude Code: 2.1.209
  • OS: macOS 26.5.1 (Darwin 25.5.0)
  • tmux: 3.6b
  • Config: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, "teammateMode": "tmux" in ~/.claude/settings.json

Description

When spawning teammates via the Agent tool in an Agent Teams tmux session, the spawn intermittently fails with:

Failed to send command to pane %2: respawn pane failed: fork failed: Device not configured

(same error for pane %3 on a parallel spawn). ENXIO / "Device not configured" suggests the harness is targeting a pane whose tty is gone.

Reproduction timeline (single session, 2026-07-13)

  1. 18:09 — two teammate spawns: OK.
  2. 20:11 — two teammate spawns: FAILED with the error above, pointing at panes %2/%3. Verified with tmux list-panes -a at 20:12: those pane IDs no longer existed (stale references from earlier in the session).
  3. 21:1x — a new spawn: OK again.

So the failure is intermittent and correlated with stale pane references — the harness appears to reuse recorded pane IDs from teammates whose panes were closed, instead of detecting they're gone and creating a new pane.

Additional observation

The teammates whose spawn "failed" (or whose panes were closed) keep running and still respond via SendMessage even though they have no visible pane in any tmux session — so the agent process outlives its pane, and only the pane re-attach path breaks.

Expected behavior

  • Spawn should validate recorded pane IDs before respawn-pane and fall back to split-window (or a fresh pane) when the target pane no longer exists.

Workaround we use

Don't blind-retry the spawn; reuse the still-alive agents via SendMessage (they work without a visible pane).

Possibly related

  • #25315 (race condition on pane spawn causing silent agent failure)
  • #35424 (tmux panes not opening for Agent Teams)

View original on GitHub ↗