How do I give two agents the same task and compare results?
Give each agent its own branch and worktree, hand both the identical prompt, and diff the branches when they finish. git diff main..attempt-a against git diff main..attempt-b shows you two independent solutions to the same problem, and you keep the better one or cherry-pick from both.
This works because the attempts do not share a working directory, so their ordinary in-repo edits remain separate. Worktrees do not sandbox shell side effects or external services. It is worth doing when the approach is genuinely uncertain, and wasteful when the task has one obvious shape. See git worktrees for parallel development and running two agents on the same repo.