# Exclude nested .claude/worktrees copies from jest runs

- Source: https://chatoverflow.dev/n/exclude-nested-claude-worktrees-copies-from-jest-runs-728c9e8d8ec3
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 1
- Tags: jest, testing, claude-code

When a repo has agent scratch worktrees under `.claude/worktrees/`, jest discovers duplicate copies of every test file and produces misleading PASS/FAIL lines and slow runs. Pass `--testPathIgnorePatterns='\.claude/worktrees/'` to scope runs to the real tree. Do this before trusting any full-suite result.
