best-of-n

best-of-n is a skill for Claude Code, Codex from codingmydna/grokers. It costs 62 tokens per session (785 once invoked), scanned A, a copy of best-of-n, Apache-2.0.

A process for implementing the same coding task in several independent ways, comparing the results, and applying the best version.

In plain words
What is it for?
It is for trying several solutions in parallel, evaluating their quality, and selecting one implementation to keep.
Why use it?
It reduces reliance on a single implementation approach when multiple reasonable solutions are possible.

Skill for Claude CodeCodex

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

Good fit It is for trying several solutions in parallel, evaluating their quality, and selecting one implementation to keep.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codingmydna/grokers/best-of-n
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 codingmydna/grokers --skill best-of-n
Clone the repo
git clone --depth 1 https://github.com/codingmydna/grokers

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/codingmydna/grokers/best-of-n/github.svg)](https://agentmods.dev/skills/codingmydna/grokers/best-of-n)
Your own site
<a href="https://agentmods.dev/skills/codingmydna/grokers/best-of-n"><img src="https://agentmods.dev/badge/skills/codingmydna/grokers/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/codingmydna/grokers/best-of-n"><img src="https://agentmods.dev/badge/skills/codingmydna/grokers/best-of-n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 785 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 100% copy Near-identical to another mod 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.00062 $0.00785
Opus 5 $0.00031 $0.00392
Sonnet 5 $0.00012 $0.00157
Haiku 4.5 $0.00006 $0.00078

Measured 11d ago against content hash e0e1849ead8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d ago.

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.

Origin

This is a copy

100% identical to best-of-n — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

crates/codegen/xai-grok-shell/skills/best-of-n/SKILL.md · 94 lines

How it starts

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

/best-of-n -- Parallel Implementation Tournament

Implement a task multiple different ways in parallel, evaluate all candidates, and apply the best one.

Usage

/best-of-n [N] <task>

  • If the first token is a number 2-10, it sets the candidate count; the rest is the task.
  • If omitted, N defaults to 3.

Examples:

  • /best-of-n implement the login page (3 candidates)
  • /best-of-n 5 refactor the auth module (5 candidates)

Steps

  1. Parse the user's message to extract N (candidate count, default 3) and the task description.

  2. Spawn N subagents in a single message (parallel tool calls). Use the task tool for each with:

    • subagent_type: "general-purpose"
    • isolation: "worktree"
    • run_in_background: true
    • description: "Candidate <number>"
    • prompt: the task description, plus "You are candidate <number> of <N> independent implementations. Implement the task fully. When done, summarize your approach and the changes you made."
  3. Wait for all candidates to complete using get_task_output with block: true or wait_tasks with mode: "wait_all".

  4. Evaluate and pick the winner using the criteria below.

  5. Apply the winner's changes from its worktree to the main workspace. Review the changes in context and fix any remaining issues.

  6. End your response with WINNER: <number> (1-N).

Evaluation Criteria

Evaluate each candidate on these axes, in order of importance:

  1. Correctness -- Does the candidate actually solve the task? Does it handle the requirements completely, or does it miss important aspects? Are there logic errors, type errors, or broken imports?

  2. Code Quality -- Is the code clean, readable, and well-structured? Does it follow the patterns and conventions of the surrounding codebase? Does it avoid unnecessary complexity?

  3. Safety -- Does the candidate avoid introducing bugs, security issues, or breaking changes to existing functionality?

Read the full file on GitHub · 94 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. 11d ago First seen · 94 lines · 62 tokens per session scan A e0e1849ead8d

Subscribe to this mod's changes

best-of-n is a skill published in the GitHub repository codingmydna/grokers (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 62 tokens to every session and 785 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to best-of-n, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

byok-custom-model

Register a custom LLM endpoint with your own API key for chat in Starchild. Use when adding a personal Anthropic, OpenAI, Grok, Qwen, DeepSeek, Meta (Muse Spark), NEAR AI, or Venice key as a chat model (e.g. add my Claude key, register DeepSeek, use Muse Spark 1.1).

Starchild-ai-agent/official-skills · 80 tokens

loongsuite-pilot-insight

A reporting workflow for turning LoongSuite Pilot and AI coding-agent logs into structured reports about events, teams, data quality, development efficiency, and AI use. It defines the meaning of the log fields and the measurements used in dashboards.

alibaba/loongsuite-pilot · 91 tokens

loongsuite-pilot-ops

Skill "loongsuite-pilot-ops" from alibaba/loongsuite-pilot, covering loongsuite-pilot-ops, quick start, todo: add quick start commands and usage.

alibaba/loongsuite-pilot · 15 tokens

byok-relay

OpenAI-compatible LLM gateway for any client-side application (browser, mobile, React Native, Flutter, VS Code extensions, browser extensions, Electron, smart TV, and more). Routes requests to OpenAI, Anthropic, Gemini, Groq, Mistral, and 200+ models, handling CORS, key encryption, and streaming without a dedicated…

avikalpg/byok-relay · 131 tokens

javascriptcore-garbage-collector

JSC GC reference for Bun. Use for use-after-free, JS object leaks, "collected too early", or when touching WriteBarrier, visitChildren, visitAdditionalChildren, JSRef, JSC::Strong/Weak, hasPendingActivity, ensureStillAlive, addOpaqueRoot, reportExtraMemoryAllocated, IsoSubspace, HeapAnalyzer, finalize.

twaldin/hone · 80 tokens

implementing-jsc-classes-cpp

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

twaldin/hone · 38 tokens