Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

Manage Git worktrees for parallel AI agents with Worktrunk

Written November 6, 2026

Manages Git worktrees for parallel AI agents. What it does, what it needs, and where it breaks.

Agents like Claude Code and Codex can now handle long tasks without supervision, so running five to ten in parallel is realistic. Git's worktree feature gives each agent its own working directory, so they don't step on each other's changes — but the worktree commands are clumsy. Starting one means typing the branch name three times: git worktree add -b feat ../repo.feat, then changing directory by hand. Worktrunk is a command-line tool that reduces that to one command per worktree, with the parallel-agent workflow as its stated purpose.

The three core commands

Worktrunk addresses worktrees by branch name and computes paths from a configurable template. The core commands, from the project README:

TaskWorktrunkPlain git
Switch worktreeswt switch featcd ../repo.feat
Create + start Claudewt switch -c -x claude featgit worktree add -b feat ../repo.feat && cd ../repo.feat && claude
Clean upwt removecd ../repo && git worktree remove ../repo.feat && git branch -d feat
List with statuswt listgit worktree list (paths only)

The -x flag runs a command after switching, and anything after -- is passed to it. That is the parallel-agent pattern in one line each:

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'

Each agent gets its own branch, its own directory, and its own task. Hooks automate the setup inside each worktree — installing dependencies, starting dev servers — so a new worktree is ready for the agent rather than empty.

What else it does

Install

Homebrew on macOS and Linux: brew install worktrunk && wt config shell install. Cargo: cargo install worktrunk && wt config shell install. On Windows, wt collides with Windows Terminal's command, so Winget installs it as git-wt. Arch Linux, Conda, and Pixi packages exist as well. The shell integration step matters: it is what lets wt switch change your directory.

Sandbox check: two worktrees, no agents

The worktree mechanics were checked in a scratch repository with Worktrunk v0.81.0, the release binary downloaded from the project's GitHub releases and matched against the release's published checksum. wt switch -c feature-a and wt switch -c feature-b each created a branch and a worktree next to the main checkout, and wt list showed all three with their status. Two things came out of the check. First, without shell integration installed, wt switch creates the worktree but prints "Cannot change directory — shell integration not installed" and stays put; run wt config shell install for the automatic directory change. Second, no agent was launched inside either worktree — the check covers worktree creation and listing, not an agent session, so the parallel-agent half of the workflow is the README's claim, not a measured result here.

Where it breaks

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Run parallel subagents in Claude Code · Have one agent write the code and a second agent check it in the background · Review Copilot's work in a nested Claude session