Worktrunk (wt) is a command-line tool for git worktree management, designed for running several AI coding agents such as Claude Code and Codex in parallel, each in its own working directory so they do not step on each other's changes. Worktrees are addressed by branch name and their paths come from a configurable template, so you work with worktrees the way you work with branches; any command that takes a branch also accepts the path of its worktree.
| 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) |
For parallel agents you run wt switch -x claude -c feature-a -- 'Add user authentication' once per task; the -x flag runs a command after switching and arguments after -- are passed to it. wt list shows staged changes, commits ahead of main, and unpushed commits per worktree. When work is done, wt merge main commits, squashes, rebases onto main, fast-forward merges, and removes the worktree and branch in one step, or you push and open a pull request and run wt remove afterwards. Shell integration lets commands change your current directory; on Windows the binary also installs as git-wt to avoid the Windows Terminal alias.
Features
- Hooks: run commands on create, pre-merge, post-merge, and other lifecycle points to install dependencies or start dev servers
- LLM commit messages: commit messages generated from diffs
- Merge workflow: squash, rebase, merge, and clean up in one command
- Interactive picker: browse worktrees with live diff and log previews
- Copy build caches: share target/, node_modules/, and other ignored directories between worktrees to skip cold starts
- Full listing: wt list --full adds CI status and AI-generated per-branch summaries
- PR checkout: wt switch pr:123 jumps to a pull or merge request's branch
- Dev server per worktree: a hash_port template filter gives each worktree a unique port
- Aliases and per-branch variables: custom wt commands and branch-scoped state for hook templates
- Claude Code integration: documented patterns for launching and handing off agents per worktree
