VibeAR

How to Run Multiple AI Coding Agents in Parallel

To run multiple Claude Code agents in parallel, give each one its own git worktree and branch, start each in its own terminal (tmux windows work well), hand every agent a task that touches different files, and merge the branches one at a time after reviewing each diff. The setup takes minutes. The hard part is that you can only watch and review so many terminals at once.

Updated November 19, 2026 ยท 10 min read

This guide covers the mechanics first: worktrees, tmux, how to cut a task into pieces that do not collide, and how to review the results. The same steps work for Claude Code, Codex, Gemini CLI, Aider or any other command-line agent, and you can mix them. Running Claude Code and Codex side by side is just two terminals in two worktrees.

Why one directory per agent

An agent edits files, runs builds and commits. Put two of them in the same directory and they trip over each other in ways that are annoying to debug. One agent changes a header while the other is mid-compile. Both stage files into the same index. A test run fails because of a half-finished edit that belongs to somebody else.

You could clone the repo several times. A git worktree is the lighter way. It is a second (third, fourth) checkout of the same repository, each on its own branch, sharing one object database. Creating one is instant and costs almost no disk beyond the working files.

Step 1: create a worktree per task

From your main checkout, make a sibling directory for each task. The -b flag creates the branch at the same time.

cd ~/code/myapp
git worktree add ../myapp-auth     -b agent/auth
git worktree add ../myapp-search   -b agent/search
git worktree add ../myapp-docs     -b agent/docs

git worktree list

Each directory is now a full working copy. Anything untracked and local, such as a .env file or node_modules, does not come with it. Copy the env file over, and run your install command in each worktree. For big dependency trees, a package manager with a shared cache keeps this cheap.

Two rules git enforces and you should know. A branch can be checked out in only one worktree at a time. And you remove a worktree with git, not rm -rf:

git worktree remove ../myapp-docs
git branch -d agent/docs        # after it is merged
git worktree prune              # clean up stale entries

Ports are the other collision. If your app listens on 3000, three agents each running the dev server will fight. Give each worktree its own port through an env var, for example PORT=3001, PORT=3002, and tell the agent which one is its own in the prompt.

Step 2: one terminal per agent, with tmux

tmux keeps the sessions alive when you close the laptop lid or drop an SSH connection, which matters because agent runs can take a while. A layout that holds up in practice is one tmux window per agent, named for the task, plus one window for you.

tmux new-session -d -s agents -n auth   -c ~/code/myapp-auth   'claude'
tmux new-window     -t agents  -n search -c ~/code/myapp-search 'codex'
tmux new-window     -t agents  -n docs   -c ~/code/myapp-docs   'claude'
tmux new-window     -t agents  -n review -c ~/code/myapp
tmux attach -t agents

Switch with Ctrl-b then a window number, or Ctrl-b w for a list. Note that the first window runs Claude Code, the second runs Codex, and nothing about the setup cares which is which.

You can also tile panes in one window with Ctrl-b % and Ctrl-b ", which is nice for watching two or three agents at the same time. Beyond that it falls apart. Agent output is long, wide and full of diffs, and a pane at one quarter of a laptop screen shows you very little of it. Panes are for watching. Windows are for working.

Step 3: split the work so agents do not collide

Worktrees stop agents from overwriting each other on disk. They do nothing about two branches that edit the same lines, and git will surface that later as a merge conflict. The cheap fix is in how you split the task.

Good candidates for parallel work: independent bug fixes, test writing for separate modules, docs, a refactor in one package while a feature lands in another, and exploratory spikes where you will keep the best of two attempts. Bad candidates: anything where step two depends on the design decisions of step one.

Step 4: write a real brief

An agent running unattended is only as good as its brief. Put the repeated conventions in your project instructions file (CLAUDE.md for Claude Code, AGENTS.md for Codex and several others), then keep each brief short and specific.

Task: add pagination to GET /search.
Scope: only edit files under src/search/ and tests/search/.
Do not touch: package.json, lockfiles, src/router.ts.
Run the dev server on PORT=3002 if you need one.
Done when: npm test -- search passes. Commit to this branch.
If you need a change outside scope, stop and tell me.

That last line matters. An agent that hits a wall outside its scope should ask rather than quietly edit a shared file.

Step 5: review and merge one branch at a time

This is where parallelism pays or fails. Three agents finishing in ten minutes is no gain if you then spend an hour working out what they did.

  1. Review each diff against its branch point, not the working tree: git diff main...agent/auth. The three-dot form shows only what that branch added.
  2. Run the tests in that worktree before you merge, not after.
  3. Merge the smallest, most isolated branch first, then rebase the next one onto the result: git -C ../myapp-search rebase main. Conflicts then appear one at a time, with one agent's work in front of you.
  4. Hand conflicts back to the agent that owns the branch if they are non-trivial. It still has the context of what it was doing.
  5. Clean up with git worktree remove and git branch -d as each branch lands.
git diff main...agent/auth --stat
git diff main...agent/auth
git merge --no-ff agent/auth
git -C ../myapp-search rebase main

Reading the diff is not optional. Treat each branch like a pull request from a capable colleague who has not shown you their reasoning.

The real limit is attention and screen space

People run into the same wall after the first afternoon. The CPU is fine. The API limits are fine. What runs out is you.

A laptop screen fits one comfortable terminal, or two if you squeeze. A single large monitor might hold four useful ones. Every agent also wants a browser tab with its preview, a diff to read, and sometimes a spec open for reference. With five agents you are alt-tabbing and re-finding context every few seconds, and each context switch costs more than it looks. The agents sit idle waiting for an answer to a question you did not notice.

Some honest ways to push the limit with a normal setup:

The pattern behind all of these is that you want more surface area for glanceable state, not more things to type into. Which is a spatial problem.

A Claude Code terminal in VibeAR, with name, session, usage, model and effort pills above it and key strips at its sides
One agent, one window. The point of a spatial workspace is that the next three or four are simply somewhere else in the room.

Where a spatial workspace helps

An AR headset with passthrough does not make agents faster. What it does is remove the rectangle. Instead of a fixed number of pixels, you get as many terminal windows as you want arranged around you at a readable size, and you look at the one you want. For a workflow built on several long-running sessions you check in on, that is a useful property. It is also not free: you are wearing a headset, and for some people that is a dealbreaker for long sessions. If that is you, a multi-monitor desk plus tmux gets you most of the way.

VibeAR: the agent cockpit for Quest 3

VibeAR is a native mixed-reality workspace for Meta Quest 3 and 3S, built for developers running coding agents. You get unlimited terminals floating in your real room, with the shells running on your own Mac, so agents use your files, git and toolchains. Works with Claude Code, Codex, Grok, Mistral Vibe, Gemini CLI, Aider and any shell. $14.99/month, or $69 once for Lifetime.

Try VibeAR

Here is what that looks like for the parallel-agent workflow specifically.

A spatial diff window showing a small C++ change with green added lines and a red removed line
Tap the +/- pill under a terminal and the diff opens as its own window, next to the agent that made it.

VibeAR does not replace the git discipline above. You still want worktrees, scoped tasks and one-at-a-time merges. What it changes is how much of the state of your agents you can hold in view at once.

The desktop companion is macOS on Apple silicon today, with Windows coming soon. The Quest app comes from the Meta Store, the two find each other on your local network, and you pair them with a 6-digit code. Your physical keyboard stays visible through passthrough, so you type normally.

Alternatives to consider

You do not need a headset to get most of the benefit.

The difference with VibeAR is that it is built around the coding-agent case, not a general virtual monitor: the terminals are native windows that the app positions, tracks and reports on, so diff pills, presented files and voice spawning exist because it knows what a terminal and an agent are. If you do not run several agents at once, the extra is hard to justify, and one of the options above is a better fit.

Start with two agents, not five. Once reviewing two feels easy, add a third. The number that works for you is set by how quickly you can read a diff and decide.

FAQ

Can I run Claude Code and Codex side by side on the same repo?

Yes, as long as they do not edit the same working directory at the same time. Give each agent its own git worktree and branch, start claude in one and codex in the other, and merge the branches yourself when you have reviewed the diffs.

How many coding agents can I run at once?

The machine rarely limits you first. Your attention does. Most people find that three or four agents on well-separated tasks is about what they can review properly, and past that the review queue grows faster than they can clear it.

Do parallel agents need separate git worktrees?

If they touch the same repository, yes, in practice. Two agents in one directory share the same files and the same git index, so they overwrite each other, break each other's builds and mix their changes into one commit. A worktree gives each agent its own checkout while sharing the repository history.

What is the best tmux layout for several agents?

One tmux window per agent, named after the task, plus a separate window for a shell where you review and merge. Panes in a single window get cramped fast because agent output is long and wide. Use a tiled layout only for two or three agents.

How do I avoid merge conflicts between parallel agents?

Split work by files or modules, not by feature idea. Tell each agent which paths it owns, keep shared files such as lockfiles, route tables and config out of parallel tasks, and merge branches one at a time, rebasing the next onto the result.

Does VibeAR run the agents in the headset?

No. The shells run as real terminals on your Mac, so the agents use your files, git and toolchains. The Quest headset is the display and input, which is what lets you put as many terminal windows around the room as you like.