go-benchmark

go-benchmark is a skill for Claude Code from johnqtcg/awesome-skills. It costs 90 tokens per session (5,608 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,608 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.05608
Opus 5 $0.00045 $0.02804
Sonnet 5 $0.00018 $0.01122
Haiku 4.5 $0.00009 $0.00561

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

How it starts

The opening of the file, as written. The whole thing — 414 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 firstgo 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 · 414 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. 12d 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 yesterday), licensed MIT. It adds 90 tokens to every session and 5,608 once invoked, about $0.0005 per session on Opus 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

Other skills, from other repositories

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

golang-patterns

Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization. Use when working with Go code to apply idiomatic Go patterns.

affaan-m/ECC · 45 tokens

security-compliance

Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding security throughout the SDLC.

sangrokjung/claude-forge · 56 tokens

stride-analysis-patterns

Apply STRIDE methodology to systematically identify threats. Use when analyzing system security, conducting threat modeling sessions, or creating security documentation.

sangrokjung/claude-forge · 30 tokens

cache-components

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). PROACTIVE ACTIVATION: Use this skill automatically when working in Next.js projects that have cacheComponents: true in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best…

sangrokjung/claude-forge · 183 tokens

manage-skills

A maintenance workflow for checking whether project verification skills still cover the code and rules that changed during a session.

sangrokjung/claude-forge · 54 tokens