best-of-n

best-of-n is a skill for Claude Code, Codex from kirodotdev/KiroCrew. It costs 59 tokens per session (1,634 once invoked), scanned A, original, Apache-2.0.

A workflow that gives the same coding task to several AI models in separate Git worktrees, which are isolated working folders connected to one repository. It compares the resulting changes and applies only the attempt you choose.

In plain words
What is it for?
Use it when you explicitly want several models to implement one change and then select the best result.
Why use it?
It makes it easier to compare independent implementations without mixing their files. It also prevents an expensive multi-model run from starting without your confirmation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when you explicitly want several models to implement one change and then select the best result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kirodotdev/kirocrew/best-of-n
About the project

Kiro Crew is a persistent development workspace where agents continue multi-step software work across sessions, schedules, and connected interfaces. Developers use it locally or remotely through a desktop app, web dashboard, CLI, Slack, or Discord, with unattended tasks and recurring jobs. The catalogue contains skills and instructions for working with this workspace.

kirodotdev/KiroCrew · 5,114 stars · on GitHub · kiro.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kirodotdev/KiroCrew --skill best-of-n
Clone the repo
git clone --depth 1 https://github.com/kirodotdev/KiroCrew

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for best-of-n

README.md
[![agentmods](https://agentmods.dev/badge/skills/kirodotdev/kirocrew/best-of-n/github.svg)](https://agentmods.dev/skills/kirodotdev/kirocrew/best-of-n)
Your own site
<a href="https://agentmods.dev/skills/kirodotdev/kirocrew/best-of-n"><img src="https://agentmods.dev/badge/skills/kirodotdev/kirocrew/best-of-n/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for best-of-n

Your own site · 80×15
<a href="https://agentmods.dev/skills/kirodotdev/kirocrew/best-of-n"><img src="https://agentmods.dev/badge/skills/kirodotdev/kirocrew/best-of-n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.01634
Opus 5.5 $0.00024 $0.00654
Sonnet 5.5 $0.00012 $0.00327
Haiku 4.5 $0.00006 $0.00163

Measured today against content hash 2a8f1b2006f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

best-of-n scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/kiro_crew/builtin_skills/best-of-n/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Best of n: one task, several models, compare, keep one

Run the same change on several models at once, each in its own detached git worktree, then compare the attempts and keep only the one the person picks.

This is for comparing attempts at a change, on the person's explicit request. It is not for debate or a second opinion on a question: use llm-council for that.

When not to use

  • One model is enough, or the person did not ask for several models.
  • The work folder is not a git repository.
  • The task is a question or a review, not a change to files.

Never start this on your own because a task looks hard.

Step 0: check the ground

  1. The work folder is in a git repository with a commit at HEAD.
  2. The repository, and the worktree that will sit beside it, are both under agent.subagent_cwd_allowed_roots (the defaults are ~/workspace, ~/workspaces, ~/workplace and ~/workplaces). If not, tell the person that setting decides it and stop. Never widen it.
  3. A worktree starts from the last commit. Uncommitted changes are not copied. Ask the person to commit first, and wait. Never commit, stash or reset for them.
  4. Say that a worktree separates files only, not databases, ports or outside services, so tasks that touch those can still collide.

Step 1: models, count and cost

The person's own list wins. When they name none, list the models the backend offers the way the spawn_run description says (on the kiro backend, kiro-cli chat --list-models --format json; another backend accepts only its own ids), and propose three spread across different vendors. Say why. Do not reuse a model list from memory or from another skill: it goes stale.

Show the person, before anything runs:

  • each model and its rate_multiplier;
  • the count, at most four. If they ask for more, say four is the limit;
  • the total as "about N times the cost of one run".

Then wait for a typed yes. A model on a task gives each worker its own process (about 0.55 GB each), so call resource_status first and stop on critical. This skill is not a spending limit: it only asks before it spends.

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +23 lines 2a8f1b2006f0
  2. yesterday First seen · 109 lines · 59 tokens per session scan A db71d1c43308

Subscribe to this mod's changes

best-of-n is a skill published in the GitHub repository kirodotdev/KiroCrew (5,114 stars, last pushed today), licensed Apache-2.0. It adds 59 tokens to every session and 1,634 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-27.

Related

best-of-n compared with skills from other repositories

best-of-n next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
best-of-nkirodotdev/KiroCrewSkill5.1ktodayApache-2.0A59Claude Code, Codex
bmad-walkthroughalvin-reyes/better-agentic-ideSkill389d agoMITA26Claude Code
vigilante-issue-implementationaliengiraffe/vigilanteSkill4210d agoApache-2.0A53Codex
vigilante-issue-implementation-on-bazel-monorepoaliengiraffe/vigilanteSkill4210d agoApache-2.0A63Codex
vigilante-issue-implementation-on-monorepoaliengiraffe/vigilanteSkill4210d agoApache-2.0A59Codex
vigilante-issue-implementation-on-goaliengiraffe/vigilanteSkill4210d agoApache-2.0A36Codex
vigilante-issue-implementation-on-rubyaliengiraffe/vigilanteSkill4210d agoApache-2.0A41Codex