Builder + reviewer
Pair two agents on one change: a builder that writes the code and a reviewer that critiques each round, looping until the reviewer has nothing actionable left. Using different agents for the two roles catches more than one agent reviewing itself.
Set up one worktree
beswarm worktree add --name feat-export --workspace app
beswarm status # find the new terminal idStart the pair
The builder edits; the reviewer only reads:
beswarm agent start --name builder --agent claude <terminal-id> --group pair \
--prompt "Add CSV export to the reports page. Run the tests before you finish." --wait --timeout 1800
beswarm agent start --name reviewer --agent codex --group pair --no-focusRun a review round
beswarm agent prompt --name reviewer --wait --timeout 900 \
--prompt "Review the uncommitted diff in .worktrees/feat-export. Don't edit files. Write only actionable findings, numbered, to reports/pair/round.md. If there are none, write exactly: LGTM."Feed findings back
The builder works inside .worktrees/feat-export/, so it reads the review from ../../reports/.
beswarm agent prompt --name builder --wait --timeout 1800 \
--prompt "Address the findings in ../../reports/pair/round.md. Rerun the tests."Repeat the two steps until the review says LGTM.
Script the loop
for round in 1 2 3; do
beswarm agent prompt --name reviewer --wait --timeout 900 \
--prompt "Review the uncommitted diff in .worktrees/feat-export. Don't edit files. Write only actionable findings to reports/pair/round.md, or exactly LGTM if there are none."
grep -qx LGTM reports/pair/round.md && break
beswarm agent prompt --name builder --wait --timeout 1800 \
--prompt "Address the findings in ../../reports/pair/round.md. Rerun the tests."
donenote
Cap the rounds. If the pair hasn't converged after three, read the last review yourself. The disagreement is usually a design question only you can answer.
When you're happy, merge the branch and run beswarm agent close --group pair.