Agent teams: tmux-spawned teammates fail to recognize teammate context (v2.1.32)

Resolved 💬 4 comments Opened Feb 6, 2026 by moliendocode Closed Feb 6, 2026

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

  1. Enable agent teams:

``json
// ~/.claude/settings.json
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } }
``

  1. Start Claude Code inside a tmux session
  2. Ask Claude to create a team and spawn teammates (or use the Teammate/Task tools programmatically)
  3. Observe the spawned teammate's tmux pane

Expected Behavior

The teammate should:

  1. Recognize itself as a teammate from the --agent-id / --team-name flags
  2. Read its mailbox/inbox automatically
  3. Process the spawn prompt from the team lead
  4. Begin working on assigned tasks

Actual Behavior

The teammate:

  1. Starts Claude Code with correct flags and shows "Claude Team" in the banner
  2. Fails to set teammate context during initialization
  3. Mounts the interactive REPL as a normal session (REPL mounted, disabled=false)
  4. Sits at the prompt indefinitely without reading the mailbox
  5. Inbox messages remain "read": false forever

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 including tmuxPaneId and backendType: "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 Explore and general-purpose agent types — same result
  • teammateMode is documented at https://code.claude.com/docs/en/agent-teams but is rejected by the settings.json schema validator as "Unrecognized field"
  • --teammate-mode flag is documented but does not appear in --help output

Workaround

None found. The in-process mode cannot be configured because:

  1. teammateMode is rejected by the settings schema
  2. --teammate-mode is not recognized by the CLI

View original on GitHub ↗

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