[BUG] Agent teams: iTerm2 split-pane mode spawns in-process teammates despite correct configuration
Status Fixed / completed
Reported on v2.1.34
Maintainer reply None cached
Activity 15 comments · opened Feb 6, 2026 · closed Mar 18, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using agent teams with teammateMode: "tmux" in iTerm2, teammates are spawned in-process instead of in split panes, even though all documented requirements are met.
Environment
- OS: macOS (Darwin 25.2.0)
- Terminal: iTerm2 (confirmed via TERM_PROGRAM=iTerm.app)
- it2 CLI: mkusaka/it2 v0.2.0 (installed at ~/.local/bin/it2)
- iTerm2 Python API: Enabled in Settings → General → Magic
- ITERM_SESSION_ID: Present and valid
Configuration
// settings.json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"teammateMode": "tmux"
}
Teammates report:
- TTY: not a tty (running as subprocess)
- TMUX: not set
- No split panes created
What Should Happen?
Teammates should appear in separate iTerm2 split panes, as documented at https://code.claude.com/docs/en/agent-teams#choose-a-display-mode
Error Messages/Logs
Steps to Reproduce
- Enable agent teams via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
- Set teammateMode: "tmux" in settings.json
- Install it2 CLI from https://github.com/mkusaka/it2 (as linked in docs)
- Enable Python API in iTerm2 preferences
- Start Claude Code in iTerm2
- Create an agent team and spawn teammates
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.34 (Claude Code)
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
15 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I don't believe this is a duplicate of that issue because I have the latest version of it2 installed which includes a fix for the it2 shortcuts referenced by the other issue.
I also have this issue.
also have this issue
I tried setting from settings
"teammateMode": "tmux", but didn't work. Once I used the cli flag--teammate-mode tmux, it worked. So, something about the default auto mode or reading the settings is faultyI just tested this and it is true.
Worked for me as well, but only for the first time the agents are spawned in a session.
After that, I have to restart the Claude Code process to get it working again
it is also true for tmux when setting to in-process. i suspect the setting is not being honored.
setting in-process in a tmux terminal still shows the split panels
Having the same problem in WSL on ubuntu using tmux (not it2). I believe the way cli.js is written has a bug where teammateMode is only in the global settings schema, but is trying to get the value from the project schema, so no matter where you set it, it reads it as undefined, which converts it to 'auto'
I traced through the minified source and found the root cause of this — filed with details in #25772.
TL;DR:
isInProcessEnabled()runs beforedetectAndGetBackend()and short-circuits to in-process. Its"auto"branch is justreturn !insideTmux()— no iTerm2 check. So if you're in iTerm2 without tmux, it always returnstrueand the fully-implementedITermBackendnever gets a chance to run.The fix is a one-liner:
return !insideTmux() && !isInITerm2().Root cause identified via debug logging (v2.1.74)
Futzed around this for half a day, and Claude seems confident after a ton of debugging that this is the root cause.
Traced it through the minified source. The bug is in the
isInProcessEnabledfunction (minified asHx()in v2.1.74):The
elsebranch handles everything that isn't"in-process"or"tmux"— including"iterm2"and"auto". It returns!isInsideTmux(), which istruewhen you're outside tmux. So both"iterm2"and"auto"mode fall through to theelseand always get treated as in-process when not inside tmux.The full backend detection in
ne()(which correctly detects iTerm2, checks forit2CLI, etc.) is never reached becauseisInProcessEnabledshort-circuits before it.Additional finding:
settings.jsonvs.claude.jsonteammateModehassource: "global"in the settings schema, which means it's read from~/.claude.json(the global state file), not~/.claude/settings.json. Setting it insettings.jsonhas no effect — the config is silently ignored and defaults to"auto". This is confusing since the original issue author and others (including me) naturally put it insettings.json.Debug log evidence
With
--debug-fileenabled, every check shows:The backend detection logs (
[BackendRegistry] Starting backend detection...,iTerm2 detected, it2 CLI available: true, etc.) never appear becauseisInProcessEnabledgates them.Environment
it2CLI working (it2 session split -vworks,it2 session listworks)ITERM_SESSION_IDandTERM_PROGRAM=iTerm.appboth setSuggested fix
The
isInProcessEnabledfunction needs to returnfalsefor"iterm2"mode, and for"auto"mode it should actually run the backend detection rather than defaulting to in-process:This is fixed as of v2.1.77. Confirmed working — iTerm2 split panes now activate correctly without tmux.
The root cause was in
isInProcessEnabled(): the"auto"branch only checkedinsideTmux()and had no awareness of iTerm2, so it always fell back to in-process mode beforedetectAndGetBackend()(which correctly detects iTerm2 +it2CLI) was ever called.The fix: the
autobranch now checks bothinsideTmux()ANDinITerm2()before falling back to in-process.See #25772 for the full root cause analysis. Can this be closed?
Not OP, but I'd say yes, your analysis supports mine and I do see it working now. (I also see a followup bug, but I'll report that separately) @w4sspr
It's working for me as of now, thanks everyone
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.