Enables Claude Code agent teams split-pane mode inside cmux.
Claude Code's --teammate-mode tmux only supports tmux and iTerm2. This shim intercepts tmux commands and translates them to cmux CLI equivalents, so agent teams spawn teammates as visible split panes.
Claude Code calls: Shim translates to:
tmux split-window -h → cmux new-split right
tmux send-keys -t %1 → cmux send --surface surface:N
tmux kill-pane -t %1 → cmux close-surface --surface surface:N
tmux capture-pane -t %1 → cmux capture-pane --surface surface:N
tmux list-panes → Returns only mapped panes (no tab leaks)
The shim maintains a %N → cmux surface ID mapping so all commands target the correct cmux surfaces. Works with both surface refs (surface:N) and UUIDs.
- cmux (macOS)
- Claude Code with agent teams enabled
- fish or zsh shell
git clone https://github.com/ogallotti/cmux-tmux-shim.git
cd cmux-tmux-shim
bash install.shThe installer:
- Copies the shim to
~/.local/bin/tmux - Detects your shell (fish/zsh)
- Offers to add the config to your shell rc file
- Copy
bin-tmuxto~/.local/bin/tmuxand make it executable - Ensure
~/.local/binis in your PATH before/opt/homebrew/bin(or wherever real tmux lives) - Add the contents of
shell/fish.conforshell/zsh.confto your shell config
Open a new cmux tab and use Claude Code normally. When you create an agent team, teammates appear as split panes:
Tell Claude: "Create an agent team with 3 teammates"
Layout: leader on the left, teammates stacked vertically on the right.
To skip auto-launching claude in a new tab:
# fish
CMUX_NO_CLAUDE=1 fish
# zsh
CMUX_NO_CLAUDE=1 zshEnable debug logging:
export CMUX_TMUX_SHIM_DEBUG=1Logs go to ~/.local/state/cmux-tmux-shim/shim.log.
There's an open PR to add this natively to cmux. When that ships, this shim becomes unnecessary. Key differences:
| This shim | PR #1102 | |
|---|---|---|
| Setup | Manual (install.sh) | Zero config (bundled) |
| Surface IDs | Works with UUIDs and refs | Refs only |
| list-panes | Only mapped panes (no tab leaks) | All panes |
| split-window -t | Respects target (relative split) | Ignores target |
| Session detection | Auto-resets stale state across sessions | Manual |
| Dependencies | Bash only | Requires python3 |
| Layout | Forced vertical stacking | Follows agent request |
rm ~/.local/bin/tmux
rm -rf ~/.local/state/cmux-tmux-shimThen remove the cmux-tmux-shim block from your shell config.
MIT