{"slug": "worktrunk-the-git-cli-built-for-parallel-ai-agents", "title": "Worktrunk: The Git CLI Built for Parallel AI Agents", "summary": "Worktrunk, a Rust CLI created by Maximilian Roos, wraps git worktree management into three commands — wt switch, wt list, and wt merge — to support running parallel AI coding agents such as Claude Code and Codex on the same repository. The tool adds copy-on-write build cache sharing for directories like node_modules and target/, 11 lifecycle hook points, and LLM-generated worktree summaries and commit messages, and has drawn 6,500+ GitHub stars under dual MIT/Apache-2.0 licensing. Worktrunk installs via Homebrew on macOS or cargo on any platform, with a required wt config shell install step for shell integration.", "body_md": "Native git worktrees are genuinely useful — check out a branch in a separate directory, run your tests, switch back. But AI coding agents changed the calculus. Claude Code and Codex can now handle 30–60 minute tasks unsupervised, which means running four or five in parallel on the same repo is not a stretch; it’s just Tuesday. The problem is that native git worktree management wasn’t designed for that. Path-based commands, no lifecycle hooks, no build cache sharing, and six copies of `node_modules` eating your disk. [Worktrunk](https://github.com/max-sixty/worktrunk) — a Rust CLI by Maximilian Roos (creator of PRQL) — is the tooling layer that makes parallel agent workflows actually practical.\n\n## Three Commands That Replace All the Friction\n\nWorktrunk wraps the git worktree interface into three commands: `wt switch`, `wt list`, and `wt merge`. That’s not oversimplification — it’s genuinely the full workflow.\n\n**wt switch** opens an interactive picker with live diff previews when called without arguments. Pass a branch name and it switches directly. Add `-c` to create a new branch and worktree in one step, or pair it with `-x claude` to create the worktree and immediately launch Claude Code inside it:\n\n```\nwt switch -c feat/auth-refactor -x claude\n```\n\nThat single command replaces: `git worktree add ../repo.feat feature-branch`, then `cd ../repo.feat`, then `npm install`, then `claude`. And it doesn’t leave behind a manually tracked path you’ll forget about in a week.\n\n**wt list** gives you a single-pane view of every active worktree: uncommitted changes, divergence from the default branch, optional CI status, and LLM-generated summaries of what each agent is working on. When you have five parallel sessions running, this is the difference between context switching sanely and losing track of which branch is doing what.\n\n**wt merge** squash-rebases the current branch onto the target, fast-forwards, and removes the worktree. Unlike `git merge`, it merges the current branch into the target — the direction you almost always want when cleaning up a feature branch. Conflicts stop the rebase and leave the worktree open to resolve or abort. It also supports LLM-generated commit messages via diff piping, so you’re not writing “WIP: fixed stuff” at 2am.\n\n## The Feature That Actually Matters for Large Repos: Build Cache Sharing\n\nThe biggest practical argument against git worktrees in large projects isn’t the command syntax — it’s disk space and install time. Six worktrees means six copies of `node_modules` (750K+ files in a typical monorepo), each requiring a full `npm install` after creation. Worktrunk addresses this with copy-on-write build caches: it relinks `target/`, `node_modules/`, and similar directories into new worktrees so they inherit the existing cache. New worktrees skip the cold start. This changes the calculus from “spin up a worktree when you need to” to “keep five ready at all times.”\n\n## Hooks for Automation\n\nWorktrunk includes 11 lifecycle hook points — pre-switch, post-switch, post-start, pre-merge, and others — that run shell commands at each stage. The practical applications: auto-run `npm install` when a worktree is created, start a dev server on switch, run a test suite before merging. For a single worktree workflow, this is a nice-to-have. For parallel agent workflows where you’re creating and destroying worktrees frequently, hooks are what make it not feel like manual labor.\n\n## Install\n\nOn macOS:\n\n```\nbrew install worktrunk && wt config shell install\n```\n\nOr via cargo on any platform: `cargo install worktrunk && wt config shell install`. The `wt config shell install` step sets up shell integration — tab completion, directory switching — and is not optional if you want the full experience. The [official docs](https://worktrunk.dev/) are solid.\n\nThe project has 6,500+ GitHub stars and dual MIT/Apache-2.0 licensing. It’s mature enough for daily use but early enough that the rough edges are real: Windows setup is non-trivial ([community guide available](https://dev.to/arshtechpro/worktrunk-git-worktrees-made-simple-for-parallel-ai-agents-1106)), and cargo is still the most reliable install path across platforms. Claude Code v2.1.49 (February 2026) shipped a native `--worktree` / `-w` flag, which means the `-x claude` integration in Worktrunk is composing two tools that were built to work together. Codex CLI doesn’t have native worktree support yet — you’d still do manual `git worktree add` first.\n\n## The Verdict\n\nNative git worktrees are fine for switching between two branches. They’re not fine for managing a workflow where multiple Claude Code agents are concurrently rebuilding different subsystems of your codebase. [Worktrunk](https://github.com/max-sixty/worktrunk) fills exactly that gap. If you’re running parallel agents today, install it. If you’re not yet, the tooling is now good enough that the main bottleneck is review throughput — which is a different problem entirely.", "url": "https://wpnews.pro/news/worktrunk-the-git-cli-built-for-parallel-ai-agents", "canonical_source": "https://byteiota.com/worktrunk-parallel-ai-agents/", "published_at": "2026-09-21 17:06:05+00:00", "updated_at": "2026-09-21 17:23:34.024538+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Worktrunk", "Maximilian Roos", "Claude Code", "Codex", "PRQL", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/worktrunk-the-git-cli-built-for-parallel-ai-agents", "markdown": "https://wpnews.pro/news/worktrunk-the-git-cli-built-for-parallel-ai-agents.md", "text": "https://wpnews.pro/news/worktrunk-the-git-cli-built-for-parallel-ai-agents.txt", "jsonld": "https://wpnews.pro/news/worktrunk-the-git-cli-built-for-parallel-ai-agents.jsonld"}}