DEV Community

Gagan Aryan
Gagan Aryan

Posted on

How I Run 20 Claude Code Agents in Parallel Without Git Conflicts

I've been using Claude Code and Codex CLI heavily for the past few months. They're incredible, but they've gotten good enough that the bottleneck isn't the agent anymore. It's me.

I can describe 10 tasks right now: refactor auth in one repo, add tests in another, build a new component in a third, fix that CI pipeline, update the docs. The agents can do all of this. But I'm running them one at a time because the tooling forces sequential work: one terminal, one context, one task at a time. If I try to run multiple agents, I'm juggling terminals, losing track of what each one is doing, dealing with merge conflicts when two agents touch the same repo, and context-switching constantly.

The fix turned out to be a combination of a git feature most developers have never used, and an IDE built specifically for this workflow.

Git worktrees: solving the same-repo problem

When two agents work on the same repo, they'll conflict. Git worktrees solve this cleanly. Most people don't know this, but git lets you check out multiple branches simultaneously into separate directories, all sharing the same .git history. No cloning, no duplicating.

# Create a worktree for a feature branch
git worktree add .workstreams/my-feature feature-branch

# Now you have two directories, same repo, different branches
# Agents can work in parallel with zero file conflicts
Enter fullscreen mode Exit fullscreen mode

Each agent gets its own branch and directory. They can't step on each other. When you're done, you merge like any other PR.

But worktrees only solve one piece. The bigger problem is orchestration, i.e., managing agents across multiple repos, tracking which ones are done, reviewing their output, and sending feedback. That's a full-time coordination job when you're doing it manually across terminals.

What we built

My co-founder Avijit and I built Workstreams, an open-source desktop IDE for macOS that handles all of this. You add any number of repositories, define tasks across them, and it creates isolated worktrees, spawns agents in parallel, and gives you a single interface to monitor, review, and iterate across everything.
Here's what a session actually looks like:

Add repos and define tasks

Add any number of git repositories to the Projects sidebar. For each repo, click + to create a workstream: fill in a feature name, branch name, and a natural language prompt. Pick your agent: Claude, Codex, or just a plain Terminal if you want to drive it yourself.

You might have three workstreams running on your backend, two on your frontend, and one on your docs repo, all visible in the same sidebar.

You can even drag screenshots or mockups into the creation modal. Workstreams saves them into the worktree and appends their file paths to the initial prompt, useful for UI tasks or bug reports where the agent needs visual context.

Creating workstreams

Agents run in complete isolation

When you confirm, Workstreams creates a git worktree, creates the branch, and launches the agent in that directory. Each task is completely isolated: its own branch, its own files, its own terminal.

The sidebar shows every running workstream across all your repos with live diff stats (additions/deletions against the base branch) and lifecycle state. For Claude Code specifically, Workstreams installs a hook script that reports lifecycle events back to the app in real time, so the sidebar tells you exactly whether an agent is actively working, waiting for permission, or ready for review, even if you're focused on a different repo entirely.

Running agents in isolation

Stateful switching

This is the part that surprised me the most. When you click a different workstream in the sidebar, even one in a completely different repo, it doesn't just swap the file tree. It saves your current editor layout, split diffs, and terminal state, then restores the target worktree's state. Each branch feels like its own self-contained workspace, not a disposable temp directory.

Your original repo checkout stays in the sidebar as local, so you can jump back to your main branch without leaving the app.

Workstreams is a full IDE, complete with Language Server Protocol support, syntax highlighting, and autocomplete. You don't need to context-switch to VS Code or Cursor to actually read and understand what your agents wrote.

LSP Editor

Review diffs and leave inline comments

Once an agent finishes, open the diff editor for any changed file. You get a split diff view with a gutter affordance to leave inline comments, anchored to specific lines and diff sides.

Comments are stored per worktree in .workstreams/comments/<worktree>.json. They persist across sessions and don't depend on any external service.

Reviewing your diffs

Send comments back to the agent in one click

This is where the loop closes. Run Workstream: Send Review Comments to Claude from the Command Palette. A picker shows all your saved comments for that worktree. Select the ones you want to send (or send all), and Workstreams:

  1. Opens a terminal in the active worktree
  2. Starts the configured claude command
  3. Formats each comment into a structured prompt with file path, line number, and your note
  4. Sends it all to the agent

Comments that were sent are automatically cleared so your next review pass starts clean.

Sending comments

GitHub PR threads too

If the branch backs an open GitHub PR and you've signed in via Workstream: Sign in to GitHub, the same picker pulls in unresolved GitHub review threads alongside your local comments. Both go to the agent in a single send. This means your feedback loop spans local review and remote PR comments seamlessly.

Merge with your normal flow

Workstreams doesn't replace GitHub. When the branch is ready, use your normal PR and merge flow. After merge, delete the worktree from the sidebar to clean up.

The workflow shift

The mental model change is real. Instead of:

Sequential: pick a task → prompt agent → wait → review → prompt again → wait → pick next task...

You get:

Parallel: define 10 tasks across 4 repos → agents work simultaneously → review diffs as they come in → send feedback → agents iterate → merge

The bottleneck shifts from "waiting for the agent" to "writing good prompts and reviewing well." Which is exactly where a senior engineer's time should go. You're not handholding one agent; you're supervising a team of them.

Try it

Workstreams is fully open source and free. It orchestrates agents you already have installed: no extra accounts, subscriptions, or API keys.

There's also a CLI (ws) in the repo if you prefer staying in the terminal.

If you find this useful, a ⭐ on GitHub helps us get visibility. We're actively building: better isolation, a configurable autonomy dial (fully autonomous to human-in-the-loop), and a central command center for all your agents are next on the roadmap.

Would love your feedback. Drop an issue, jump into Discord, or tell me what's broken in the comments.

Top comments (1)

Collapse
 
avijit_mandal_51dc5bbaa3a profile image
Avijit Mandal

More exciting things ahead! We’re actively evolving Workstreams using Workstreams itself at 10× speed. Can’t wait to see what people build with it.