[FEATURE] Add Windows Terminal as a split-pane backend for agent teams (teammateMode)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Windows Terminal users cannot use split-pane mode for agent teams. The current teammateMode setting only supports tmux and iTerm2 as backends. Windows Terminal users are forced to either:
- Use in-process mode — losing all multi-pane visibility benefits
- Install WSL + tmux — adding an entire Linux subsystem just for pane splitting
- Use workaround scripts that attempt to bridge the gap via hooks (fragile, unsupported)
Proposed Solution
Add "windows-terminal" as a valid teammateMode backend, with auto-detection support.
Detection
Windows Terminal sets the WT_SESSION environment variable when running inside it:
// Detection: check for WT_SESSION env var
if (process.env.WT_SESSION) {
// Running inside Windows Terminal
}
Additionally, wt.exe is available on PATH when Windows Terminal is installed, which can be checked as a fallback.
CLI Command Mapping
Windows Terminal's wt.exe CLI provides direct equivalents for all operations the tmux backend needs:
| Operation | tmux | Windows Terminal (wt.exe) |
|-----------|------|-----------------------------|
| Split vertically (side by side) | tmux split-window -h -- cmd | wt -w 0 split-pane -V -- cmd |
| Split horizontally (top/bottom) | tmux split-window -v -- cmd | wt -w 0 split-pane -H -- cmd |
| Set working directory | -c /path | -d /path |
| Set pane title | N/A (via printf) | --title "Agent Name" |
| Control pane size | N/A | -s 0.5 (50% of parent) |
| Target current window | Implicit (via $TMUX) | -w 0 (current window) |
| Pass environment vars | env VAR=val cmd | Set before wt invocation or via cmd /c "set VAR=val && cmd" |
Spawning a Teammate Pane
wt -w 0 split-pane -V -d "C:\project" --title "researcher" -- cmd /c "set CLAUDE_CODE_TEAM_NAME=my-team && set CLAUDE_CODE_AGENT_NAME=researcher && claude"
Or via PowerShell:
wt -w 0 split-pane -V -d "C:\project" --title "researcher" -- powershell.exe -Command {
$env:CLAUDE_CODE_TEAM_NAME = 'my-team'
$env:CLAUDE_CODE_AGENT_NAME = 'researcher'
claude
}
Auto-Detection Priority
Update the auto-detection chain:
Current: iTerm2 → tmux → in-process
Proposed: iTerm2 → tmux → windows-terminal → in-process
// Pseudocode for auto-detection
if (process.env.ITERM_SESSION_ID) return 'iterm2';
if (process.env.TMUX) return 'tmux';
if (process.env.WT_SESSION) return 'windows-terminal'; // NEW
return 'in-process';
Known Limitations
Windows Terminal's CLI has some gaps compared to tmux:
| Capability | tmux | Windows Terminal | Workaround |
| List panes | tmux list-panes | No equivalent | Track internally |
| Get pane ID | #{pane_id} | No env var | Use title-based tracking |
| Focus specific pane | tmux select-pane -t N | wt -w 0 move-focus --direction {up\|down\|left\|right} | Direction-based navigation |
| Send keys to pane | tmux send-keys | No equivalent | Use file-based IPC (inbox files) |
The lack of pane IDs means the backend would need to track panes internally (e.g., by title or creation order) rather than using terminal-native IDs. This is the same challenge WezTerm faces and is solvable with an internal mapping table.
Alternative Solutions
- WSL + tmux: Works but requires installing an entire Linux subsystem — heavyweight and unnecessary given WT's native CLI
- In-process mode: Functional but loses the primary benefit of agent teams: visual parallel work observation
- Hooks-based workarounds: I built a working prototype using PowerShell scripts +
wt split-panethat creates proper split panes, but it cannot integrate with the native spawn backend because hooks can only block/allow tool calls, not redirect the spawn mechanism. A native backend is needed.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
As a Windows developer using Claude Code agent teams, I want each teammate to appear in its own Windows Terminal split pane so I can observe all agents working simultaneously — the same experience macOS/Linux users get with tmux.
Additional Context
Environment
- Claude Code version: 2.1.x (Opus 4.6)
- OS: Windows 11
- Terminal: Windows Terminal (default)
- Shell: PowerShell / cmd.exe
Related Issues
- #23574 — WezTerm split-pane backend (same motivation, different terminal)
- #24122 — Zellij split-pane support
- #24189 — Ghostty split-pane support (blocked on upstream API)
- #23572 — tmux/iTerm2 silent fallback bug
- #5723 — General Windows Terminal support (closed as duplicate of broader Windows issues — this issue is specifically about agent teams
teammateMode)
Additional Context
Working Prototype
I have built a working prototype of this integration using PowerShell scripts that:
- Launch a lead agent in the current WT pane
- Use
wt -w 0 split-paneto create teammate panes - Bridge to the native team protocol via environment variables (
CLAUDE_CODE_TEAM_NAME,CLAUDE_CODE_AGENT_ID,CLAUDE_CODE_AGENT_NAME) - Register agents in
~/.claude/teams/{team}/config.json
The scripts work end-to-end when invoked manually, but cannot integrate with the internal Task tool's spawn mechanism because there is no hookable backend interface. A native windows-terminal backend would solve this cleanly.
Disclosure: AI-Assisted Issue
This issue was drafted by Claude Code (Opus 4.6) during an agent teams session where I was researching how to make the teams feature work with Windows Terminal split panes. The research, CLI command mapping, and technical analysis were produced by Claude Code's experimental agent teams feature — which, ironically, is the feature this issue is requesting better support for.
I was unable to find an explicit policy in this repository regarding AI-generated issues (there is no CONTRIBUTING.md or issue policy document). If AI-generated issues are not welcome here, I understand and apologize. However, I want to submit this regardless because:
- This is a real problem faced by a real user. I (the human filing this issue) actively tried to build a Windows Terminal integration for agent teams and hit the fundamental limitation described above.
- I have reviewed and verified the content. I read the full draft, confirmed the technical details (CLI commands, env vars, limitations), and vouch for its accuracy based on my own experimentation.
- The prototype scripts exist and work. The gap described (no hookable backend interface) is something I encountered firsthand, not a hypothetical.
The human author (which is me and I don't know how to confirm that this is actually a human typing so im just typing this to show that I am human since no AI would just ramble about nothing when trying to confirm its humanity like I am doing now (or would it?) ) reviewed and approved this issue before submission.
13 Comments
+1 for this... i think this would be very helpful for Windows users
+1 because it is almost impossible to use Agent Team otherwise.
Feel free to read this page : https://learn.microsoft.com/en-us/windows/terminal/panes
Regards
+1 for this and very helpful feature for windows users
+1 for this - I like to see what's going on in the agents
Native Windows solution found: psmux + compatibility shim
This issue requests Windows Terminal support for agent team split panes. While that would be ideal, I wanted to share a working alternative that I got running today on native Windows — without WSL.
What works
psmux is a Rust-based native Windows tmux clone. It sets
$TMUXinside its panes, so Claude Code detects it as tmux. With a thin compatibility shim, full split-pane agent teams work on Windows:Three incompatibilities fixed by the shim
| Issue | Symptom | Fix |
|-------|---------|-----|
|
tmux -Vlaunches psmux TUI | Claude Code hangs on startup | Shim returns"tmux 3.4"instantly || Format vars (
#{window_panes}etc.) return empty inside panes | "Could not determine pane count" | Shim intercepts and returns correct values || psmux session must be named
default| IPC fails for other session names | Name the sessiondefault|Shim (bash, for Git Bash / MSYS2)
A
tmux.cmdversion for PowerShell/CMD is also needed since PowerShell can't execute bash shebangs.Full details
Suggestions for Claude Code
if (process.env.PSMUX_SESSION) return 'psmux'— once psmux sets its own env vartmux -V: If version check takes >2s, fall back to in-process mode gracefully instead of hangingThis was tested on Windows 11 with psmux v0.3.9 and Claude Code v2.1.50. To my knowledge, this is the first native Windows (non-WSL) agent team split-pane solution.
Follow-up: Testing Complete — 3 teammates spawned successfully on Windows via psmux
Continuing from my earlier comment.
After additional debugging, all 3 shim issues are now resolved and 3 teammates spawn and complete tasks successfully on native Windows (no WSL).
What was fixed in the shim
| Bug | Root cause | Fix |
|-----|------------|-----|
|
split-windowcrashed psmux TUI |psmux %*caused CMD to re-expand%1(pane ID literal) as batch arg 1, giving psmux-t split-window(invalid target) | Use positional args%~3+default:session prefix ||
send-keys/kill-panefailed withno server running on session ''| psmux can't resolve bare pane IDs (%2) without session context | Rewrite-t %N→-t default:%N||
split-windowstdout lost | Redirecting all output to log prevented Claude Code from reading the new pane ID | Redirect only stderr (2>> log) |New finding: only 1 split pane created for all teammates
During testing I observed that Claude Code calls
split-windowonly once regardless of the number of teammates requested. All teammates share a single right-side pane and run sequentially:Request: Could Claude Code call
split-windowonce per teammate rather than once for all teammates? This would allow users to monitor all agents simultaneously — which is the primary visual benefit of split-pane mode.Verified with: Windows 11, psmux v0.3.9, Claude Code v2.1.50, Opus 4.6, 3 teammates.
Shim source: https://github.com/gonnector/claude-psmux-team
+1 this would be extremely useful for developers on Windows
psmux maintainer here -- wanted to provide an update since @gonnector's excellent shim work was done against v0.3.9.
psmux is now at v0.4.10 (releases) and several of the incompatibilities that required the shim have been fixed upstream:
What changed since v0.3.9
| Issue | Status | Details |
|-------|--------|---------|
|
tmux -Vlaunched TUI instead of printing version | Fixed (closed #42) |psmux -V/tmux -Vnow prints version string and exits || Format variables returned empty | Improved | 126+ format variables supported (
#{pane_id},#{window_panes},#{session_name}, etc.) ||
capture-pane -p| Supported | Full pane content capture ||
send-keys| Supported | Including-t session:window.panetargeting ||
list-panes -F| Supported | Format string output ||
split-window| Supported | Both-h(horizontal) and-v(vertical) ||
display-message -pwith format vars | Supported | Resolves format variables and prints to stdout |Current state of Claude Code agent teams on Windows
With psmux v0.4.10, the shim may be significantly simpler or possibly unnecessary for basic agent team functionality. psmux sets
$env:TMUXinside its panes, so Claude Code's tmux auto-detection works.The remaining gap for full parity is mostly on the Claude Code side:
tmux -Vever hangs (shouldn't with v0.4.10, but a timeout fallback would be defensive)psmuxas a first-class detection target --if (process.env.PSMUX_SESSION) return 'psmux'alongside the existing tmux/iTerm2 detectionInstall
Also available via
cargo install psmux, Scoop, and Chocolatey. Shipspsmux.exe,pmux.exe, andtmux.exealiases.For Claude Code team
Adding psmux detection would be a small change. psmux sets these env vars inside its sessions:
TMUX-- already detected by your tmux backendPSMUX_SESSION-- psmux-specific, could be used for explicit detectionTMUX_PANE-- pane ID, same as tmuxSince psmux speaks the tmux command protocol, the existing tmux backend code should work with little to no modification. The 76 implemented commands cover the subset Claude Code uses (
new-session,split-window,send-keys,list-panes,kill-pane,display-message,-V).v0.4.10 Test Results & Remaining Gaps
Following up on @marlocarlo's update — I tested psmux v0.4.10 with Claude Code v2.1.71 on native Windows (Git Bash / MSYS2, no WSL).
What works natively
All 5 tmux commands that previously required the full shim now work without modification:
| Command | Result |
|---------|--------|
|
tmux -V| Prints version and exits (no TUI) ||
display-message -p '#{session_name}'| Returnsdefault||
list-panes -F '#{pane_id}'| Returns%1||
split-window -h -l 70% -P -F '#{pane_id}'| Returns%2(split created) ||
send-keys -t %2 "echo test" Enter| Command delivered to pane |Remaining issues found
1.
tmux -Vreturns"tmux 0.4.10"— fails Claude Code's version checkClaude Code parses the version from
tmux -Vand requires >= 2.0. psmux reports"tmux 0.4.10"which parses as0.4, causing silent fallback to in-process (Agent) mode instead of split-pane (Teammate) mode.Workaround: A compiled C shim (122KB
.exe) intercepts-V→"tmux 3.4", passes everything else totmux-real.exe.Suggested psmux fix: Report a tmux-compatible version, e.g.
"tmux 3.4-psmux0.4.10".2. Node.js
spawnonly finds.exefiles on WindowsClaude Code uses Node.js
child_process.spawn('tmux', ...)which on Windows callsCreateProcess— this only resolves.exe/.comfiles. Script-based shims (.cmd, bash) are invisible. The version-spoof shim must be a compiled.exe.3.
TMUXenvironment variable not detected in Git Bash sessions@marlocarlo mentioned psmux sets
$env:TMUXinside its panes. In my testing with Git Bash (MSYS2/MinGW64),process.env.TMUXwas empty. This may be PowerShell-specific. Without it, Claude Code operates in "external session mode" — which still works, but uses a separate tmux socket (-Lflag) instead of the existing session.With
--teammate-mode tmux, this is not a blocker since Claude Code bypasses the env check and goes directly to tmux backend. But inautomode, tmux won't be auto-detected.Claude Code internal flow (from binary analysis)
For the Claude Code team's reference, the backend selection logic (decompiled from v2.1.71):
Both paths lead to the tmux backend, but native mode uses the existing session while external mode creates its own. The version check happens at a higher level — if
tmux -Vexits with code 0, it passes, but if the reported version < 2.0, split-pane is disabled elsewhere.Updated repo
All findings, the compiled shim, and updated documentation are at:
https://github.com/gonnector/claude-psmux-team
Suggestion for Claude Code team
A small version-check change would eliminate the need for any shim:
Or even better: add psmux as a first-class backend (as @marlocarlo suggested), checking
process.env.PSMUX_SESSION.Update: Tested the full flow — individual tmux commands (
split-window,send-keys,list-panes, etc.) all work through the compiled shim, but teammate split-pane does not appear in the actual psmux session when runningclaude --teammate-mode tmux.Likely cause: psmux does not set the
TMUXenvironment variable in Git Bash (MSYS2) sessions, so Claude Code falls into "external session mode" — creating panes in a separate tmux context instead of splitting the current visible pane. A Claude Code-side change (e.g., detectingPSMUX_SESSIONor forcing native mode with--teammate-mode tmux) would likely resolve this.PSMUX calls set_tmux_env() which sets TMUX, TMUX_PANE, and PSMUX_SESSION regardless of shell type
(pwsh, cmd, or bash). Perhaps the core issue to be solved is this https://github.com/anthropics/claude-code/issues/26244 ?
Same situation as #23574 (WezTerm request) — until Windows Terminal is officially supported as a split-pane backend:
Workaround 1 — Use tmux via WSL:
If you're running Claude Code in WSL:
tmux works inside Windows Terminal (via WSL) and provides the split-pane functionality for agent teams.
Workaround 2 — Windows Terminal native splits + multiple instances:
Windows Terminal supports splits natively:
Alt+Shift+D— duplicate pane (split)Alt+Shift+-— horizontal splitAlt+Shift+=— vertical splitRun
claudein each split for multiple simultaneous sessions. Not automated like agent teams, but functional.Workaround 3 — Use the VS Code extension:
The VS Code extension handles agent teams through its own pane management, independent of the terminal backend. If agent teams are your priority, the VS Code extension may be the most reliable option on Windows.
as @gonnector mentioned,
--teammate-mode tmuxworks on Windows via Psmux.However, we need support for git worktrees. We have made Psmux so modern apps like Claude Code can work on Windows natively without using WSL or Linux as a workaround. Pretty much everything else works except whatever is hardcoded in claude code source to detect windows and block it.