A git worktree gives each agent its own working directory tied to the same repository, so one session can build a feature while a second fixes a bug without editing the same files (Claude Code docs). Worktree creation is cheap because the object database is shared, and the checked-out branch is private to that directory (MindStudio). None of that allocates a new database, port, container name or provider rate limit: "A Git worktree separates files and the index" and nothing else (Superset).
The collision that follows is predictable. Two agents point at the same PostgreSQL instance, agent A runs a migration, and agent B's schema is now out of sync; if both seed data, they trample each other's state (Trigger.dev). Teams running five agents in parallel describe database collisions as the silent killer, because every agent's end-to-end validation writes to the same rows (Cole Medin). The fix mirrors git exactly: a database branch per worktree, created with it and deleted with it, so an agent can run migrations and wipe tables freely because the blast radius stops at its own branch (database branching notes).
A decision rule that saves weeks: if the task never reads or writes persistent state, a worktree is enough. The moment a task runs a migration, a seed script or an integration test, it needs its own data context before it starts, not after it fails.



