[BUG] Agent Teams: tmux teammate pane dies instantly under Nushell login shell (hardcoded POSIX && in spawn command)
Bug Description
Agent Teams (tmux-backed teammates) fail to spawn when the user's login shell is Nushell. The teammate pane exits immediately with Pane is dead (status 1), and the teammate produces zero output and never responds to SendMessage — it just appears to hang indefinitely.
Root cause
The tmux pane spawn command is hardcoded as POSIX shell syntax:
cd <worktree> && env CLAUDECODE=1 ... claude --agent-id ...
tmux launches this line using the user's login shell (from /etc/passwd, not $SHELL/defaultShell config). Nushell does not support && as a command separator (nu::parser::shell_andand), so the pane's shell fails to parse the line at all and exits with status 1 before claude ever starts. There's no error surfaced to the user beyond a dead pane — the teammate just looks stuck forever.
This is distinct from #7490 (Bash tool should respect the launched shell) — that's about the in-session Bash tool's shell selection. This bug is in the teammate/pane spawn mechanism itself, which shells out using the OS login shell regardless of $SHELL or any in-app shell configuration, so fixing #7490 would not fix this.
Steps to reproduce
- Set login shell to
nu(Nushell) viachsh(or/etc/passwd). - Launch Claude Code, start a multi-agent/Agent Teams task that spawns a tmux teammate pane.
- Observe: the pane opens then immediately shows
Pane is dead (status 1); the teammate never starts and never answers messages.
Expected behavior
The spawn command should run in a POSIX-compatible shell regardless of the user's login shell — e.g. invoke via sh -c "cd <dir> && env ... claude --agent-id ..." instead of relying on the login shell to interpret POSIX syntax.
Workaround
- Launch Claude Code with
SHELL=/bin/bash claudeso tmux uses bash for the pane. - Or set
default-shell /bin/bashin tmux config for the swarm socket. - Or avoid tmux-backed teammates entirely and use background
Agentcalls (run_in_background: true), which don't go through tmux and are unaffected.
Environment Info
- Platform: Linux (Arch-based, kernel 7.1.2-zen1)
- Login shell: Nushell (
/usr/bin/nu, per/etc/passwd) - Terminal: kitty
- Claude Code version: 2.1.197
- Multiplexer: tmux (
tmux -L claude-swarm-*socket), tmux.conf otherwise unrelated (cosmetic-only errors from a custom theme, not the cause of the pane death)