Why use two agents
There are two practical reasons. Their usage limits reset independently, so one can keep working while the other is waiting. And a model reviewing another model's code finds more problems than a model reviewing its own, because it does not share the same assumptions.
What you need
- Git, and a repository with at least one commit.
- Claude Code, signed in with a Claude plan that includes it or a Console account.
- Codex, signed in with your ChatGPT account or an API key.
- Two terminal windows. On Windows, PowerShell works for both.
1. Give each agent its own worktree
A git worktree is a second folder with its own branch that shares the repository history. Two agents in two worktrees cannot overwrite each other's files, and your main checkout stays untouched until you merge.
git worktree add ../myapp-claude -b feature-search
git worktree add ../myapp-codex -b feature-exportClaude Code can also create one for itself: claude --worktree feature-search places it under .claude/worktrees/ on a new branch. If you use it, add .claude/worktrees/ to your .gitignore.
2. Give each agent separate files
Worktrees keep the edits apart, but the branches still have to merge. Assign each agent a task in its own part of the codebase, for example search in one module and export in another. When two tasks need the same file, run them one after the other to avoid a conflict at merge time.
3. Start both agents
# window 1
cd ../myapp-claude
claude
# window 2
cd ../myapp-codex
codexDescribe each task precisely, including what counts as done: which tests must pass and what the user should see. Clear acceptance criteria are the biggest factor in the quality of the result.
4. Review each other's work
When Claude Code finishes feature-search, open Codex in that worktree and ask it to review the branch against main. When Codex finishes, do the opposite.
git diff main...feature-searchAsk the reviewer for concrete findings: bugs, missing tests, requirements that are not met. Then run your tests yourself before merging.
5. Merge and clean up
git checkout main
git merge feature-search
git worktree remove ../myapp-claudeThe same workflow, automated
Done by hand, this works well for two tasks. With more, the coordination takes over: assigning files, tracking which agent is doing what, watching the limits, reviewing every branch. Coterie is a Windows app that runs this workflow for you with the official CLIs and your own sign-ins.
- An architect model turns your goal into small tasks with clear criteria. Nothing starts until you confirm the plan.
- Every task gets its own worktree, and no two tasks work on the same files at once.
- A model from a different provider reviews every change, and Coterie runs your tests on the exact files reviewed.
- When one subscription reaches its limit, the next task goes to an agent that still has room.
- You try the finished result in its own window, then approve the merge or send it back with a note.