go-benchmark

go-benchmark is a skill for Claude Code from johnqtcg/awesome-skills. It costs 90 tokens per session (5,638 once invoked), scanned A, original, MIT.

A Go performance guide for writing benchmarks and using pprof, Go's profiling tool. It covers measuring runtime, memory use, and allocations in Go code.

In plain words
What is it for?
It helps write testing.B benchmarks, collect and interpret pprof profiles, inspect flame graphs, compare implementations with benchstat, and measure ns/op, B/op, or allocs/op.
Why use it?
It helps avoid misleading benchmark results caused by compiler optimizations, poor timer placement, or unsuitable loop patterns. It also guides investigation of performance and memory hotspots.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is # `-o <file>` with ./pkg/... fails..

Good fit It helps write testing.B benchmarks, collect and interpret pprof profiles, inspect flame graphs, compare implementations with benchstat, and measure ns/op, B/op, or allocs/op.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/johnqtcg/awesome-skills
agentmods
npx agentmods add skills/johnqtcg/awesome-skills/go-benchmark

Made for: Claude Code.

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 go-benchmark

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/johnqtcg/awesome-skills/go-benchmark"><img src="https://agentmods.dev/badge/skills/johnqtcg/awesome-skills/go-benchmark.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,638 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 159
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 159
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00090 $0.05638
Opus 5.5 $0.00036 $0.02255
Sonnet 5.5 $0.00018 $0.01128
Haiku 4.5 $0.00009 $0.00564

Measured 1mo ago against content hash 15ee2e00d4a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-benchmark 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 1mo ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/gc_claim_check.sh, scripts/run_interleaved_bench.sh, scripts/run_regression.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/go-benchmark/SKILL.md · 417 lines

How it starts

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

Go Benchmark & pprof Profiling

You are a Go performance specialist. Your job is to help the user measure, understand, and improve Go code performance through rigorous benchmarking and profiling.

Hard Rules

These rules prevent silent, undetectable benchmark corruption. Check them before writing or reviewing any benchmark:

  1. Check the toolchain first — go version. On Go ≥ 1.24, for b.Loop() is the default loop form: it starts the timer at the first call and stops it when it returns false, and it keeps the loop body from being optimised away. That makes Rules 1 and 2 structural instead of manual. On older toolchains, or in the two cases listed under §b.Loop vs the classic loop, use the classic form below.
  2. Sink every result (classic loop only) — assign the final output to a package-level var sink T. Using _ = lets the compiler eliminate dead code; the benchmark then measures nothing. Verified: for a cheap pure function, the _ = form measures exactly the empty-loop baseline — the call is gone.
  3. Timer discipline (classic loop only) — expensive one-time setup (connecting to DB, reading fixtures) goes before b.ResetTimer(). Per-iteration teardown uses b.StopTimer() / b.StartTimer(). b.Loop() handles the setup case for you.
  4. Always -benchmem on measurement runs — allocation counts matter as much as throughput. A function that is fast but allocates heavily will cause GC pressure under load. The one exception is the -race correctness check below: it is a pass/fail gate, not a measurement (the race detector distorts both timing and allocation anyway), so its numbers are not to be read or reported.
  5. -count=10 for comparisons, -count=5 for exploration — a single run is statistically meaningless. Use -count=10 when comparing two implementations with benchstat. As a rule of thumb, doubling the samples improves the smallest resolvable effect by about 1/√2 ≈ 29%, not by half, so halving it needs -count=20. Treat that as direction and rough magnitude: benchstat compares medians with a non-parametric test, and benchmark samples drift rather than being independent, so the real gain is often smaller. Interleave the two variants instead of running all of A then all of B — see references/benchstat-guide.md; it costs nothing and removes drift from the comparison. Cutting machine noise is usually cheaper than adding samples.
  6. Never compare across environments — results from different machines, Go versions, or -cpu values are not comparable. Always note the environment.

Read the full file on GitHub · 417 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. 1mo ago Changed · +3 lines 15ee2e00d4a1
  2. 2mo ago First seen · 414 lines · 90 tokens per session scan A a5c80e5843fe

Subscribe to this mod's changes

go-benchmark is a skill published in the GitHub repository johnqtcg/awesome-skills (30 stars, last pushed 29d ago), licensed MIT. It adds 90 tokens to every session and 5,638 once invoked, about $0.0004 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-08-30.

Related

go-benchmark compared with skills from other repositories

go-benchmark next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
go-benchmarkjohnqtcg/awesome-skillsSkill3029d agoMITA90Claude Code
agent-go-experttravisjneuman/.claudeSkill107yesterdayMITA75Claude Code
golang-rulessoftspark/ai-toolkitSkill17910d agoApache-2.0A40Claude Code
aio-golang-masteryaiocean/claude-pluginsSkill49d agoMITA111Claude Code
go-concurrency-guidekhalilbenaz/claude-skills-collectionSkill272mo agoMITA75Claude Code, Codex
copilot-sdkfabioc-aloha/Alex_Skill_MallSkill5yesterdayMITB36Claude Code, Codex
go-linter-configurationmedy-gribkov/arcanaSkill13mo agoApache-2.0A40Claude Code, Codex