To run multiple Claude Code and Codex agents in parallel, give each one its own git worktree, then make sure they can see what the others are doing. Worktrees stop agents from editing the same checkout, and tmux or a desktop app keeps the terminals in view. Isolation alone does not stop them from making conflicting decisions, so add shared context, messages and forks for side questions. Synapse does that for agents you already run, and its Mac app adds terminals, worktrees and forks in one window.
Why parallel agents collide
Running multiple Claude Code agents in parallel sounds simple: open two terminals, type claude twice. It goes wrong in two ways.
- File collisions. Two agents in the same folder edit the same files, run the same tests and trample each other's half-finished changes.
- Decision collisions. Even in separate folders, one agent renames a function while the other keeps calling the old name. Neither knows the other exists.
Worktrees fix the first problem. The second needs some way for agents to share what they are doing.
Step 1: one git worktree per agent
A git worktree is a second working folder for the same repository, on its own branch. Agents in different worktrees cannot overwrite each other's uncommitted files.
cd ~/code/app
git worktree add ../app-auth -b auth-refactor
git worktree add ../app-review -b review
git worktree list
Start one agent in each:
cd ../app-auth && claude
cd ../app-review && codex
When the work is merged, clean up:
git worktree remove ../app-auth
git branch -d auth-refactor
Two things to know. Each worktree needs its own dependencies installed (for example npm install), and untracked files such as .env are not copied over. Many worktree managers, including Superset, Conductor and Emdash, automate this.
Step 2: keep the terminals in view with tmux
With three or four agents you lose track of which one is waiting for you. tmux puts them in one window:
tmux new -s agents
# split the window: Ctrl-b % (side by side), Ctrl-b " (top and bottom)
# move between panes: Ctrl-b and an arrow key
# detach: Ctrl-b d reattach later:
tmux attach -t agents
If you like this setup, Claude Squad wraps tmux and worktrees in one TUI, and CCManager does something similar without tmux. Warp shows agents in panes with status tabs.
Step 3: stop agents from making conflicting decisions
Worktrees and tmux give you isolated agents you can see. They still work blind to each other. Three habits help.
Share context
The free option is a notes file both agents read, such as a NOTES.md that CLAUDE.md and AGENTS.md tell them to update. It works for long-lived decisions, but agents only see what someone wrote down.
Synapse automates this. You link agent A to agent B, and on every prompt B gets what A has said since last time, up to 8,000 characters per link. Links are directional, so draw both ways for a pair. Transcripts are read from disk, so no agent has to write a summary.
Send messages
When the implementer changes an interface, tell the reviewer directly. With Synapse, any linked agent can message another:
synapse link codex-review
synapse send codex-review "I renamed getUser to fetchUser in src/auth. Re-check your review."
synapse inbox
Agents have the same operations as MCP tools, so you can also just tell Claude Code "connect to the codex agent and ask what it found". Claude Code and Codex get messages with their next prompt and print a line in the terminal when context or messages arrive.
One honest limit: messages are pull, not push, for agents you started outside the Synapse app. An idle agent sees a message on its next prompt. Synapse also has no file locks. If your agents share files heavily, MCP Agent Mail has advisory file leases.
Fork side questions
A quick "how does this library handle retries?" stays in the session forever and shapes later answers. A fork keeps it out of the main context. In Synapse, /sfork <question> or ⇧⌘F forks the session natively (claude --resume <id> --fork-session or codex fork <id>). Forks work for Claude Code and Codex only.
The Synapse desktop app workflow, step by step
The Synapse Mac app puts all of the above in one window. It is a signed and notarized Apple Silicon DMG, free and MIT, and local use needs no account.
- Install. Download Synapse, move it to Applications and open it. On first launch it adds its MCP server, hooks and the synapse skill to the CLIs you have installed (Claude Code, Codex, Gemini, Cursor, Copilot, Amp, OpenCode), backing up each config as
<file>.bak-synapse. Restart agents that were already running so they pick it up. - Add your project. The sidebar nests projects, then worktrees, then sessions, then forks. Drag to reorder, or use ⌥↑ and ⌥↓.
- Start sessions. Open a new session in each worktree and pick Claude Code, Codex, Gemini, OpenCode, Cursor, Copilot, Amp or a shell. These are real terminals.
- Pick a view. GUI mode and Terminal mode show the same live processes. Switch in Settings > view without restarting any agent. Split two conversations side by side or top and bottom, each with its own draft.
- Link them. On the canvas, every live agent is a node, grouped by git repo. Drag from one node's ring to another to link. Working agents pulse. ⌘F searches.
- Talk across agents. In the composer, @tag one of your agents to send it a message, which also connects it. Prompts sent from the app go straight to sessions the app owns.
- Fork when you wander.
/sforkor ⇧⌘F for side questions. The fork nests under its parent in the sidebar. - Get told when it is done. Every agent has a working light, and done notifications show the start of the reply, with a sound when it finishes.
- Step away. The iPhone app (TestFlight beta) shows every agent grouped by project, end to end encrypted, so you can follow and message them from your phone.
Agents you started elsewhere still show up. Synapse finds Claude sessions through Claude Code's session registry and other CLIs by process scan, so your tmux panes appear on the canvas too.
What Synapse does not do
It has no diff review UI, no PR creation, no cloud sandboxes and no issue tracker. It is a young project with a small community, Mac first, with an unsigned Windows build. If you want a full review and PR flow, run your agents in a worktree manager and link them with Synapse. See the best tools to run multiple coding agents for how they fit together.
FAQ
Can I run multiple Claude Code sessions in the same repo?
Yes, but give each its own git worktree with git worktree add ../name -b branch. Two sessions in the same folder will overwrite each other's uncommitted changes.
How many Claude Code agents can I run in parallel?
There is no fixed limit in git or tmux. The practical limits are your usage plan, your machine and how many agents you can review. Most people find a few at a time manageable.
How do I run Claude Code and Codex at the same time?
Start each in its own worktree, one with claude and one with codex. To let them see each other's work, link them with Synapse so each gets the other's recent conversation on every prompt.
Do parallel agents know what the others are doing?
Not by default. Worktrees and tmux keep them apart. You need a shared notes file, a message tool, or Synapse links, which inject a linked agent's recent conversation into the next prompt.
Do I need tmux to run agents in parallel?
No. Separate terminal tabs work. tmux, Warp, CCManager or the Synapse app just keep them in one window.
Can I fork a Claude Code or Codex session?
Yes. Claude Code supports claude --resume <id> --fork-session and Codex supports codex fork <id>. In the Synapse app, /sfork or ⇧⌘F does this for you and shows the fork under its parent.