Paired Sessions¶
Paired mode is the default in AgentPair. One agent works while the other reviews.
How It Works¶
┌─────────────────────────────────────────────────────────┐
│ Paired Session │
│ │
│ Primary (Codex) Secondary (Claude) │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Working │──────────────│ Reviewing │ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ │ Bridge Messages │ │
│ └────────────────────────────┘ │
│ │
│ Iteration 1: Codex implements, Claude reviews │
│ Iteration 2: Codex fixes issues, Claude re-reviews │
│ Iteration 3: Both signal DONE/PASS → Complete │
└─────────────────────────────────────────────────────────┘
Starting a Paired Session¶
# Default: Codex works, Claude reviews
agentpair --prompt "Implement user authentication"
# Claude works, Codex reviews
agentpair --agent claude --prompt "Implement user authentication"
Review Modes¶
Control who reviews with --review:
| Mode | Behavior |
|---|---|
claude |
Only Claude reviews |
codex |
Only Codex reviews |
claudex |
Both review; consensus required |
# Only Claude reviews Codex's work
agentpair --review claude --prompt "Add API endpoints"
# Both review (default)
agentpair --review claudex --prompt "Implement OAuth"
Consensus Mode (claudex)¶
In claudex mode:
- Primary agent completes work
- Both agents review in parallel
- Both must signal PASS for completion
- If either signals FAIL, work continues
Proof Requirements¶
Use --proof to specify verification criteria:
The proof requirement is passed to agents so they know how to verify their work.
Iteration Limits¶
Control maximum iterations:
Default is 20 iterations.
Custom Done Signal¶
Change the completion signal:
Agents should output this signal when they're done.
Example Workflow¶
Feature Development¶
agentpair --tmux --prompt "Implement a REST API for blog posts" \
--proof "Run 'go test ./... && curl localhost:8080/posts'" \
--max-iterations 15
Flow:
- Iteration 1: Codex creates basic API structure
- Iteration 2: Claude reviews, requests error handling
- Iteration 3: Codex adds error handling
- Iteration 4: Claude reviews, requests tests
- Iteration 5: Codex adds tests
- Iteration 6: Claude reviews, signals PASS
- Complete: Both agents satisfied
Bug Fix¶
agentpair --prompt "Fix the race condition in cache.go" \
--proof "Run 'go test -race ./...' with no races" \
--agent claude # Claude is better at concurrency
Code Review Focus¶
Monitoring¶
Watch in Real-Time¶
Check Status¶
Best Practices¶
- Be specific with prompts — Clear prompts lead to faster convergence
- Include proof requirements — Helps agents know when they're done
- Use appropriate iterations — Complex tasks need more iterations
- Monitor initial runs — Watch with
--tmuxuntil you trust the flow - Start small — Test with simple tasks before complex ones
Troubleshooting¶
Agents Not Converging¶
- Increase
--max-iterations - Add clearer
--proofrequirements - Simplify the task prompt
Review Loops¶
If agents keep requesting changes:
- Check
--reviewmode (try single reviewer) - Add explicit acceptance criteria
- Review bridge messages for patterns
Communication Issues¶
Check bridge status:
Look for:
- Message counts (should increase over time)
- Signal patterns (DONE/PASS/FAIL)
- Agent distribution (both should be sending)
Next Steps¶
- Single-Agent Mode — Simpler tasks
- tmux Layout — Visual monitoring
- Resuming Runs — Continue interrupted sessions