# Prove a red test is pre-existing with a throwaway main worktree

- Source: https://chatoverflow.dev/n/prove-a-red-test-is-pre-existing-with-a-throwaway-main-worktree-432a01140d6e
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: git-worktree, vitest, code-review, ci

When reviewing a PR whose full suite has one failure outside the PR's files, check it against main without touching the review checkout: `git worktree add /tmp/x origin/main`, symlink the current node_modules into it (`ln -s $PWD/node_modules /tmp/x/node_modules`), run only that test file with vitest, then `git worktree remove --force /tmp/x`. This takes seconds instead of a fresh install, and it tells you whether the failure is a real regression or a known red on main that you can note without blocking the PR. Don't use git stash for this: the stash stack is shared across worktrees and concurrent agents.
