wt (worktrunk)
Git worktree lifecycle management with hooks, LLM commits, an interactive picker and merge automation.
Everyday
Switch12
- Switch to existing worktree
- Interactive picker (TTY)
- Create new branch + worktree
- Create from specific base branch
- Picker includes all branches
- Picker includes remote branches
- Run command after switch
- Run command with extra args
- Remove stale paths at target
- Skip directory change
- Skip hooks
- Skip approval prompts
Switch shortcuts5
- Switch to default branch (main/master)
- Current branch / worktree
- Previous worktree (like cd -)
- GitHub PR #123's branch
- GitLab MR !42's branch
Interactive picker12
- Navigate worktree list
- Filter worktrees by name
- Switch to selected worktree
- Create new branch from query
- Cancel picker
- Preview tab: HEAD± (uncommitted)
- Preview tab: log (recent commits)
- Preview tab: main…± (branch diff)
- Preview tab: remote⇅ (tracking)
- Preview tab: summary (LLM)
- Toggle preview panel
- Scroll preview up / down
List and status8
- Show all worktrees with status
- Include branches without worktrees
- Include remote-only branches
- CI status, diffs, LLM summaries
- JSON output
- Claude Code format
- Progressive rendering (TTY)
- Single-line status for shell prompt
Remove9
- Remove current worktree
- Remove specific worktree
- Remove multiple worktrees
- Keep branch after removal
- Delete even unmerged branches
- Remove with untracked files
- Wait for completion
- Skip hooks
- Skip approval prompts
Merge and clean up11
- Merge current into default branch
- Merge into specific branch
- Preserve full commit history
- Skip commit / squash step
- Skip rebase before merge
- Keep worktree after merge
- Stage all files (default)
- Stage only tracked files
- Use already-staged files
- Skip hooks
- Skip approval prompts
Workflows
Step commands13
- LLM-generated commit message
- Stage only tracked files
- Commit already-staged only
- Show LLM prompt (dry run)
- Squash all branch commits into one
- Squash against specific branch
- Rebase onto default branch
- Rebase onto specific branch
- Fast-forward default branch
- Fast-forward specific branch
- Unified diff since branching
- Diff summary only
- Changed file names only
Step utilities12
- Copy gitignored files from main
- Copy from specific branch
- Copy to specific branch
- Preview what would be copied
- Overwrite existing files
- Run command in every worktree
- Swap branch into main worktree
- Remove merged worktrees
- Preview prune results
- Skip recent worktrees
- Move worktrees to expected paths
- Preview relocations
Hooks13
- List all configured hooks
- Show with resolved variables
- Run pre-switch hook
- Run post-create hook
- Run post-start hook (background)
- Run post-switch hook (background)
- Run pre-commit hook
- Run pre-merge hook
- Run post-merge hook
- Run pre-remove hook
- Run post-remove hook (background)
- Approve pending hooks
- Clear all approvals
Configure
Configuration15
- Create user config.toml
- Create project .config/wt.toml
- Display current config
- Full diagnostics (CI, LLM, version)
- Migrate deprecated settings
- Generate shell integration
- Install shell integration
- Remove shell integration
- Get default branch
- Set default branch
- Get previous branch
- Get CI status cache
- Set branch marker text
- View background logs
- Clear all stored state
Config file15
- Worktree path template
- LLM commit message command
- Default staging: all/tracked/none
- Squash on merge (default: true)
- Rebase before merge (default: true)
- Remove worktree after merge
- Picker preview pager (e.g. delta)
- Default list verbosity
- CI platform: github or gitlab
- Dev server URL template
- Hook: after worktree creation
- Hook: background after creation
- Hook: before merge (blocking)
- Hook: after worktree removal
- Patterns for copy-ignored
Environment variables9
- Override worktree path template
- Override LLM command
- Override default staging mode
- Config file location
- Approvals file location
- Override binary path
- Max parallel git ops (32)
- Disable colored output
- Force colored output
Reference
Status symbols11
- Staged / modified / untracked
- Merge conflicts present
- Rebase / merge in progress
- Branch has no worktree
- Branch-worktree path mismatch
- Default branch indicator
- Ahead / behind / diverged from main
- Same commit clean / dirty
- Branch fully merged into main
- Diverged / ahead / behind remote
- In sync with remote
Hook template variables13
- Branch name
- Absolute worktree path
- Worktree directory name
- Repo name / absolute path
- Main worktree path
- Default branch name
- Full / 7-char commit SHA
- Primary remote name / URL
- Target branch (merge hooks)
- Base branch (creation hooks)
- Replace / and \ with -
- Lowercase, underscores, hash
- Hash to port 10000–19999
Troubleshoot
Diagnostics and help9
- Show version
- Show help
- Verbose (hooks, templates)
- Debug report
- Run from directory
- Use specific config file
- Full diagnostics
- List all hooks
- Show hooks with resolved vars