New

Worktrunk

Git worktrees made as easy as branches, so you can run several coding agents in parallel.

Would you recommend Worktrunk?

100% recommend it · 1 vote

One vote per person. No account needed.

Overview

Worktrunk is a CLI that gives each branch its own worktree, addressed by branch name, so several agents such as Claude Code or Codex can work at once without overwriting each other's changes. `wt switch -c -x claude feat` creates the branch and worktree and starts the agent in it; `wt list` shows every worktree's status, and `wt remove` cleans up. Hooks, LLM commit messages, a merge command and shared build caches cover the rest of the loop.

Instead of
Typing git worktree add / cd / remove by hand, or running one agent at a time in one checkout
Reach for it when
You run more than one coding agent at a time on the same repo and keep juggling checkouts.

Key features

  • Worktrees by branch name

    wt switch feat creates or jumps to a branch's worktree; paths come from a configurable template.

  • Start an agent in one step

    wt switch -c -x claude feat creates the branch and worktree, then runs the command inside it.

  • Status at a glance

    wt list shows every worktree's changes, commits ahead and behind, and unpushed work; --full adds CI status and AI summaries.

  • Merge and clean up

    One command squashes, rebases or merges a branch and removes its worktree.

  • Hooks

    Run commands on create, before and after merge, and at other points, such as installing dependencies or starting a dev server.

  • Shared build caches

    Copy node_modules/, target/ and similar folders into new worktrees using copy-on-write, on APFS, btrfs and XFS.

In depth

Why worktrees for agents

Agents such as Claude Code and Codex can work unsupervised for long stretches, so running several at once is practical. If they share one checkout they overwrite each other's files. Git worktrees give each branch its own directory backed by the same repository, but the raw commands are tedious:

bash
git worktree add -b feat ../repo.feat && cd ../repo.feat && claude
# later
cd ../repo && git worktree remove ../repo.feat && git branch -d feat

With Worktrunk the same steps are:

bash
wt switch -c -x claude feat
wt remove

A typical workflow

bash
brew install worktrunk && wt config shell install
wt switch -c -x claude auth-refactor -- 'Refactor the session handling'
wt switch -c -x codex fix-flaky-tests
wt list                      # see what each agent has changed
wt switch auth-refactor      # jump in to review
wt merge                     # squash, rebase onto main and clean up

Good to know

  • Use the hash_port template filter in hooks to give each worktree's dev server its own port.
  • wt step copy-ignored shares build caches between worktrees on copy-on-write filesystems.
  • Also available through Cargo, Arch, conda-forge and PyPI (uv tool install worktrunk).

Strengths and watch-outs

Strengths

  • Turns git's clunky worktree commands into something as quick as switching branches.
  • Built for the parallel-agents workflow, with plugins for Claude Code, Codex, OpenCode and Gemini CLI.
  • Useful without AI too, for reviewing a PR (wt switch pr:123) while keeping your own work untouched.
  • Actively maintained with frequent releases and thorough documentation.

Watch out for

  • Still 0.x and moving quickly, so options and output can change between releases.
  • Each worktree is a full checkout: without the copy-on-write cache, dependencies and builds are repeated per worktree.
  • On Windows, wt clashes with Windows Terminal's command; winget installs it as git-wt instead.
  • Shell integration (wt config shell install) is needed for wt switch to change your directory.

Try it in a few minutes

Terminal
brew install worktrunk && wt config shell install   # or: cargo install worktrunk
wt switch -c -x claude feature-auth
wt list

Alternatives

Plain git worktree

Built in, but you type the branch name several times and clean up by hand.

Separate clones

Simple and fully isolated, but slow to create and easy to lose track of.

Desktop apps for parallel agents

Wrap worktrees in a GUI, at the cost of leaving your terminal workflow.

Related tools

Other tools that share topics with Worktrunk.

Aider

aider.chat
Gem

AI pair programming in your terminal that edits files and commits to git.

Instead of Copying code between a chat window and your editor

1 recommend

Jujutsu

jj-vcs.dev
Gem

A Git-compatible version control system where your working copy is always a commit and every operation can be undone.

Instead of The git CLI, interactive rebase and git stash

difftastic

difftastic.wilfred.me.uk
Gem

A diff tool that compares code by its syntax, not line by line.

Instead of The line-based output of git diff