Agent teams: tmux-spawned teammates fail to recognize teammate context (v2.1.32)
Bug Description
When using agent teams with the tmux backend, spawned teammates fail to recognize themselves as teammates during initialization. They start Claude Code correctly with all internal flags (--agent-id, --team-name, --agent-color, etc.) and display "Claude Team" in the banner, but fall through to the regular interactive REPL instead of processing their mailbox.
Environment
- Claude Code version: 2.1.32
- OS: Linux 6.6.87.2-microsoft-standard-WSL2 (Ubuntu on WSL2)
- tmux version: 3.6a
- Node/Runtime: Bun (bundled)
- teammateMode:
auto(default — detects tmux, uses split-pane backend)
Steps to Reproduce
- Enable agent teams:
``json``
// ~/.claude/settings.json
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } }
- Start Claude Code inside a tmux session
- Ask Claude to create a team and spawn teammates (or use the Teammate/Task tools programmatically)
- Observe the spawned teammate's tmux pane
Expected Behavior
The teammate should:
- Recognize itself as a teammate from the
--agent-id/--team-nameflags - Read its mailbox/inbox automatically
- Process the spawn prompt from the team lead
- Begin working on assigned tasks
Actual Behavior
The teammate:
- Starts Claude Code with correct flags and shows "Claude Team" in the banner
- Fails to set teammate context during initialization
- Mounts the interactive REPL as a normal session (
REPL mounted, disabled=false) - Sits at the
❯prompt indefinitely without reading the mailbox - Inbox messages remain
"read": falseforever
Debug Log Evidence
From the teammate's debug log (~/.claude/debug/{session-id}.txt):
[Reconnection] computeInitialTeamContext: No teammate context set (not a teammate)
This line shows the process does NOT recognize itself as a teammate, despite receiving --agent-id scout@test-v2 --team-name test-v2 on the command line.
Shortly after:
[ERROR] Error: getTeammateModeFromSnapshot called before capture - this indicates an initialization bug
An initialization ordering bug where the teammate mode is queried before the snapshot is captured.
Then:
[TeammateModeSnapshot] Captured from config: auto
[BackendRegistry] isInProcessEnabled: false (mode=auto, insideTmux=true)
[REPL:mount] REPL mounted, disabled=false
The system correctly detects tmux and selects split-pane mode, but since the teammate context was never set, the REPL mounts as a regular interactive session.
Additional Context
- The team lead's mailbox polling works correctly (1s interval, reads from
~/.claude/teams/{team}/inboxes/team-lead.json) - The team config (
~/.claude/teams/{team}/config.json) is written correctly with all member details includingtmuxPaneIdandbackendType: "tmux" - The inbox files for teammates are written correctly with the spawn prompt
- The spawned tmux command includes all expected internal flags:
````
CLAUDECODE=1 /path/to/2.1.32 --agent-id scout@test-v2 --agent-name scout --team-name test-v2 --agent-color blue --parent-session-id {uuid} --agent-type general-purpose --model haiku
- Tested with both
Exploreandgeneral-purposeagent types — same result teammateModeis documented at https://code.claude.com/docs/en/agent-teams but is rejected by the settings.json schema validator as "Unrecognized field"--teammate-modeflag is documented but does not appear in--helpoutput
Workaround
None found. The in-process mode cannot be configured because:
teammateModeis rejected by the settings schema--teammate-modeis not recognized by the CLI
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗