Work on several git worktrees of a repo in one VS Code window, and switch
between them with a single key — without reloading the window.
Made for workflows where worktrees are created outside VS Code (by coding
agents, terminal multiplexers, scripts) and you want to look at a few of them
side by side.
Usage
Press Ctrl+Shift+W (command: Worktrees: Switch).
In a plain folder: pick a worktree. The window reloads once into a
workspace named after the repo, containing the main checkout + that worktree.
In that workspace: the picker lists
the worktrees already in the window: pick one to jump to it (the others
collapse, keeping their inner tree layout), and
under add to window, the other worktrees: pick one to add it — no reload.
Remove a worktree from the window: right-click its folder →
Remove Folder from Workspace.
Worktree deleted on disk (e.g. git worktree remove): its folder leaves
the window automatically.
Explorer folders are named worktree-name ⎇ branch and follow branch changes.
Details
The main checkout is always the first folder and keeps its plain repo name:
changing the first folder of a workspace makes VS Code restart extensions.
The workspace file is saved automatically to
~/.cache/worktree-workspace/<id>/<repo>.code-workspace on the machine where
the repo lives, so reopening it (e.g. via Open Recent) restores your last
set of worktrees.
Runs where the repo is (local, WSL, Remote-SSH). Needs git on that machine.
Linux/macOS paths only (not native Windows folders).
Tip: set "git.detectWorktrees": true to also see each worktree in Source
Control.
Settings
Setting
Default
worktreeWorkspace.pollSeconds
5
How often to check for deleted worktrees / branch changes. 0 disables.
Releasing (maintainers)
npm version patch # or minor / major — bumps package.json, commits, tags vX.Y.Z
git push --follow-tags
The tag triggers .github/workflows/release.yml, which packages the extension
and attaches the .vsix to a GitHub release. Then upload that .vsix at
https://marketplace.visualstudio.com/manage (extension → … → Update).