Skip to content

chore: keep agent worktrees out of git and test discovery - #22

Merged
smiggleworth merged 1 commit into
mainfrom
chore/ignore-agent-worktrees
Sep 12, 2026
Merged

smiggleworth merged 1 commit into
mainfrom
chore/ignore-agent-worktrees

Conversation

@smiggleworth

Copy link
Copy Markdown
Contributor

Summary

Claude Code creates git worktrees under .claude/worktrees/. They are full checkouts of this repo, so vitest discovered their copy of every suite alongside the real ones.

Measured here before the fix: 28 test files discovered where only 6 exist, with the 22 duplicates failing. It only ever broke local runs — CI checks out clean, so the noise was invisible there.

Changes

  • test.exclude now covers **/.claude/** (vitest's own defaults are preserved alongside it)
  • .claude/ added to .gitignore, so a stray git add . can't commit a nested checkout

Verification

Test discovery drops to the real suites only, and the full check passes.

Claude Code creates git worktrees under .claude/worktrees/. They are full
checkouts of the repo, so vitest discovered their copy of every suite alongside
the real ones — this repo reported 28 test files where only 6 exist, with the
duplicates failing.

Exclude them from test discovery and add .claude/ to .gitignore.
@smiggleworth
smiggleworth merged commit f1cfdc9 into main Sep 12, 2026
6 checks passed
@smiggleworth
smiggleworth deleted the chore/ignore-agent-worktrees branch September 12, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant