tmux Layout¶
AgentPair can run agents in a tmux session with side-by-side panes for visual monitoring.
Prerequisites¶
Install tmux:
Basic Usage¶
This creates a detached tmux session with the layout:
┌─────────────────────────────────────────────────────────┐
│ │
│ Claude Pane (0) │ Codex Pane (1) │
│ │ │
│ [Claude output here] │ [Codex output here] │
│ │ │
│ │ │
│ │ │
├────────────────────────────┴────────────────────────────┤
│ Status Pane (2) │
│ [Bridge status, iteration info] │
└─────────────────────────────────────────────────────────┘
Attaching to Sessions¶
After starting:
Session names follow the pattern: agentpair-{repo}-{run-id}
Session Management¶
List Sessions¶
Output:
agentpair-myrepo-1: 3 windows (created Sat Mar 28 10:00:00 2024)
agentpair-myrepo-2: 3 windows (created Sat Mar 28 11:30:00 2024)
Detach¶
While attached, press Ctrl+B then D to detach.
Kill Session¶
Pane Navigation¶
Standard tmux navigation:
| Keys | Action |
|---|---|
Ctrl+B ← |
Move to left pane |
Ctrl+B → |
Move to right pane |
Ctrl+B ↑ |
Move to upper pane |
Ctrl+B ↓ |
Move to lower pane |
Ctrl+B z |
Zoom current pane |
Ctrl+B [ |
Enter scroll mode |
q |
Exit scroll mode |
Scrolling¶
To scroll through agent output:
- Press
Ctrl+Bthen[to enter scroll mode - Use arrow keys or Page Up/Down to scroll
- Press
qto exit scroll mode
Layout Customization¶
The default layout uses equal horizontal splits for agents and a smaller bottom pane for status.
tmux configuration can be customized in ~/.tmux.conf:
# Example: increase scrollback
set-option -g history-limit 50000
# Mouse support for scrolling
set -g mouse on
Persistent Sessions¶
tmux sessions persist even if:
- You close your terminal
- You disconnect from SSH
- Your shell exits
Reattach anytime with:
With SSH¶
tmux is particularly useful over SSH:
# SSH into remote machine
ssh user@remote
# Start AgentPair with tmux
agentpair --tmux --prompt "Task"
# Detach (Ctrl+B, D)
# Disconnect SSH safely
# Later, reconnect
ssh user@remote
tmux attach -t agentpair-myrepo-1
With Worktree¶
Combine tmux with worktree isolation:
Example Workflow¶
-
Start session:
-
Attach to watch:
-
Navigate panes:
Ctrl+B→to see CodexCtrl+B←to see Claude-
Ctrl+B↓to see status -
Scroll history:
Ctrl+B[to enter scroll mode- Page Up/Down to navigate
-
qto exit -
Detach when satisfied:
-
Ctrl+BDto detach -
Check status later:
Troubleshooting¶
"tmux not available"¶
Install tmux (see Prerequisites above).
Session Not Found¶
Panes Not Updating¶
- Check if agents are still running
- View bridge status:
agentpair bridge --run-id 1 - Check for errors in agent panes
Terminal Issues¶
If the terminal looks corrupted:
Next Steps¶
- Git Worktrees — Isolate changes
- Resuming Runs — Continue sessions