One-sentence summary:
vx worktrunk(aliasvx wt) manages Git worktrees so you can run multiple AI agents in parallel without conflicts.
worktrunk is a Rust CLI tool designed for parallel AI agent workflows. It makes Git worktrees as easy to use as branches, with quality-of-life features like hooks, LLM commit messages, and per-worktree dev servers.
When running multiple AI agents (Claude Code, Codex, etc.) on the same repo, they conflict:
src/main.rssrc/main.rs → conflictSolution: Give each agent its own worktree (isolated working directory).
text
Main repo: ~/projects/my-app/ (main branch)
Agent 1: ~/projects/my-app.wt/feat-auth/ (feat/auth branch)
Agent 2: ~/projects/my-app.wt/feat-pay/ (feat/pay branch)
bash
vx install worktrunk
vx worktrunk --version # verify
wt switch — Navigate Worktrees#bash
# Create new worktree + switch to it
vx wt switch -c feat/auth
# Switch to existing worktree
vx wt switch feat/auth
# Switch back to main repo
vx wt switch -
# Create AND launch an AI agent in one command
vx wt switch -c -x claude feat/auth
wt list — Show All Worktrees#bash
vx wt list # compact list
vx wt list --full # with CI status, AI-generated summaries, diff preview
wt merge — Clean Merge Workflow#bash
vx wt merge # squash merge + delete worktree + delete branch
vx wt merge --rebase # rebase merge
vx wt merge --keep # merge but keep worktree
wt remove — Clean Up#bash
vx wt remove feat/auth # remove worktree only
vx wt remove --with-branch feat/auth # remove worktree + branch
bash
vx wt switch pr:123 # checkout PR #123 into a worktree
Configure in .worktrunk/hooks.toml:
toml
[post_create]
command = "npm install" # auto-install deps on create
[pre_merge]
command = "vx run test" # run tests before merge
bash
# Copy node_modules/ to new worktree (skip cold install)
vx wt switch -c --copy-cache feat/auth
worktrunk can assign each worktree a unique port (via hash_port template filter):
bash
# In package.json:
"scripts": {
"dev": "next dev -p {{ hash_port 3000 }}"
}
# Main repo → port 3000
# feat/auth → port 3217 (deterministic hash)
bash
# 1. Main repo: assign tasks to agents
cd ~/projects/my-app
echo "Add JWT auth" > .AITASK
# 2. Create isolated worktree for agent 1
vx wt switch -c -x claude feat/auth
# (inside worktree, agent runs autonomously)
# Agent modifies files, commits, etc.
# 3. Meanwhile, create another worktree for agent 2
vx wt switch -c -x claude feat/pay
# 4. When agents finish, merge both
vx wt merge feat/auth
vx wt merge feat/pay
worktrunk is installed and managed by vx:
bash
# Install
vx install worktrunk
# Run (vx auto-installs if missing)
vx worktrunk --version
vx wt switch -c feat/auth
# Update
vx install worktrunk@latest
CommandDescriptionvx wt switch [branch]Switch to worktreevx wt switch -c [branch]Create worktree + switchvx wt switch -c -x <cmd> [branch]Create + run command (e.g., launch AI agent)vx wt switch pr:<number>Checkout PR into worktreevx wt listList worktreesvx wt list --fullDetailed list with CI/LLM summaryvx wt mergeSquash merge + cleanupvx wt remove [branch]Remove worktreevx wt remove --with-branch [branch]Remove worktree + branch
vx wt switch -c to create isolated environments before making changes-x claude to automatically launch the AI agent in the new worktreevx wt merge instead of manual git merge — it handles worktree cleanup.worktrunk/hooks.toml to auto-install dependencies on create--copy-cache to share node_modules/ / target/ between worktreesGitHub PRs, CI runs, and dashboards are supporting evidence, not the delivery surface. The conclusion has to land where the work is tracked.
Concretely: the delivery surface is the team's issue or task tracker — the issue comment plus its metadata. A PR comment alone delivers nothing.