codspeed-write-benchmarks

codspeed-write-benchmarks is a skill for Claude Code from CodSpeedHQ/codspeed. It costs 125 tokens per session (1,701 once invoked), scanned A, original, Apache-2.0.

Instructions for writing and maintaining CodSpeed benchmarks, which measure how long code takes to run. They cover realistic inputs, measuring the intended operation, repeatability, and avoiding work being removed by optimizers.

In plain words
What is it for?
Use them when adding benchmarks to a CodSpeed project or investigating noisy, unstable, or optimized-out measurements.
Why use it?
They help prevent benchmark results from measuring the wrong code, changing because of randomness, or appearing faster because the code did not actually run.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the codspeed plugin — 3 skills, 1 MCP server shipped together

Good fit Use them when adding benchmarks to a CodSpeed project or investigating noisy, unstable, or optimized-out measurements.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codspeedhq/codspeed/codspeed-write-benchmarks
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 CodSpeedHQ/codspeed --skill codspeed-write-benchmarks
Clone the repo
git clone --depth 1 https://github.com/CodSpeedHQ/codspeed

Made for: Claude Code.

Or install codspeed, the plugin that ships this one along with the rest of its 3 skills, 1 MCP server.

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 codspeed-write-benchmarks

README.md
[![agentmods](https://agentmods.dev/badge/skills/codspeedhq/codspeed/codspeed-write-benchmarks/github.svg)](https://agentmods.dev/skills/codspeedhq/codspeed/codspeed-write-benchmarks)
Your own site
<a href="https://agentmods.dev/skills/codspeedhq/codspeed/codspeed-write-benchmarks"><img src="https://agentmods.dev/badge/skills/codspeedhq/codspeed/codspeed-write-benchmarks/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 codspeed-write-benchmarks

Your own site · 80×15
<a href="https://agentmods.dev/skills/codspeedhq/codspeed/codspeed-write-benchmarks"><img src="https://agentmods.dev/badge/skills/codspeedhq/codspeed/codspeed-write-benchmarks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,701 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.00125 $0.01701
Opus 5.5 $0.00050 $0.00680
Sonnet 5.5 $0.00025 $0.00340
Haiku 4.5 $0.00013 $0.00170

Measured 17d ago against content hash 26c56b0a72bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codspeed-write-benchmarks 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 17d 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.

skills/codspeed-write-benchmarks/SKILL.md · 76 lines

How it starts

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

Write Benchmarks

A benchmark is useful when a change in its result means a change in the code. Apply the rules below when writing a benchmark, and use them as the checklist when one misbehaves.

Run benchmarks through the CodSpeed CLI (codspeed run, codspeed exec) and read results with the CodSpeed MCP tools, not from raw framework output.

Rules

  1. Relevance: One benchmark answers one question about a real hot path or user-facing operation. Use inputs with a realistic size and distribution.

  2. Validity: The code under test must actually run. Use its result (return it, or pass it to the framework's black box) and keep inputs opaque to the optimizer, otherwise the work can be removed or computed at compile time. See optimized-out benchmarks.

  3. Measured region: Measure only the operation under test. Build inputs outside the measured code. If the operation mutates its input, give every iteration a fresh copy through the framework's setup hook. Every iteration must do the same work.

  4. Determinism: The same code must do the same work on every run. Seed random generators, use fixed-seed hashing or ordered containers, sort directory listings, and read committed fixtures. No network, clock, or environment-dependent branches. See Benchmark Variance.

  5. State isolation: A result must not depend on which benchmarks ran before it. Avoid shared caches and globals. Allocator and garbage collector state carries over between benchmarks, so allocate inputs in setup rather than in the measured code. If a micro-benchmark still moves with unrelated code changes, build it into its own binary. See Reducing Variance.

  6. Sizing: Size each benchmark so it gives a valid result under every instrument it runs with. One benchmark can run under several instruments, and each one has its own limits:

    • Simulation runs the code once on a simulated CPU and excludes system calls. Use it for CPU-bound code.
    • Walltime measures real time over repeated rounds and includes I/O. Very short operations need more iterations per round: set the framework's time or iteration options. Avoid running benchmark processes in parallel.
    • Memory runs the code once and tracks every allocation. Keep a benchmark under about 2 million allocations and split larger ones. Allocation order across threads is not deterministic.

Read the full file on GitHub · 76 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. 17d ago First seen · 76 lines · 125 tokens per session scan A 26c56b0a72bf

Subscribe to this mod's changes

codspeed-write-benchmarks is a skill published in the GitHub repository CodSpeedHQ/codspeed (394 stars, last pushed 3d ago), licensed Apache-2.0. It adds 125 tokens to every session and 1,701 once invoked, about $0.0005 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-13.

Related

codspeed-write-benchmarks compared with skills from other repositories

codspeed-write-benchmarks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codspeed-write-benchmarksCodSpeedHQ/codspeedSkill3943d agoApache-2.0A125Claude Code
hotpath_init_grafanapawurb/hotpath-rsSkill1.9k8d agoMITA109Claude Code
hotpath_initpawurb/hotpath-rsSkill1.9k8d agoMITA88Claude Code
hotpath_cloudpawurb/hotpath-rsSkill1.9k8d agoMITA110Claude Code
syncmetapawurb/hotpath-rsSkill1.9k8d agoMITA55Claude Code
hotpath_bumppawurb/hotpath-rsSkill1.9k8d agoMITA99Claude Code
http-load-profilerzebbern/claude-code-guideSkill4.7k4d agoMITB76Claude Code, Codex