{"slug": "worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell", "title": "Worktrunk: Run 5 AI Coding Agents in Parallel Without Merge Hell", "summary": "Worktrunk, a Rust CLI with 12,200+ GitHub stars at v0.77.0 across 149 releases and 78 contributors, wraps Git's native worktree feature so developers can run multiple AI coding agents such as Claude Code in parallel without file collisions or branch conflicts. The tool adds copy-on-write build cache sharing on APFS, btrfs and XFS filesystems, automatic per-worktree port assignment for dev servers, and setup hooks for copying .env files or running migrations, replacing manual `git worktree add` and `git worktree remove` steps. Anthropic officially recommends worktrees for running multiple Claude Code sessions on independent tasks, and Worktrunk reduces that setup to commands like `wt switch -x claude -c feature-a -- 'Add authentication'`.", "body_md": "You fire up Claude Code on a feature branch, then kick off a second session for a bug fix — and they immediately start fighting over the same working directory. You end up running one agent at a time, not because the AI is too slow, but because Git only gives you one checkout. [Worktrunk](https://worktrunk.dev/) fixes this. The Rust CLI wraps Git’s native worktree feature with enough ergonomics that running five agents in parallel stops feeling heroic and starts feeling like a sensible workflow.\n\n## The Single-Checkout Problem\n\nGit’s default model gives every developer one working directory per repository. That was fine when developers worked sequentially. It is a bottleneck when AI agents can operate fully unsupervised across multiple tasks simultaneously. File collisions, branch confusion, context contamination, and lock conflicts are the predictable results when two Claude Code sessions share a workspace. The standard workaround — running agents one at a time, or cloning the repo five times — wastes either time or disk.\n\nGit already has the solution: worktrees. A worktree is a linked directory that shares your repository’s `.git` database but maintains its own branch, working directory, and staging area. Five worktrees consume a fraction of the disk space of five full clones. Anthropic officially recommends worktrees for running [multiple Claude Code sessions simultaneously on independent tasks](https://www.mindstudio.ai/blog/git-worktrees-parallel-ai-coding-agents). The problem is that the native Git UX for worktrees is painful enough that most developers never bother.\n\n## Why Native Git Worktrees Fail in Practice\n\nTo add a worktree with plain Git:\n\n```\ngit worktree add -b feat/auth ../my-project-feat-auth main\n```\n\nRepeat that for every agent, every task, every session — managing paths manually, remembering to run `npm install` in each directory, copying `.env` files by hand, figuring out which port to assign each dev server. Then clean up with `git worktree remove` followed by `git branch -d`. Each new worktree is an exercise in friction. Developers correctly judge that the overhead is not worth it and go back to running agents sequentially.\n\n## What Worktrunk Adds\n\n[Worktrunk](https://github.com/max-sixty/worktrunk) (12,200+ GitHub stars, v0.77.0, 149 releases, 78 contributors) reduces the cognitive overhead of worktrees to roughly that of switching branches. The core commands:\n\n| Task | Worktrunk | Plain Git | \n|---|---|---|\n| Switch worktrees | `wt switch feat` | `cd ../repo.feat` | \n| Create + launch agent | `wt switch -x claude -c task -- 'prompt'` | Multiple manual steps | \n| Dashboard | `wt list` | `git worktree list` (minimal) | \n| Cleanup | `wt remove` | `git worktree remove` +`git branch -d` | \n\nBeyond the command simplification, three features make the real difference:\n\n**Copy-on-write build caches.** On APFS, btrfs, and XFS filesystems, Worktrunk shares the build cache across all worktrees. Five worktrees do not mean five `npm install` runs. This eliminates one of the main reasons developers give up on worktrees entirely.\n\n**Per-worktree port assignment.** Each dev server gets its own port automatically. No more manually editing port values in environment files or discovering mid-session that two agents are racing over port 3000.\n\n**Setup hooks.** Run arbitrary commands when a worktree is created — copy the `.env` file, run database migrations, seed test data. What used to be a mental checklist becomes a one-time hook configuration.\n\n## Installing and Running Three Agents in Parallel\n\nInstall Worktrunk and wire it into your shell:\n\n```\nbrew install worktrunk && wt config shell install\n```\n\nInstall the Claude Code plugin:\n\n```\nwt config plugins claude install\n```\n\nKick off three agents in parallel:\n\n```\nwt switch -x claude -c feature-a -- 'Add authentication'\nwt switch -x claude -c feature-b -- 'Fix pagination bug'\nwt switch -x claude -c feature-c -- 'Write API tests'\n```\n\nEach command creates a worktree on a new branch, opens Claude Code in that directory, and passes the task as the initial prompt. Run `wt list` to get a live dashboard showing all three worktrees: their branch, HEAD drift, uncommitted changes, and CI status. When an agent finishes, `wt merge` handles squash or rebase, removes the worktree directory, and deletes the branch in a single step.\n\nThe Claude Code plugin adds a `/wt-switch-create` command inside Claude itself, so agents can create their own sub-worktrees when a task branches unexpectedly. This is a Claude Code exclusive — Codex and Gemini CLI load the plugin but cannot change working directories on their own.\n\n## What Worktrunk Does Not Solve\n\nFive agents in five worktrees are five processes competing for the same CPU and battery. The filesystem is isolated; the machine is not. If you close the laptop, all five agents stop. Worktrees also do not isolate databases, Docker daemons, or shared caches — two agents that both write to the same test database will still collide.\n\nThe [critical discipline for parallel agent work](https://developer.upsun.com/posts/ai/git-worktrees-for-parallel-ai-coding-agents) is task decomposition before you start. Agents should work on non-overlapping file sets. Two agents editing the same utility module will produce a merge conflict with themselves. Assign work by domain boundary: authentication agent touches `auth/`, payments agent touches `payments/`, never the same files. Most teams find two to four parallel agents is the practical ceiling before coordination overhead starts eating the efficiency gains.\n\n## The Bottom Line\n\nWorktrunk does not change what Git worktrees are — it changes whether you will actually use them. The difference between `git worktree add -b feat/auth ../my-project-feat-auth main` and `wt switch feat` is the difference between a workflow developers tolerate in theory and one they reach for every day. If you are already running AI coding agents, the single-checkout bottleneck is the most fixable constraint on your throughput. This is how you fix it.", "url": "https://wpnews.pro/news/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell", "canonical_source": "https://byteiota.com/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell/", "published_at": "2026-11-09 07:06:46+00:00", "updated_at": "2026-11-09 07:22:21.962784+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Worktrunk", "Git", "Claude Code", "Anthropic", "Rust", "max-sixty"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell", "markdown": "https://wpnews.pro/news/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell.md", "text": "https://wpnews.pro/news/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell.txt", "jsonld": "https://wpnews.pro/news/worktrunk-run-5-ai-coding-agents-in-parallel-without-merge-hell.jsonld"}}