Worktrunk: Git Worktree Manager for Parallel AI Agents
What Worktrunk is
Worktrunk is a command-line tool for managing git worktrees, designed around one specific workflow: running several AI coding agents in parallel on the same repository. The README's premise is that agents like Claude Code and Codex can now handle longer tasks without supervision, so it is realistic to have five to ten or more of them working at once. Git's native worktree feature already solves the isolation problem by giving each agent its own working directory, so they do not overwrite each other's changes. What it does not solve is ergonomics.
The README illustrates the friction with a small example: starting a new worktree in plain git means typing the branch name three times, as in git worktree add -b feat ../repo.feat followed by cd ../repo.feat. Cleaning up afterwards is another multi-step sequence. Worktrunk's goal is to make worktrees “as easy as branches” by addressing them by branch name and computing their paths from a configurable template. It ships as the wt binary and is aimed at developers who already juggle many parallel changes, whether those changes come from agents or from humans.
The README notes that the project was released at the start of 2026, and its author claims it “has quickly become the most popular git worktree manager.”
How Worktrunk works
Worktrunk sits on top of git's existing worktree support rather than replacing it. Every worktree is identified by the branch checked out in it, and its location on disk is derived from a path template you can configure. Commands that accept a branch name also accept the path of the worktree where that branch lives, so you can refer to things whichever way is convenient.
Because a CLI process cannot change its parent shell's working directory, Worktrunk relies on shell integration, installed with wt config shell install, so that wt switch can actually move you into the target worktree. The shell integration is tested against bash, zsh, fish, nushell and PowerShell according to the contributing section.
On top of the core commands, Worktrunk layers workflow automation: hooks that fire at points such as worktree creation, pre-merge and post-merge; an LLM-backed commit message generator that works from the diff; and a merge command that squashes, rebases, fast-forwards and cleans up in one step. The -x flag on wt switch runs a command after switching, which is how you launch an agent directly into a fresh worktree.
Key features
The README compares the core commands against their plain-git equivalents:
| Task | Worktrunk | Plain git |
|---|---|---|
| Switch worktrees | wt switch feat | cd ../repo.feat |
| Create and start Claude | 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) |
Beyond those, the advanced features include:
- Hooks: run commands on create, pre-merge, post-merge and other events, for example to install dependencies or start a dev server.
- LLM commit messages: generate commit messages from diffs.
- Merge workflow:
wt mergesquashes, rebases onto the target, fast-forward merges and removes the worktree and branch in one command. - Interactive picker: browse worktrees with streaming CI status plus diff, log, PR and comment previews.
- Shared build caches: give many worktrees directories like
target/andnode_modules/without rebuilding or copying them, using copy-on-write on APFS, btrfs and XFS. - Rich listing:
wt list --fulladds CI status and AI-generated summaries per branch. - PR checkout:
wt switch pr:123jumps straight to a pull request's branch. - Dev server per worktree: a
hash_porttemplate filter gives each worktree a unique port. - Aliases and per-branch variables: define custom
wt <name>commands and branch-scoped state for hook templates.
Getting started with Worktrunk
Install with Homebrew on macOS or Linux:
brew install worktrunk && wt config shell installOr with Cargo:
cargo install worktrunk && wt config shell installOn Windows, wt collides with the Windows Terminal command, so Winget also installs the tool as git-wt:
winget install max-sixty.worktrunk
git-wt config shell installArch Linux (sudo pacman -S worktrunk) and conda-forge packages are also listed. Once installed, create a worktree for a new feature:
$ wt switch --create feature-auth
✓ Created branch feature-auth from main and worktree @ ~/repo.feature-authWhen the work is done there are two paths. The PR workflow:
wt step commit # commit staged changes
gh pr create # or glab mr create
wt remove # after PR is mergedOr a local merge, which squashes, rebases onto main, fast-forwards and cleans up:
$ wt merge mainFor parallel agents, the README shows launching one agent per 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'Arguments after -- are passed to the command given with -x. Post-start hooks can then automate setup in each new worktree.
Use cases
- Fan-out agent work: give three or more coding agents separate tasks in separate worktrees from one terminal, then review and merge each result independently.
- Reviewing pull requests without stashing:
wt switch pr:123opens a PR's branch in its own worktree while your current work stays untouched. - Multiple dev servers at once: the
hash_portfilter lets each worktree run its own server on a stable, unique port, so you can compare branches side by side. - Large Rust or Node projects: copy-on-write cache sharing avoids paying the full build or install cost for every new worktree on supported filesystems.
- Fast local integration: for solo projects or trunk-based workflows,
wt mergecollapses commit, rebase, merge and cleanup into one step.
How Worktrunk compares
The direct comparison the README draws is with plain git worktree. Git provides the underlying mechanism; Worktrunk adds branch-based addressing, path templates, status-rich listing, hooks and merge automation. Teams that already script their own worktree helpers in shell will find similar ground covered here in a single maintained tool.
Worktrunk is also distinct from agent-orchestration apps that manage sessions in a GUI. It stays in the terminal and is agent-agnostic: anything you can launch from a shell can be started with -x, and the README demonstrates it alongside terminal multiplexers like Zellij. If you prefer a dashboard-driven tool, this is a lower-level building block rather than a replacement.
Things to know before adopting Worktrunk
- Shell integration is required for directory switching. Without
wt config shell install,wt switchcannot change your current directory. - Windows naming: the binary is installed as
git-wtvia Winget unless you disable the Windows Terminal alias. Windows builds are code-signed through SignPath. - Cache sharing is filesystem-dependent: the copy-on-write feature is documented for APFS, btrfs and XFS.
- LLM features: commit message generation and branch summaries call a model, so check how they are configured before enabling them on private code.
- Young project: the repository was created in October 2025 and publicly released at the start of 2026. The maintainer actively asks for friction reports, and the full documentation lives at worktrunk.dev.
- Permissive licensing: dual-licensed under MIT or Apache-2.0, so it is straightforward to use in commercial environments.
Project activity
As of October 2026 the max-sixty/worktrunk repository has roughly 8,600 stars. It was created on October 17, 2025, is written in Rust, and is dual-licensed under MIT OR Apache-2.0. Full documentation, including the hook reference and tips-and-patterns recipes, is at worktrunk.dev.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/max-sixty/worktrunk
GitHub - max-sixty/worktrunk: Worktrunk: Git Worktree Manager for Parallel AI Agents
Worktrunk is a Rust CLI that makes git worktrees as easy to use as branches, built for developers running several AI coding agents in parallel, with hooks, LLM ...
github - max-sixty/worktrunk

