A worktree isolates files and branch state; it does not remove the need to coordinate interfaces and merges.
The decision behind the technique
Two agents changing one checkout can overwrite uncommitted work or test against mixed states. Separate worktrees make each diff reviewable and reversible.
A worktree isolates files and branch state; it does not remove the need to coordinate interfaces and merges.
A practical step-by-step workflow
Use this sequence as a default, then tighten or expand it only when the evidence changes.
- Choose an explicit base branch
- Create one worktree and branch per task
- Run tests inside that worktree
- Review and merge each change independently
Failure boundary and finish line
Avoid assigning both worktrees ownership of the same API contract unless you plan the integration first.
Finish when the next action, owner, evidence and stop condition are all explicit.
Frequently asked questions
What should I do first?+
Choose an explicit base branch
What is the main failure mode?+
Avoid assigning both worktrees ownership of the same API contract unless you plan the integration first.
OFFICIAL SOURCES
Verify against the source
OpenAI worktree guidanceGit worktree manualThis guide provides general information, not an OpenAI allowance promise or support decision. Your account and official pages govern actual usage, benefits and recovery times.