The shortcut is real.
VS Code 1.140 adds the experimental git.worktreeSymlinkFolders setting. You give it gitignore-style patterns such as node_modules. When VS Code creates a worktree, it links matching ignored folders to the current checkout instead of installing or copying them again.[1]
This attacks a real cost. Parallel agent work often creates short-lived worktrees. Reinstalling a large dependency tree for every branch wastes time and disk. A link makes the second worktree ready sooner.
The folder is faster because it is the same folder.
Git isolation does not extend through your link.
Git worktrees let one repository check out more than one branch at once. Git keeps metadata that distinguishes each working tree. A symlink to an ignored directory is outside that branch separation. Both paths can reach the same bytes.[2]
The word "ignored" does not mean disposable or safe to share. Git defines ignored files as intentionally untracked files. Files already tracked by Git are not affected by ignore rules. The rule says what Git omits from status and commits. It says nothing about whether two running tools may mutate the same directory safely.[3]
Installed trees have writers.
A dependency directory records more than downloaded packages. Its shape can depend on the lockfile, runtime, operating system, architecture, package-manager version, install flags, optional dependencies, and lifecycle scripts. Two branches can disagree on any of those inputs.
npm documents one hard example. npm ci requires a lockfile, refuses a package and lock mismatch, and automatically removes an existing node_modules before installation. That clean-install behavior is useful. It also proves that an installed tree is a mutable target, not a passive cache.[4]
Share by artifact class.
A download cache is keyed storage. It is designed to serve many installs. An installed dependency tree is resolved output for one environment. Build output and test coverage belong to one revision and command. These folders may all appear in .gitignore, but they do not have the same ownership rules.
Start with the safest speedup. Share the package-manager download cache. If you share an installed tree, require matching lockfile bytes, runtime and platform, install flags, and one writer at a time. Keep dist, coverage, generated code, and branch-specific databases inside each worktree.