Worktrunk: Git Worktrees Made Simple for Parallel AI Agents
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…
Claude Code and Codex AI coding agents can now operate on longer tasks independently. However, if they work in the same folder, their changes can clash. Git offers a solution called worktrees, allowing multiple branches to coexist in different directories. Yet, Git's worktree commands are cumbersome, requiring repetitive commands for each new worktree.
Worktrunk is a Rust-based command-line tool designed to simplify worktree management, presenting a more user-friendly approach. It is open source (MIT or Apache-2.0), released in early 2026, and has already gained over 5,000 stars on GitHub.
Worktrunk streamlines common tasks:
1. Switching to a worktree: wt switch feat
2. Creating and starting an agent: wt switch -c -x claude feat
3. Cleanup: wt remove
4. Listing worktrees with status: wt list
To get started, install Worktrunk via Homebrew or Cargo. The shell integration step is crucial, enabling Worktrunk to modify your current directory. Creating a worktree for a new feature is straightforward: wt switch --create feature-auth. Worktrunk also supports parallel execution of agents on different tasks. For instance, running three agents simultaneously on distinct features is easy:
1. wt switch -x claude -c feature-a
2. Add user authentication
3. wt switch -x claude -c feature-b
4. Fix the pagination bug
5. wt switch -x claude -c feature-c
6. Write tests for the API
Each agent works within its isolated worktree, preventing file clashes. Worktrunk provides additional features such as hooks for post-create or post-merge commands, LLM-generated commit messages, build cache copying, and PR checkout with wt switch pr:123. Multiple dev servers can run concurrently with unique ports per worktree. While Worktrunk is a relatively new project, its significant benefits make it worth considering, particularly for those managing multiple AI coding agents or juggling numerous branches.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.