Illustration of what worktrunk does: A command-line tool that makes git worktrees as easy to use as branches

max-sixty /

worktrunk

A command-line tool that makes git worktrees as easy to use as branches

Git worktrees let you check out several branches at once, each in its own folder. That helps when you run several AI coding agents, such as Claude Code or Codex, because they can't overwrite each other's changes. The plain git commands are clumsy, though. Starting a new worktree means typing the branch name several times and then changing directory by hand.

Worktrunk addresses worktrees by branch name and works out the folder path from a configurable template. wt switch -c feat creates a branch and worktree and moves you into it. wt list shows every worktree with its status. wt merge squashes, rebases, merges and cleans up. wt remove deletes the worktree and branch. Shell integration is what lets these commands change your directory.

The README compares it only with plain git. On top of that it adds hooks that run on create or merge, optional LLM-written commit messages, an interactive picker, and shared build caches such as target/ and node_modules/ on filesystems that support copy-on-write (APFS, btrfs, XFS).

What it does

  • Short core commands

    wt switch, wt list, wt merge and wt remove replace multi-step git sequences. wt switch -c -x claude feat creates a worktree and starts Claude in it.

  • Hooks for local workflows

    Run commands when a worktree is created, before a merge or after one. The README mentions installing dependencies and starting dev servers.

  • One-command merge

    wt merge main commits, squashes, rebases, fast-forward merges into main and removes the worktree and branch. Commit messages can be generated by an LLM.

  • Status at a glance

    wt list shows staged changes, commits ahead of main and unpushed commits. wt list --full adds CI status and AI-generated summaries per branch.

  • PR checkout and shared caches

    wt switch pr:123 jumps to a pull request's branch. Build folders can be shared across worktrees instead of rebuilt.

What you could build

  • Launch several Claude Code or Codex agents, each on its own branch and worktree, with one command per task.
  • Review a colleague's pull request in a separate worktree without disturbing your current work.
  • Merge a finished feature into main with squash and rebase, then clean up the branch and folder.
  • Give each worktree its own dev server port using the hash_port template filter.
  • Automate setup of new worktrees by installing dependencies through post-start hooks.

Get started

Install with Homebrew or Cargo, then run the shell integration step so commands can change your directory. Create a worktree with wt switch --create <branch>, check progress with wt list, and finish with wt merge main or a PR followed by wt remove. On Windows the README says to use winget and the git-wt name.

brew install worktrunk && wt config shell install
cargo install worktrunk && wt config shell install
wt switch --create feature-auth

Commands are copied from the project's README. Read it on GitHub for the full setup.

More in Coding agents & dev tools

    ↑↓ to move, Enter to open, Esc to close