Agent bake-off

Give the same task to several agents, each on its own branch, then compare the results and keep the best one.

One worktree per contender

beswarm worktree add --name try-claude --workspace api
beswarm worktree add --name try-codex --workspace api
beswarm worktree add --name try-gemini --workspace api

Each add cuts a branch with the same name and prints the id of the terminal it opened in the worktree:

created worktree try-claude at ~/code/api/.worktrees/try-claude with terminal 18da9fb9f3d38fc0-3

Send everyone the same prompt

Save the task once as a file under ~/.beswarm/prompts, so every agent gets identical wording. End it with "commit your work", so each result lands on its branch. Then find its id:

beswarm prompt list

Start each agent in its worktree's terminal, using the ids add printed:

beswarm agent start --name claude-try --agent claude <terminal-id> --group bakeoff --prompt-id 3
beswarm agent start --name codex-try  --agent codex  <terminal-id> --group bakeoff --prompt-id 3
beswarm agent start --name gemini-try --agent gemini <terminal-id> --group bakeoff --prompt-id 3

beswarm agent kinds lists every agent your build supports.

Watch the race

beswarm agent list

Each agent shows as working, done, blocked or idle. Sound alerts tell you when one finishes.

Pick a winner

Compare the three branches yourself with git diff main...try-claude and so on, or give a judge agent a worktree of its own:

beswarm worktree add --name judge --workspace api
beswarm agent start --name judge --agent claude <terminal-id> --group bakeoff \
  --prompt "Compare git diff main...try-claude, main...try-codex and main...try-gemini against the task. Don't edit files. Write a ranked verdict to ../../reports/bakeoff.md." \
  --wait --timeout 1200

Clean up

Merge the winning branch, then close the group and remove every worktree:

beswarm agent close --group bakeoff
beswarm worktree remove --name try-claude --workspace api
beswarm worktree remove --name try-codex --workspace api
beswarm worktree remove --name try-gemini --workspace api
beswarm worktree remove --name judge --workspace api

note

worktree remove keeps a branch with unmerged commits, so the losing branches stay. Delete them with git branch -D once you're sure you don't need them.