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

-   បង្កើត tmux shim ក្នុងថត shim បណ្ដោះអាសន្នរបស់ surface បច្ចុប្បន្ន។ ផ្លូវនេះមាន UUID របស់ surface និងផ្លាស់ប្ដូរសម្រាប់ផ្ទាំងនីមួយៗ និងរាល់ពេលចាប់ផ្ដើមប្រព័ន្ធ ដូច្នេះមិនអាចបញ្ជាក់ផ្លូវថេរបានទេ
-   កំណត់ TMUX និង TMUX\_PANE ដើម្បីក្លែងធ្វើ tmux សម្រាប់ session ចាប់ផ្ដើម Claude Teams
-   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 តែពេលកំណត់ `CMUX_CLAUDE_TEAMS_CMUX_BIN` ប៉ុណ្ណោះ; បើមិនកំណត់ វានឹងបន្តដោយថ្លៃថ្នូរទៅឯកសារប្រតិបត្តិ tmux ពិតបន្ទាប់។ ដូច្នេះ `which tmux` មិនអាចបង្ហាញថា Claude Teams interception កំពុងដំណើរការឬអត់ទេ។

## Environment variables

| Variable | Purpose |
| --- | --- |
| `TMUX` | ផ្លូវ socket tmux សិប្បនិម្មិតសម្រាប់ session ដែលបានដំណើរការ cmux claude-teams |
| `TMUX_PANE` | អត្តសញ្ញាណ pane tmux សិប្បនិម្មិតសម្រាប់ session ដែលបានដំណើរការ cmux claude-teams; វាទទេនៅក្នុងផ្ទាំង agent ដែលបានបង្កើត |
| `CMUX_SURFACE_ID` | UUID របស់ surface បច្ចុប្បន្ន; ប្រើវាជាអត្តសញ្ញាណ surface នៅក្នុងផ្ទាំង agent ដែលបានបង្កើត |
| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | Enables Claude Code agent teams feature |
| `CMUX_SOCKET_PATH` | Path to the cmux control socket for the shim to connect to |

តម្លៃសំយោគ `TMUX`, `TMUX_PANE` និងតម្លៃភាពឆបគ្នា tmux ដែលពាក់ព័ន្ធ ពិពណ៌នាអំពីសម័យដែលបានដំណើរការ `cmux claude-teams` មិនមែនផ្ទាំងដែលបានបង្កើតទេ។ ពីក្នុងផ្ទាំង agent សូមប្រើ `CMUX_SURFACE_ID` ហើយដំណើរការ `cmux tree --json`; វត្ថុ `caller` ក្នុងលទ្ធផលកំណត់អត្តសញ្ញាណផ្ទាំងដែលបានហៅ។

## Directories

| Path | Purpose |
| --- | --- |
| ថតសម្រាប់ surface នីមួយៗ នៅក្រោមថតបណ្ដោះអាសន្នរបស់ប្រព័ន្ធ (គ្មានផ្លូវថេរ) | មាន tmux shim សកម្ម ហើយត្រូវបានដាក់នៅខាងដើម PATH សម្រាប់ surface នោះ |
| `~/.cmuxterm/tmux-compat-store.json` | កន្លែងផ្ទុកអចិន្ត្រៃយ៍សម្រាប់ buffer និង hook របស់ tmux-compat ព្រមទាំងស្ថានភាពទីតាំង/ប្លង់របស់ split |

គន្លឹះ routing សម្រាប់ការបែងចែកមាន៖

-   `lastSplitSurface` — ផ្គូផ្គង UUID របស់ workspace នីមួយៗទៅ UUID របស់ surface ដែលបង្កើតដោយការបែងចែកចុងក្រោយ។ វាចាប់ផ្ដើម anchor ជួរឈរ agent ដែលកំណត់កន្លែងដាក់ការបែងចែក main-vertical បន្ទាប់។
-   `mainVerticalLayouts` — ផ្គូផ្គង UUID របស់ workspace នីមួយៗទៅ `mainSurfaceId` (surface មេ ឬ leader) និង `lastColumnSurfaceId` (surface ខាងក្រោមបំផុតក្នុងជួរឈរ agent)។ ការបែងចែក teammate បន្ទាប់នឹងកំណត់គោលដៅជួរឈរនោះ ហើយតម្រៀបចុះក្រោម។

ពិនិត្យគន្លឹះ routing ទាំងនេះ ប្រសិនបើផ្ទាំង teammate បង្ហាញជាផ្ទាំងថេបនៅខាងក្រោយ surface ដែលមានស្រាប់ ជំនួសឱ្យការបែងចែកនៅជាប់វា។

## Supported tmux commands

The shim translates these tmux commands into cmux operations:

-   `new-session`, `new-window` → creates a new cmux workspace
-   `split-window` → splits the current cmux pane
-   `send-keys` → sends text to a cmux surface
-   `capture-pane` → reads terminal text from a cmux surface
-   `select-pane`, `select-window` → focuses a cmux pane or workspace
-   `kill-pane`, `kill-window` → closes a cmux surface or workspace
-   `list-panes`, `list-windows` → lists cmux panes or workspaces

Canonical: https://cmux.com/km/docs/agent-integrations/claude-code-teams

Documentation index: https://cmux.com/llms.txt
