#Claude Code Teams

cmux claude-teams launches Claude Code with agent teams enabled. When Claude spawns teammate agents, they appear as native cmux splits instead of tmux panes, with full sidebar metadata and notifications.

#Usage

cmux claude-teams
cmux claude-teams --continue
cmux claude-teams --model sonnet

All arguments after claude-teams are forwarded to Claude Code. The command defaults teammate mode to auto and sets the environment so Claude uses cmux splits.

#How it works

cmux claude-teams creates a tmux shim script and configures the environment so Claude Code thinks it's running inside tmux. When Claude issues tmux commands to manage teammate panes, the shim translates them into cmux socket API calls.

  • 현재 서피스의 임시 shim 디렉터리에 tmux shim을 생성합니다. 경로에는 서피스 UUID가 포함되며 패널마다, 부팅할 때마다 달라지므로 고정 경로를 제시할 수 없습니다
  • Claude Teams 시작 세션에서 tmux를 모의하도록 TMUX와 TMUX_PANE을 설정합니다
  • Prepends the shim directory to PATH so Claude finds the shim before real tmux
  • Enables CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 and sets teammate mode to auto

shim은 CMUX_CLAUDE_TEAMS_CMUX_BIN이 설정된 경우에만 cmux로 라우팅하고, 설정되지 않으면 다음 실제 tmux 실행 파일로 투명하게 전달합니다. 따라서 which tmux만으로는 Claude Teams 가로채기가 활성화되었는지 알 수 없습니다.

#Environment variables

VariablePurpose
TMUXcmux claude-teams를 실행한 세션용 합성 tmux 소켓 경로
TMUX_PANEcmux claude-teams를 실행한 세션용 합성 tmux pane 식별자이며, 생성된 에이전트 패널 안에서는 비어 있습니다
CMUX_SURFACE_ID현재 서피스의 UUID이며, 생성된 에이전트 패널 안에서 해당 서피스의 식별자로 사용합니다
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSEnables Claude Code agent teams feature
CMUX_SOCKET_PATHPath to the cmux control socket for the shim to connect to

합성된 TMUX, TMUX_PANE 및 관련 tmux 호환 값은 생성된 패널이 아니라 cmux claude-teams를 실행한 세션을 설명합니다. 에이전트 패널 안에서는 CMUX_SURFACE_ID를 사용하고 cmux tree --json을 실행하세요. 출력의 caller 객체가 호출한 패널을 식별합니다.

#Directories

PathPurpose
시스템 임시 디렉터리 아래의 서피스별 디렉터리(고정 경로 없음)활성 tmux shim을 포함하며 해당 서피스의 PATH 앞에 추가됩니다
~/.cmuxterm/tmux-compat-store.jsontmux-compat 버퍼, 훅 및 분할 배치/레이아웃 상태를 위한 영구 저장소

분할 라우팅 키는 다음과 같습니다:

  • lastSplitSurface각 워크스페이스 UUID를 최근 분할로 생성된 서피스 UUID에 매핑합니다. 다음 main-vertical 분할이 놓일 위치를 정하는 에이전트 열 앵커의 초기값으로 사용됩니다.
  • mainVerticalLayouts각 워크스페이스 UUID를 mainSurfaceId(주 또는 리더 서피스)와 lastColumnSurfaceId(에이전트 열의 가장 아래 서피스)에 매핑합니다. 이후 팀원 분할은 이 열을 대상으로 아래쪽으로 쌓입니다.

팀원 패널이 기존 서피스 옆의 분할이 아니라 그 뒤의 탭으로 나타나면 이 라우팅 키를 확인하세요.

#Supported tmux commands

The shim translates these tmux commands into cmux operations:

  • new-session, new-windowcreates a new cmux workspace
  • split-windowsplits the current cmux pane
  • send-keyssends text to a cmux surface
  • capture-panereads terminal text from a cmux surface
  • select-pane, select-windowfocuses a cmux pane or workspace
  • kill-pane, kill-windowcloses a cmux surface or workspace
  • list-panes, list-windowslists cmux panes or workspaces