[BUG] Agent teams crash on spawn with --model opus teammates (2.1.119, Bun stack trace)
What's Wrong?
Agent teams crash at spawn when teammates are assigned --model opus. The tmux panes get created and the claude launch command is typed in, but every spawned claude process exits immediately inside the Bun-bundled CLI. The team appears spawned (TeamCreate returns success, panes exist, swarm view shows N teammates), but no teammate ever runs a tool.
Symptoms (5/5 teammates affected in my repro):
- 0 tokens used per teammate
- 0 tool calls
- TaskList empty
- watchdog-status.md never written
- Inbox messages queued unread in
~/.claude/teams/<name>/inboxes/*.json - Pane scrollback shows a Bun stack trace from
/$bunfs/root/src/entrypoints/cli.js
Workaround that works: spawn teammates with --model sonnet (or --model haiku for cheap monitors). Orchestrator stays on Opus. Mixed-model teams spawn and run to completion.
Ruled out:
- Solo
--model opussessions work fine — this is/team-specific - Sonnet/Haiku teammates work fine
brew upgrade claude-codeconfirms 2.1.119 is the latest available
Suspected trigger: --model opus + CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 on 2.1.119.
What Should Happen?
Spawned teammates with --model opus should boot the same way Sonnet/Haiku teammates do: process stays alive, registers with the orchestrator, begins consuming inbox messages, emits tool calls. TaskList should report the teammate as running, and tokens/tool-use counters should advance within the normal 30–90s startup window.
Error Messages / Logs
Bun-bundled CLI stack trace visible in tmux pane scrollback (minified frame names):
createInst → PL → LYH → rZH → RD6 → iZH → jM_ → aH → LH → FH
at /$bunfs/root/src/entrypoints/cli.js
Captured via:
tmux -L claude-swarm-<pid> capture-pane -t %<n> -p -S -2000
Happy to attach the full unminified scrollback if it helps narrow it down.
Steps to Reproduce
- Open a fresh Claude Code session:
claude - Switch orchestrator to Opus:
/model opus - Trigger an agent team with 4–5 teammates, at least one on Opus:
/team "investigate <any task>"
(Or directly: a create an agent team with N teammates: directive where one or more teammate lines specify Opus.)
- Wait 60–90 seconds.
Expected: teammates start emitting tool calls, TaskList populates, tokens advance.
Actual: TaskList stays empty, every teammate at 0 tokens / 0 tool uses indefinitely.
To confirm crash (not just slow startup):
tmux -L claude-swarm-<pid> list-panes -F '#{pane_id} #{pane_current_command}'
The panes show zsh (process exited) instead of claude (still running).
Recovery: tmux -L claude-swarm-<pid> kill-server, then respawn with Sonnet/Haiku teammates only.
Environment
- Claude Code Version: 2.1.119 (current latest per
brew upgrade claude-code) - Model: Opus 4.7 (1M context) orchestrator + Opus teammates triggers crash
- OS: macOS Darwin 24.6.0
- Shell: zsh
- Setup: agent-teams enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1), custom/teamslash command spawning 3–5 teammates from personas - Regression: unknown — first time using
/teamwith Opus teammates on 2.1.119
Additional Information
Crash reproduces consistently when any teammate line specifies Opus, regardless of persona/role/prompt content. Happy to provide minimal repro spawn config, full pane scrollback, or run additional diagnostics.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗