Windows 下 Claude Code使用 Agent Teams 配置教程在linux和macos系统下安装tmux使用agent teams非常简单但是在windows系统下无法直接安装tmux只能另辟蹊径于是我从github上找到了tmux_for_windows项目。前提条件1. 安装 Git for Windows下载地址https://git-scm.com/download/win安装后确认where.exe git# 输出示例C:\Program Files\Git\cmd\git.exe2. 安装 tmux for Windowstmux 必须运行在 Git BashMinGW64环境下CMD 和 PowerShell 不支持原因依赖CMD/PowerShellGit BashPTY 伪终端✗✓Unix 系统调用✗✓MSYS2 运行库✗✓安装步骤克隆仓库或下载 zipgitclone https://github.com/hongwenjun/tmux_for_windows.git以管理员权限将 zip 解压到 Git 的usr目录# PowerShell管理员Start-Processpowershell-Verb RunAs-ArgumentList -Command Expand-Archive -Path tmux_for_windows\tmux_for_git-bash.zip -DestinationPath C:\Program Files\Git\usr -Force-Wait验证安装# Git Bash 中tmux-V# 输出tmux 2.7 或更高版本复制.tmux.conf启用鼠标支持Copy-Itemtmux_for_windows\.tmux.conf-Destination$env:USERPROFILE\.tmux.conf配置 Claude Codesettings.json 路径范围路径全局推荐C:\Users\用户名\.claude\settings.json项目级项目路径\.claude\settings.json完整配置编辑~/.claude/settings.json添加以下字段{env:{PATH:原有PATH;C:\\Program Files\\Git\\usr\\bin,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:1},teammateMode:tmux}关键字段说明字段值说明CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS1启用实验性 agent 团队功能teammateModetmux使用 tmux 管理多个 agent 进程PATH 追加C:\Program Files\Git\usr\bin让 Claude Code 能找到 tmux.exeteammateMode合法值auto— 自动选择tmux— 使用 tmux 分 pane 运行Windows 需配合 Git Bashin-process— 在同一进程内运行不需要 tmux注意teammateSessions不是合法字段settings.json 的 schema 会报错不要添加。工作原理Git Bashtmux 会话 └── claude CLI 主进程 └── 触发多 agent 并行任务 ├── tmux pane 1 → claude 进程Agent 1 ├── tmux pane 2 → claude 进程Agent 2 └── tmux pane 3 → claude 进程Agent 3每个 teammate 是一个独立的claude进程运行在单独的 tmux pane 中各 agent 有独立的上下文、环境变量和工作目录可通过CtrlB 方向键在 pane 之间切换实时观察各 agent 输出使用方式启动方式必须在Git Bash中启动 Claude Code# 方式一在任意目录右键 → Git Bash Here然后claude# 方式二在已有 tmux 会话中启动tmux new-session-swork claude查看 tmux 会话tmux list-sessions# 查看所有会话tmux list-panes-a# 查看所有 panetmux attach-session-twork# 连接到指定会话tmux 常用快捷键快捷键功能CtrlB 方向键切换 paneCtrlBd脱离会话后台运行CtrlB[进入复制/滚动模式q退出复制模式验证配置重启 Claude Code 后执行以下检查# 1. 确认 tmux 可访问tmux-V# 2. 确认配置已加载在 Claude Code 会话内执行# 触发一个多 agent 并行任务观察是否在 tmux 中创建新 pane常见问题问题原因解决方案tmux: command not foundPATH 未包含 tmux 路径在 settings.json 的 PATH 中追加C:\Program Files\Git\usr\bin解压时 Access Denied写入 Program Files 需要管理员权限用Start-Process -Verb RunAs以管理员运行agent 不在新 pane 中出现未在 Git Bash/tmux 环境下运行 claude必须从 Git Bash 启动 Claude CodeteammateSessions报 schema 错误该字段不在官方 schema 中删除该字段只保留teammateMode参考tmux for Windows 仓库https://github.com/hongwenjun/tmux_for_windowsGit for Windowshttps://git-scm.com/download/win