Worktrunk: Run 5 AI Coding Agents in Parallel Without Merge Hell 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'`. 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. The Single-Checkout Problem Git’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. Git 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. Why Native Git Worktrees Fail in Practice To add a worktree with plain Git: git worktree add -b feat/auth ../my-project-feat-auth main Repeat 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. What Worktrunk Adds 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: | Task | Worktrunk | Plain Git | |---|---|---| | Switch worktrees | wt switch feat | cd ../repo.feat | | Create + launch agent | wt switch -x claude -c task -- 'prompt' | Multiple manual steps | | Dashboard | wt list | git worktree list minimal | | Cleanup | wt remove | git worktree remove + git branch -d | Beyond the command simplification, three features make the real difference: 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. 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. 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. Installing and Running Three Agents in Parallel Install Worktrunk and wire it into your shell: brew install worktrunk && wt config shell install Install the Claude Code plugin: wt config plugins claude install Kick off three agents in parallel: wt switch -x claude -c feature-a -- 'Add authentication' wt switch -x claude -c feature-b -- 'Fix pagination bug' wt switch -x claude -c feature-c -- 'Write API tests' Each 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. The 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. What Worktrunk Does Not Solve Five 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. The 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. The Bottom Line Worktrunk 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.