Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

cost-benchmark — Claude Code skill: what it does, how to install

Runs corpus benchmarks to evaluate booster performance and compare spend against Gemini or Claude baselines. Generates verifiable cost tables before releases.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill cost-benchmark -a claude-code
Open on GitHub

What cost-benchmark does

This skill runs scripts/bench.mjs from the v3/ directory against test cases defined in bench/booster-corpus.json. The local booster test executes in approximately 85 ms without incurring API costs. Setting BENCH_LLM_BASELINE=1 or BENCH_ANTHROPIC=1 adds comparison baselines across Gemini 2.0 Flash, Claude Sonnet 4.6, and Claude Opus 4.7.

Results write to docs/benchmarks/runs/latest.json and historical ISO-timestamped records. Smoke checks evaluate Tier 1 cases against a winRate ≥ 0.80 requirement, while adversarial scenarios report an unblocked escalationRate. Running external model baselines requires API keys accessible via gcloud secrets or the explicit environment variables BENCH_LLM_API_KEY and BENCH_ANTHROPIC_API_KEY.

What it helps with

  • verify booster win rate before publishing a release
  • compare task execution costs between Sonnet 4.6 and Opus 4.7
  • persist benchmark run metrics to docs/benchmarks/runs/
  • audit routing accuracy on new cases in booster-corpus.json

Example prompts for the agent

  • Run cost-benchmark to evaluate the local booster
  • Execute cost-benchmark with --anthropic to compare Sonnet and Opus costs
  • Run cost-benchmark with BENCH_LLM_BASELINE=1 to check Gemini 2.0 Flash performance

How to install cost-benchmark

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill cost-benchmark -a claude-code

2Manually: put the files in place

~/.claude/skills/cost-benchmark/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cost-benchmark/

From the same set104

The whole set →
ruflo ruvnet This skill adds multi-agent orchestration, memory, routing, and MCP tools to a project. Use it for swarm tasks and multi-step workflows. Claude Code CX Codex Cursor +1 4,000installs Swarm Orchestration ruvnet Skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. Claude Code CX Codex Cursor +1 2,100installs github-project-management ruvnet Turns issue triage and board upkeep into gh and ruv-swarm calls: labels, subtasks, duplicate lookup. Useful when the tracker holds more tickets than order. Claude Code CX Codex Cursor +1 1,400installs github-workflow-automation ruvnet Automates GitHub Actions with AI agent coordination. Generates optimised pipelines, manages pull requests, analyzes failed runs, and deploys updates with risk assessment. Claude Code CX Codex Cursor +1 1,300installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs flow-nexus-swarm ruvnet Deploy cloud-based AI agent swarms and define event-driven workflows with message queues. Use it to coordinate tasks, inspect runs, and scale a swarm. Claude Code CX Codex Cursor +1 1,200installs performance-analysis ruvnet Detects bottlenecks in Claude Flow swarms, profiles agent operations, and generates reports with actionable optimization recommendations. Claude Code CX Codex Cursor +1 1,200installs

Similar

game-automation rehan-remade Launches games, captures GPU-rendered windows, and simulates mouse and keyboard input. Helps an agent verify mods directly inside a running game on Windows and WSL. Claude Code CX Codex Cursor +1 1,500installs react18-batching-patterns official github Diagnoses and fixes React 18 automatic batching bugs in class components. Useful when upgrading from React 17 breaks state assertions or async flows. GitHub Copilot 754installs qa-test-planner softaworks Turns a feature description into a test plan, manual test cases, a regression suite or a bug report. Fires only when you name it: qa-test-planner. Claude Code CX Codex Cursor +1 4,300installs react18-enzyme-to-rtl official github Provides Enzyme to React Testing Library migration patterns for React 18 upgrades. Useful when rewriting shallow renders, mount calls, and state assertions into user behavior checks. GitHub Copilot 739installs engineering-skills Alireza Rezvani An engineering skill index for Claude Code that helps you select one specialist SKILL.md for the task at hand. It covers architecture, testing, DevOps, and data work. Claude Code 2,387installs browser-trace browserbase Attaches a second CDP client to a browser session that is already running, records the whole DevTools stream to disk, and splits it so you can search a failed run. Claude Code CX Codex Cursor +1 3,000installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs

Questions about cost-benchmark

How do I install cost-benchmark in Claude Code?

Run npx skills add ruvnet/ruflo --skill cost-benchmark -a claude-code.

What does cost-benchmark do?

It runs scripts/bench.mjs across a test corpus, calculates routing win rates, and outputs comparative cost metrics to docs/benchmarks/runs/latest.json.

What credentials are needed for baseline benchmarks?

Local booster runs do not need credentials. Baselines pull GOOGLE_AI_API_KEY and ANTHROPIC_API_KEY from gcloud secrets, or accept overrides from BENCH_LLM_API_KEY and BENCH_ANTHROPIC_API_KEY.

Source text

SKILL.md · MIT
---
name: cost-benchmark
description: Run the corpus benchmark — booster locally, optional Gemini/Sonnet/Opus baselines — and persist a verifiable measured-vs-claimed table
argument-hint: "[--llm] [--anthropic]"
allowed-tools: Bash
---

# Cost Benchmark

Runs `scripts/bench.mjs` against the structural+adversarial corpus and writes per-case + summary results to `docs/benchmarks/runs/`. This is the verification gate that backs every measurable claim in `cost-booster-edit` / `cost-booster-route`.

## When to use

- Before publishing a release — verify booster win rate didn't regress.
- After expanding `bench/booster-corpus.json` — confirm new cases route correctly.
- When auditing a "claimed upstream" tag — flip it to "verified" once the bench supports it.
- On a cost question ("is Sonnet 4.6 cheaper than Opus 4.7 for these tasks?") — re-run with `BENCH_ANTHROPIC=1`.

## Steps

1. **Run the bench from `v3/`** (where `agent-booster` resolves):

   ```bash
   ( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/bench.mjs )                  # booster only — free, ~85 ms
   ( cd v3 && BENCH_LLM_BASELINE=1 node ../plugins/ruflo-cost-tracker/scripts/bench.mjs ) # + Gemini 2.0 Flash (cheap)
   ( cd v3 && BENCH_LLM_BASELINE=1 BENCH_ANTHROPIC=1 \
        node ../plugins/ruflo-cost-tracker/scripts/bench.mjs )                          # + Sonnet 4.6 + Opus 4.7
   ```

2. **Inspect the markdown summary** printed to stdout. The gate metric is `winRate` (Tier 1 cases). Adversarial cases are tracked separately as `escalationRate`.

3. **Persisted output** lands at:
   - `docs/benchmarks/runs/latest.json` — pointer to the most recent run
   - `docs/benchmarks/runs/<ISO-timestamp>.json` — historical record

4. **Read it back** in subsequent skills (e.g. `cost-report` step 2 reads `latest.json` for live tier-spend numbers).

## Smoke gates

- `winRate ≥ 0.80` on Tier 1 cases (smoke step 23). Lower the threshold by editing `scripts/smoke.sh`.
- `escalationRate` is reported but ungated — adversarial cases are diagnostic.

## Env overrides

| Env var | Default | Purpose |
|---|---|---|
| `BENCH_LLM_BASELINE` | unset | `=1` runs the OpenAI-compat baseline |
| `BENCH_LLM_MODEL` | `models/gemini-2.0-flash` | Override the OpenAI-compat model |
| `BENCH_LLM_BASE_URL` | Gemini OpenAI shim | Override endpoint |
| `BENCH_ANTHROPIC` | unset | `=1` runs Anthropic baseline (Sonnet 4.6 + Opus 4.7) |
| `BENCH_ANTHROPIC_MODELS` | `claude-sonnet-4-6,claude-opus-4-7` | Comma-separated Claude IDs |
| `BENCH_OUT` | timestamped file | Override output path |
| `BENCH_QUIET=1` | unset | Suppress markdown summary |

API keys auto-pulled from `gcloud secrets` (`GOOGLE_AI_API_KEY`, `ANTHROPIC_API_KEY`); override with `BENCH_LLM_API_KEY` / `BENCH_ANTHROPIC_API_KEY`.

## Cross-references

ADR-0002 §"Decision 1" / §"Riskiest assumption" · `cost-booster-edit/SKILL.md` (verification table consumes this skill's output) · `cost-report/SKILL.md` step 2 (reads `runs/latest.json`).

© ruvnet · MIT · ruvnet/ruflo

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor