[FEATURE] Add Windows Terminal as a split-pane backend for agent teams (teammateMode)

Status Open
Maintainer reply None cached
Activity 13 comments · opened Feb 9, 2026

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:

  1. Use in-process mode — losing all multi-pane visibility benefits
  2. Install WSL + tmux — adding an entire Linux subsystem just for pane splitting
  3. 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-pane that 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:

  1. Launch a lead agent in the current WT pane
  2. Use wt -w 0 split-pane to create teammate panes
  3. Bridge to the native team protocol via environment variables (CLAUDE_CODE_TEAM_NAME, CLAUDE_CODE_AGENT_ID, CLAUDE_CODE_AGENT_NAME)
  4. 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.

View original on GitHub ↗

13 Comments

armando-herastang · 6 months ago

+1 for this... i think this would be very helpful for Windows users

40tude · 6 months ago

+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

terryjyu · 6 months ago

+1 for this and very helpful feature for windows users

danstoneham · 6 months ago

+1 for this - I like to see what's going on in the agents

gonnector · 6 months ago

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 $TMUX inside its panes, so Claude Code detects it as tmux. With a thin compatibility shim, full split-pane agent teams work on Windows:

psmux session
┌────────────────────────┬─────────────────────────────┐
│ Pane 1  @alpha (Lead)  │ Pane 2  @bravo (Teammate 1) │
│ Claude Code v2.1.50    │ Claude Code v2.1.50          │
├────────────────────────┴─────────────────────────────┤
│ Pane 3  @bravo (Teammate 2)                          │
│ Claude Code v2.1.50                                  │
└──────────────────────────────────────────────────────┘

Three incompatibilities fixed by the shim

| Issue | Symptom | Fix |
|-------|---------|-----|
| tmux -V launches 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 session default |

Shim (bash, for Git Bash / MSYS2)

#!/bin/bash
PSMUX_SESSION="${PSMUX_SESSION_NAME:-default}"
case "$1" in
  -V)
    echo "tmux 3.4"; exit 0 ;;
  display-message)
    # parse -p format arg and return correct value via psmux / env vars
    ...
    exec psmux "$@" ;;
  *)
    exec psmux "$@" ;;
esac

A tmux.cmd version for PowerShell/CMD is also needed since PowerShell can't execute bash shebangs.

Full details

Suggestions for Claude Code

  1. Add psmux detection: if (process.env.PSMUX_SESSION) return 'psmux' — once psmux sets its own env var
  2. Timeout on tmux -V: If version check takes >2s, fall back to in-process mode gracefully instead of hanging
  3. Windows Terminal backend: Still the cleanest long-term solution for Windows users without psmux

This 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.

gonnector · 6 months ago

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-window crashed 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-pane failed with no server running on session '' | psmux can't resolve bare pane IDs (%2) without session context | Rewrite -t %N-t default:%N |
| split-window stdout 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-window only once regardless of the number of teammates requested. All teammates share a single right-side pane and run sequentially:

Current (psmux on Windows, likely also tmux on macOS?):
┌──────────────────────────┬───────────────────────────────┐
│ Pane 1  Lead             │ Pane 2  Teammates (cycling)   │
│ orchestrating            │ @alpha → completes            │
│                          │ @beta  → completes            │
│                          │ @gamma → completes            │
└──────────────────────────┴───────────────────────────────┘

Expected (for true parallel monitoring):
┌──────────┬──────────┬──────────┬──────────┐
│  Lead    │  @alpha  │  @beta   │  @gamma  │
│  Pane 1  │  Pane 2  │  Pane 3  │  Pane 4  │
└──────────┴──────────┴──────────┴──────────┘

Request: Could Claude Code call split-window once 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

kldpeterminkov · 6 months ago

+1 this would be extremely useful for developers on Windows

psmux · 5 months ago

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 -V launched TUI instead of printing version | Fixed (closed #42) | psmux -V / tmux -V now 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.pane targeting |
| list-panes -F | Supported | Format string output |
| split-window | Supported | Both -h (horizontal) and -v (vertical) |
| display-message -p with 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:TMUX inside its panes, so Claude Code's tmux auto-detection works.

The remaining gap for full parity is mostly on the Claude Code side:

  1. Version check timeout -- if tmux -V ever hangs (shouldn't with v0.4.10, but a timeout fallback would be defensive)
  2. psmux as a first-class detection target -- if (process.env.PSMUX_SESSION) return 'psmux' alongside the existing tmux/iTerm2 detection
  3. One pane per teammate -- as @gonnector noted, Claude Code currently reuses a single split pane for all teammates rather than creating one per teammate

Install

winget install psmux

Also available via cargo install psmux, Scoop, and Chocolatey. Ships psmux.exe, pmux.exe, and tmux.exe aliases.

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 backend
  • PSMUX_SESSION -- psmux-specific, could be used for explicit detection
  • TMUX_PANE -- pane ID, same as tmux

Since 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).

gonnector · 5 months ago

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}' | Returns default |
| 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 -V returns "tmux 0.4.10" — fails Claude Code's version check

Claude Code parses the version from tmux -V and requires >= 2.0. psmux reports "tmux 0.4.10" which parses as 0.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 to tmux-real.exe.

Suggested psmux fix: Report a tmux-compatible version, e.g. "tmux 3.4-psmux0.4.10".

2. Node.js spawn only finds .exe files on Windows

Claude Code uses Node.js child_process.spawn('tmux', ...) which on Windows calls CreateProcess — this only resolves .exe/.com files. Script-based shims (.cmd, bash) are invisible. The version-spoof shim must be a compiled .exe.

3. TMUX environment variable not detected in Git Bash sessions

@marlocarlo mentioned psmux sets $env:TMUX inside its panes. In my testing with Git Bash (MSYS2/MinGW64), process.env.TMUX was empty. This may be PowerShell-specific. Without it, Claude Code operates in "external session mode" — which still works, but uses a separate tmux socket (-L flag) 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 in auto mode, 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):

isInProcessEnabled(mode):
  if mode === "tmux"    → false (use split-pane)
  if mode === "auto"    → !process.env.TMUX  (requires TMUX env)
  
detectBackend():
  if process.env.TMUX   → tmux (native mode)
  elif tmux -V succeeds  → tmux (external session mode)
  else                   → error

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 -V exits 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:

- const version = parseFloat(versionString.match(/\d+\.\d+/)?.[0]);
- if (version < 2.0) return false;
+ // Accept psmux (reports "tmux 0.x.y") alongside real tmux (2.0+)
+ const match = versionString.match(/tmux[- ](\d+)/);
+ if (match && parseInt(match[1]) < 2 && !versionString.includes('psmux')) return false;

Or even better: add psmux as a first-class backend (as @marlocarlo suggested), checking process.env.PSMUX_SESSION.

gonnector · 5 months ago

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 running claude --teammate-mode tmux.

Likely cause: psmux does not set the TMUX environment 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., detecting PSMUX_SESSION or forcing native mode with --teammate-mode tmux) would likely resolve this.

psmux · 5 months ago

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 ?

yurukusa · 5 months ago

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:

// settings.json
{
  "teammateMode": "tmux"
}

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 split
  • Alt+Shift+= — vertical split

Run claude in 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.

psmux · 4 months ago

as @gonnector mentioned, --teammate-mode tmux works 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.