Worktrunk (wt) for VS Code
A Worktrees sidebar for the wt CLI (must be on PATH, or set wt.path).
- Every worktree with its state: uncommitted changes, ahead/behind the default branch, merge conflicts, already-merged
- Create, switch, merge and remove worktrees from the view or the command palette
- Status bar showing the current worktree; click to switch
- Optional list of branches that have no worktree (open one to create its worktree)
- Optional PR and CI badges (
wt.showCi): #12 ✓, with the review state, branch summary and an "Open Pull Request" action
- Branch markers (🤖 working, 💬 waiting, or any text) shown on the row, set with "Set Marker..."
- "New Worktree with Agent..." runs
wt switch --create X -x claude -- "task" in a terminal (wt.agentCommand)
- "Switch to Pull Request..." runs
wt switch pr:N (or mr:N) and offers to open the worktree
- "Create From..." offers
^, @ and pr:N (a PR's head) as the base branch
- "Show Hook Logs..." opens hook output (per worktree from the context menu, or all from the view menu)
- Dev server link and a listening dot when the project defines
list.url
- Optional remote-only branches (
wt.showRemotes)
- Warnings for locked, prunable, mid-rebase/merge, duplicate and path-mismatched worktrees
Bare-repository layouts work: the view finds the repo through git rev-parse --git-common-dir.
Pull request switching needs gh or glab set up for wt. It is untested against a real forge here.
Create, remove, merge and prune run wt in a task terminal so hooks and output stay visible. The extension never passes -y.
The view refreshes when the git directory changes, when the window regains focus, on save, and every wt.refreshInterval seconds while visible.
Settings
| Setting |
Purpose |
wt.path |
The wt executable. Ignored in untrusted workspaces. |
wt.openIn |
newWindow or currentWindow when switching. |
wt.openAfterCreate |
ask, newWindow, currentWindow or never. |
wt.showBranches |
Also list branches without a worktree. |
wt.showRemotes |
Also list remote-only branches. Opening one creates a local tracking branch. |
wt.showCi |
Add wt list --full (PR, CI, summaries). Uses the network; polled at most every 120 s. |
wt.agentCommand |
Program for "New Worktree with Agent". Ignored in untrusted workspaces. |
wt.refreshInterval |
Polling seconds; 0 disables. |
wt.timeout |
Kill a hung wt list. |
In remote, WSL and container windows, wt must be installed on the remote side.
| |