| name | worktrunk |
| description | Git worktree management via the `wt` CLI. Use when asked to create worktrees, switch branches for parallel work, list worktrees, clean up old branches, or merge worktree branches. Triggers on "worktree", "worktrunk", "wt", "create branch", "new branch", "switch branch", "parallel branch". |
Worktrunk (wt) - Git Worktree Management
Manage git worktrees for parallel development workflows. Each worktree is an independent working directory with its own branch, allowing concurrent work without stashing or switching.
Agent Usage
Since agents cannot change directories interactively, always use --no-cd with wt switch and operate on the worktree path directly via the workdir parameter in Bash tool calls.
Get worktree path after creation
wt switch --create <branch> --no-cd --yes
wt list --format=json | jq -r '.[] | select(.branch == "<branch>") | .path'
Then use workdir=<path> for subsequent commands in that worktree.
Commands
Create a new worktree + branch
wt switch --create <branch-name> --no-cd --yes
--create / -c: Create a new branch (required for new branches)
--no-cd: Skip directory change (required for agents)
--yes / -y: Skip approval prompts (required for agents)
--base <branch>: Base branch (defaults to default branch)
--no-verify: Skip post-create/post-start hooks
wt switch --create feature-auth --no-cd --yes
wt switch --create hotfix --base production --no-cd --yes
Switch to an existing worktree
wt switch <branch> --no-cd --yes
Shortcuts: ^ (default branch), - (previous), @ (current), pr:123 (GitHub PR).
List worktrees
wt list
wt list --format=json
wt list --branches
wt list --full
Key JSON fields
| Field | Description |
|---|
branch | Branch name |
path | Worktree directory path |
main_state | Relation to default branch: ahead, behind, diverged, integrated, would_conflict |
is_current | Whether this is the current worktree |
working_tree.modified | Has uncommitted changes |
symbols | Status symbols (e.g., ! modified, ? untracked, ^ default, โ integrated) |
Useful JSON queries
wt list --format=json | jq -r '.[] | select(.branch == "feature") | .path'
wt list --format=json | jq -r '.[] | select(.main_state == "integrated" or .main_state == "empty") | .branch'
wt list --format=json | jq '.[] | select(.working_tree.modified) | .branch'
wt list --format=json | jq '.[] | select(.main.ahead > 0) | {branch, ahead: .main.ahead}'
Remove a worktree
wt remove --yes
wt remove <branch> --yes
wt remove <branch> --no-delete-branch --yes
wt remove <branch> -D --yes
wt remove <branch> --force --yes
Merge worktree branch into default
Squash + rebase, fast-forward target, remove worktree.
wt merge --yes
wt merge develop --yes
wt merge --no-remove --yes
wt merge --no-squash --yes
Individual operations (wt step)
wt step commit
wt step squash
wt step rebase
wt step push
wt step copy-ignored
Workflow Pattern for Agents
wt switch --create my-feature --no-cd --yes
path=$(wt list --format=json | jq -r '.[] | select(.branch == "my-feature") | .path')
wt merge --yes