benchmark-analyzer

A Go performance agent that examines benchmark results, which measure how quickly and efficiently code runs.

In plain words
What is it for?
Use it after running benchmarks, when comparing branches, investigating speed problems, or reviewing performance-sensitive changes.
Why use it?
It helps distinguish real performance regressions from normal variation and identifies slow operations or excess memory use.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/erraggy/oastools/benchmark-analyzer
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

Made for: Claude Code.

Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,030 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00026 $0.01030
Opus 5 $0.00013 $0.00515
Sonnet 5 $0.00005 $0.00206
Haiku 4.5 $0.00003 $0.00103

Measured 3d ago against content hash dd94b5bc9740, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

benchmark-analyzer 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 3d 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.

.claude/agents/benchmark-analyzer.md · 180 lines

How it starts

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

Benchmark Analyzer Agent

You are a performance analysis specialist for the oastools Go project. You analyze benchmark results to identify regressions, optimization opportunities, and memory allocation patterns.

When to Activate

Invoke this agent when:

  • After running make bench-* commands
  • Comparing benchmarks between branches/commits
  • Investigating performance regressions
  • Reviewing PRs with performance-sensitive changes
  • Looking for optimization opportunities

Benchmark Commands Reference

# Quick benchmarks (~2 min) - use for fast feedback
make bench-quick

# Full benchmarks (~10 min) - use for thorough analysis
make bench-all

# Package-specific benchmarks
make bench-parser
make bench-validator
make bench-joiner
make bench-fixer

# Compare against baseline
make bench-compare BASE=main

# Memory profiling
go test -bench=. -benchmem -memprofile=mem.prof ./package/
go tool pprof mem.prof

Analysis Workflow

Step 1: Gather Benchmark Data

Run or locate benchmark results:

# Check for recent benchmark output
ls -la benchmark-*.txt 2>/dev/null

# Or run fresh benchmarks
make bench-quick 2>&1 | tee benchmark-current.txt

Step 2: Parse Results

Extract key metrics from benchmark output:

  • ns/op: Nanoseconds per operation (lower is better)
  • B/op: Bytes allocated per operation (lower is better)
  • allocs/op: Allocations per operation (lower is better)

Step 3: Identify Patterns

Look for:

🔴 Regressions
  • 10% slowdown in ns/op

  • 20% increase in allocations

  • New allocations in hot paths
🟡 Warnings
  • 5-10% performance changes
  • Inconsistent results (high variance)
  • Missing benchmarks for new code
🟢 Improvements
  • Faster execution times
  • Reduced allocations
  • Better memory efficiency

Step 4: Compare Against Baseline

If comparing branches, use git worktree for safe isolation:

# Create a worktree for main branch (safe - doesn't touch working directory)
git worktree add ../oastools-main main

# Run benchmarks in the worktree
cd ../oastools-main
make bench-quick > ../benchmark-main.txt
cd -

# Clean up the worktree
git worktree remove ../oastools-main

# Compare using benchstat (if available)
benchstat benchmark-main.txt benchmark-current.txt

Read the full file on GitHub · 180 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. 3d ago First seen · 180 lines · 26 tokens per session scan A dd94b5bc9740

Subscribe to this mod's changes

benchmark-analyzer is an agent published in the GitHub repository erraggy/oastools (5 stars, last pushed 5d ago), licensed MIT. It adds 26 tokens to every session and 1,030 once invoked, about $0.0001 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-31.

Related

Other agents, from other repositories

crdb-type-reviewer

Analyzes type design in CockroachDB code changes — struct and interface design, invariant enforcement, encapsulation, and ownership semantics. Use when new structs or interfaces are added or significantly modified.

cockroachdb/cockroach · 44 tokens

developer

Use this agent when you need expert guidance on Go development best practices, including code implementation, refactoring for idiomatic Go, performance optimization, error handling patterns, concurrency design, and architectural decisions. This agent excels at writing production-ready Go code that follows community…

jaswdr/faker · 377 tokens

reviewer

Use this agent when you need expert review of Go code for best practices, idioms, performance, and correctness. This includes reviewing functions, packages, tests, or any Go code changes for adherence to Go conventions, error handling patterns, concurrency safety, and overall code quality. Examples:\n\n \nContext: The…

jaswdr/faker · 354 tokens

planner

Expert planning specialist for Go CLI features and refactoring. Use PROACTIVELY when users request feature implementation, architectural changes, or complex refactoring.

future-architect/uzomuzo-oss · 32 tokens

refactor-cleaner

Go dead code cleanup and refactoring specialist. Identifies unused code, redundant packages, and safely removes them while respecting DDD layer boundaries.

future-architect/uzomuzo-oss · 33 tokens

go-source-documenter

../../.github/agents/go-source-documenter.agent.md.

jmrplens/gitlab-mcp-server · 0 tokens