My workflow to spin up 3 coding agents at once:
@mckaywrigley228K followers
218,542 views
12 Comments
Comments from the original post on X (Twitter)

@mckaywrigley
Full markdown guide below. Smells like the future in here, doesn’t it? — # AI CLI Automation with tmux This setup automates running the same prompt across three AI coding CLIs (Claude, Gemini, and Codex) simultaneously using tmux. It eliminates the need to manually open three terminal tabs and paste prompts into each one. ## Prerequisites - macOS with Homebrew installed - tmux: `brew install tmux` ## Installation ### What's Actually Happening? When you run these commands, you're: 1. Creating a configuration file that tells tmux how you want it to behave 2. Creating a shortcut command `ai` that does all the setup work for you 3. Enabling features like mouse clicking and keyboard shortcuts Don't worry about understanding the syntax - just copy and paste! ### 1. Set up tmux configuration Run this command to create your tmux config with all customizations: ```bash cat > ~/.tmux.conf /dev/null; tmux new-session -d -s ai_clis \; send-keys \"claude\" C-m \; split-window -h \; send-keys \"gemini\" C-m \; split-window -h \; send-keys \"codex\" C-m \; select-layout even-horizontal \; setw synchronize-panes on \; attach-session -t ai_clis'" >> ~/.zshrc && source ~/.zshrc ``` ## Usage ### Basic Workflow Here's what happens at each step: 1. **Start all CLIs**: Type `ai` in your terminal - This opens a split-screen view with Claude on the left, Gemini in the middle, and Codex on the right - All three AI tools start up automatically 2. **Enter your prompt**: Type your prompt (it appears in all three panes) - Whatever you type shows up in all three tools at once (like typing on three keyboards simultaneously) 3. **Submit prompt**: Press Enter (sends to all three CLIs) - All three AIs start working on your prompt at the same time 4. **Toggle sync off**: Press `Ctrl+s` or `Option+s` - This "unlocks" the panes so you can interact with each AI individually - You'll see "SYNC ON" disappear from the status bar 5. **Work individually**: Click on any pane to interact with that CLI - Now you can ask follow-up questions to just one AI, or give different prompts to each 6. **Kill session**: Press `Ctrl+a` then `k` when done - This closes everything at once (like closing all three terminal tabs)
42 likes

@mckaywrigley
This workflow is very customizable. The one I demo is great for getting different takes on solution to complex tasks from different models. But you can also imagine spinning up another workflow where maybe Gemini plans and then Claude codes that plan. Endless possibilities.
20 likes

@mckaywrigley
turns out a use case for apple vision pro is ultrawide screen mirroring for managing a bunch of agents together on the same screen lol
13 likes

@scanner_mobile
Scan any documents, convert images into text, PDF files, etc. 👍
12 likes

@realkdi
Must get expensive to run all three constantly
6 likes

@mckaywrigley
Cheaper than you’d think: - Claude Code Max sub - Gemini CLI is basically free rn - o3 5x price reduction made it affordable
10 likes

@H3xx3n
What about combining the 3 cli in a single process and have them ask each other for help when they need?
4 likes

@mckaywrigley
So I actually prefer that each works on its own so that I get 3 distinct takes/approaches
2 likes

@jwblackwell
Try git worktrees to work in the same project
3 likes

@mckaywrigley
:)
4 likes

@soyhenryxyz
so dope now if there was a way to critque each others' work
2 likes

@mckaywrigley
The paradigm of have 1 agent work and then have another review it works pretty well - especially if the models are different