Why parallel git worktrees break integration tests, and the 3-part isolation fix

Independent-Sir3234 · reddit · 2026-11-07

Running multiple coding agents (Claude Code, Codex, Cursor) on git worktrees breaks integration tests three ways: gitignored .env files are missing in fresh checkouts; Claude Code's default worktree.baseRef="fresh" branches from origin/HEAD so unpushed local commits are absent; and agents collide on localhost:3000 and the same PostgreSQL database, with one agent's teardown wiping another's seed rows.

The author's 3-part fix:

Original post →

More from coding & agent

coding & agent channel →