Tmux for Parallel AI Agents - Layout, Feedback Loops, and Review Workflow
Tmux for Parallel AI Agents
Running multiple AI coding agents in parallel on the same codebase is powerful but chaotic without the right tooling. Tmux is what makes it actually manageable. The feedback loop when a plan goes wrong needs to be immediate - the longer you let an agent run in the wrong direction, the more cleanup you have.
Why Visibility Matters More Than You Expect
The failure mode without shared visibility: agent 2 silently generates 500 lines of wrong code while you are watching agent 1 in a different window. By the time you notice, agent 2 has committed, and agent 3 has started building on top of it. You now have a chain of bad work to unwind.
With tmux, all agents are visible simultaneously. You catch the drift early - after 20 lines, not 500. One Ctrl+C, a quick redirect, and the agent is back on track. The cost of a false start is minutes, not hours.
This is the core value proposition: not ergonomics, but error containment. Tmux is a monitoring tool as much as a terminal multiplexer.
Practical Layout for Four to Six Agents
A 2x2 grid works well for four agents. For six, use a 3x2 or keep a master pane for coordination:
# Launch a new session with a 2x2 layout
tmux new-session -s agents
# Split into four panes
tmux split-window -h # Split right
tmux select-pane -t 0
tmux split-window -v # Split top-left down
tmux select-pane -t 2
tmux split-window -v # Split top-right down
# Name panes (use tmux rename-window or title sequences)
# Pane 0: frontend agent
# Pane 1: backend agent
# Pane 2: test writer
# Pane 3: your coordination pane
Keep one pane for yourself - git status, manual commands, merge operations. Giving all panes to agents leaves you with nowhere to work while they run.
Key Bindings Worth Learning
Tmux has a steep learning curve but three bindings change everything for multi-agent work:
prefix + z- Zoom into the current pane for detailed review, press again to zoom out. Use this constantly when an agent produces complex output you need to read carefully.prefix + q- Flash pane numbers. Lets you jump to a specific pane number instantly.prefix + [- Enter scroll mode to read past output without interrupting the agent. Essential for reviewing what an agent did before its current work.
The muscle memory for prefix + z - zoom in to review, zoom out to monitor - becomes automatic after a day or two.
Instant Feedback Loops in Practice
The real value of simultaneous visibility is cascading failure prevention. A typical scenario:
Agent 2 produces a build error at 10:23. Without tmux visibility, you see it at 10:45 when you switch to check on it. Agent 3, which depends on agent 2's output, has been attempting to build on a broken foundation for 22 minutes.
With tmux visibility, you see the red build output the moment it appears. You Ctrl+C agent 2, fix the issue (often a quick clarification), and restart it. Agent 3 has been blocked for 90 seconds instead of 22 minutes.
This compounds. Three agents producing output simultaneously means three opportunities for early failure detection per minute instead of one every several minutes with window-switching.
Terminal Review Workflow
Combine tmux visibility with a structured review step between task rounds:
- Agents complete a task round - all reach a natural stopping point
- Dedicate 5 minutes to reviewing each agent's
git diffin your coordination pane - Accept the good work (merge or stash to review later), redirect any agent that drifted
- Start the next task round
The review pane command:
# Review agent 1's work
cd ../project-agent-1
git diff --stat HEAD~1 # What files changed
git diff HEAD~1 # The actual changes
Reviewing before starting the next round prevents the compounding problem where agents build on each other's unreviewed work. Once you have reviewed and accepted a foundation, you can trust subsequent agents to build on it.
Named Windows for Larger Setups
For more than six agents, windows become more useful than panes. Each window gets a task name:
tmux rename-window "frontend"
tmux new-window -n "backend"
tmux new-window -n "tests"
tmux new-window -n "infra"
Use prefix + [window-number] to jump to a specific task, and prefix + s for a session overview showing all windows and their current content. Combine windows with a monitoring window that uses tmux send-keys to periodically report agent status.
What Breaks at Scale
The practical ceiling is around 5-7 agents on a typical developer machine before the review bottleneck dominates. You cannot review code faster than you can read code. Five agents producing parallel output means your review queue grows faster than you can clear it - and unreviewed code accumulates risk.
Rate limits are the other hard constraint. Five active agents hitting the same API key will exhaust rate limits quickly. Tools like dmux and NTM have built-in rate limit management; roll your own with a simple sleep-and-retry wrapper around agent invocations if needed.
The investment in learning tmux pays for itself within the first day of parallel agent work. The visibility alone prevents more wasted time than any amount of prompt engineering.
- Managing Parallel AI Agents with tmux and Git Worktrees
- Terminal IDE for Multiple AI Agents
- Five Agents Same Codebase - Coordination Lessons
This post was inspired by a discussion on r/ClaudeCode (93 upvotes, 26 comments) by u/RoyalAlpaca.
Fazm is an open source macOS AI agent. Open source on GitHub.