Variants
Give one task to two to four agents, each in a worktree of its own, compare their work side by side and keep the winner.
A variant run hands the same task to two to four variants at once. Each variant is a harness with an optional model and an optional extra instruction, working as a Worker session in a git worktree of its own. When they finish, you compare their diffs, tests, cost, tokens and time in the Variants view and pick a winner; the others are discarded with their worktrees.
A run belongs to the group it started from, and the group must be inside a git repository.
Start a run
Open the draft
Run Run the task as variants… from the command palette, or choose As variants… in the New session sheet. The sheet is titled "Compare variants".
Write the task
Task is the prompt every variant works on.
Set the variants
Under Variants, each row has a harness (Claude Code, Codex, opencode or an ACP agent), a Model (optional) and an Extra instruction for this variant (optional). Add a variant adds a row, up to four; a run keeps at least two.
Choose the tests
Tests after each variant finishes lists the group's project tasks, such as its package.json scripts or Cargo commands, or None. The chosen task runs in each worktree once its variant finishes.
Launch
Launch variants opens one worktree and one Worker session per variant. When a budget per group is set, the draft warns if the run could take the group near or over it; see Usage and cost.
Each variant's worktree is named after the run and the variant, such as variant-5-2. When every variant of a run is done, a toast says "Variants of run 5 are ready to compare".
Compare
Open the Variants view with Compare variants in the command palette. It lists the group's runs, with each run's total cost, tokens and wall time, and one column per variant:
| In each column | What |
|---|---|
| State | Starting, Working, Running tests, Finished, Failed, Worktree missing, Discarded or Winner |
| Diff | The files it changed, up to eight listed, or "No diff yet" |
| Tests | Tests passed, Tests failed, Tests could not run, or "No tests chosen" |
| Cost and tokens | What the variant spent |
| Time | "Running for" while it works, "Took" once done |
The cheapest and the fastest variants are marked Cheapest and Fastest. Each column has Open, which goes to the variant's session, Run tests, and Pick.
Pick the winner
Pick asks for confirmation: the other variants are discarded and their worktrees and branches removed. Choose what happens to the winner, then Pick the winner:
| Outcome | What happens |
|---|---|
| Keep its worktree as the session | The winner's worktree stays, with its session |
| Apply its changes onto the base worktree | The winner's changes are applied onto the worktree the run started from, to review and commit there |
Only a variant that finished its work can win, and a run has one winner. From the CLI, a lead picks with krad variants pick <run id> <variant> [--apply] --yes; without --yes it is refused.
Variant runs publish app events: variants_started, variants_finished and variant_winner_chosen. An automation can be triggered when variants finish.
Lead and Workers
Turn a chat into the session's lead so it splits the work and starts and directs Workers in sessions of their own.
Session templates and issues
JSON templates in the repository that set a new session's harness, model, worktree, MCP servers, name and first prompt, and sessions started from a GitHub or GitLab issue.