cd /news/ai-agents/worktrunk-git-worktrees-made-simple-… · home topics ai-agents article
[ARTICLE · art-134791] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Worktrunk: Git Worktrees Made Simple for Parallel AI Agents

A developer released Worktrunk, an open-source Rust command-line tool that simplifies Git worktrees for running parallel AI coding agents like Claude Code and Codex. The tool, released in early 2026 under MIT or Apache-2.0 licenses, has surpassed 5,000 GitHub stars and lets users create, switch, and clean up isolated worktrees by branch name, with a `-x` flag for launching agents in separate directories.

by read3 min views1 publishedSep 19, 2026

AI coding agents like Claude Code and Codex can now work on longer tasks without supervision. That means you can realistically run several of them at once, each on a different feature or bug.

The catch: if they all work in the same folder, they overwrite each other's changes. Git has a built-in answer for this called worktrees. A worktree is a separate working directory attached to the same repository, so each branch can live in its own folder at the same time.

The problem is that git's worktree commands are clunky. Just starting a new one looks like this:

git worktree add -b feat ../repo.feat
cd ../repo.feat

You type the branch name three times. Cleaning up afterward takes another three commands. Do this ten times a day and it gets old fast.

Worktrunk is a command-line tool, written in Rust, that makes worktrees as easy to use as regular branches. You refer to everything by branch name, and Worktrunk works out the folder paths for you.

It's open source (MIT or Apache-2.0), was released at the start of 2026, and already has over 5k stars on GitHub.

Here's how Worktrunk compares with plain git:

Task Worktrunk Plain git
Switch to a worktree wt switch feat cd ../repo.feat
Create and start an agent wt switch -c -x claude feat git worktree add -b feat ../repo.feat && cd ../repo.feat && claude
Clean up wt remove cd ../repo && git worktree remove ../repo.feat && git branch -d feat
List with status wt list git worktree list (paths only)

Four commands cover most of what you'll do day to day.

Install with Homebrew (macOS and Linux):

brew install worktrunk && wt config shell install

Or with Cargo:

cargo install worktrunk && wt config shell install

The wt config shell install step matters. It adds shell integration so wt can actually change your current directory.

Create a worktree for a new feature:

wt switch --create feature-auth

This creates the branch and the worktree, then moves you into it. Check all your worktrees and their status with:

wt list

When you're done, you can open a PR as usual and run wt remove after it merges. Or merge locally with one command:

wt merge main

That commits your changes, rebases onto main, merges, and removes the worktree and branch.

This is where Worktrunk shines. Start three agents on three tasks, each in its own isolated worktree:

wt switch -x claude -c feature-a -- 'Add user authentication'
wt switch -x claude -c feature-b -- 'Fix the pagination bug'
wt switch -x claude -c feature-c -- 'Write tests for the API'

The -x flag runs a command after switching, and everything after -- is passed to that command. No agent touches another agent's files.

Beyond the basics, Worktrunk includes:

node_modules/ or target/ instead of starting cold.wt switch pr:123. Yes, if you:

A few honest caveats. It's a young project, so expect frequent releases and occasional changes. Every worktree is a full copy of your working files, so large repos use more disk space (the cache-copying feature helps, but doesn't remove this). On Windows, wt clashes with the Windows Terminal command, so it installs as git-wt instead unless you disable that alias. And if you only ever work on one branch at a time, plain git switch is all you need.

If parallel agents are part of your workflow, Worktrunk removes most of the friction of worktrees. Install it, spin up two worktrees, and you'll know within ten minutes whether it sticks.

── more in #ai-agents 4 stories · sorted by recency
── more on @worktrunk 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/worktrunk-git-worktr…] indexed:0 read:3min 2026-09-19 ·