Summary
Launching 3 Claude Code agents in parallel withisolation: "worktree" generated 320 new tests across 3 packages (CRDT, n8n-exporter, IR) in ~4 minutes. The key enabler: giving each agent the COMPLETE source code of every file it needs to test, not summaries.
The Pattern
What Makes It Work
- Complete source context: Each agent prompt included “Read ALL source files in packages/X/src/ — I need to understand every function, export, and type.” Agents that receive summaries write shallow tests; agents that see exact signatures write precise assertions.
- Existing test pattern: Including the existing test file shows the agent the project’s test conventions (vitest, describe/it, factory functions, temp directories).
-
Worktree isolation:
isolation: "worktree"gives each agent a git worktree so they don’t conflict. Files written by agents persist in the main repo. - Independence: The 3 packages have no test-time dependencies on each other, so parallel execution is safe.
Anti-Pattern: Summarized Prompts
If you tell an agent “write tests for the CRDT package” without providing source code, it will:- Guess at function signatures
- Miss edge cases in type handling
- Write tests for functions that don’t exist
- Use wrong import paths