oastools: Agent for Claude Code

.claude/agents/benchmark-analyzer.md

benchmark-analyzer is an agent for Claude Code from erraggy/oastools. It costs 26 tokens per session (1,030 once invoked), scanned A, original, MIT.

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

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is erraggy/oastools's own configuration. It tells Claude Code how to work on oastools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything oastools configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go test -bench=. -benchmem -memprofile=mem.prof ./package/.

Reuse

Borrowing it

Nothing to install: this file belongs to erraggy/oastools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/erraggy/oastools/main/.claude/agents/benchmark-analyzer.md
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

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

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/erraggy/oastools/benchmark-analyzer"><img src="https://agentmods.dev/badge/agents/erraggy/oastools/benchmark-analyzer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00026 $0.01030
Opus 5.5 $0.00010 $0.00412
Sonnet 5.5 $0.00005 $0.00206
Haiku 4.5 $0.00003 $0.00103

Measured 1mo ago against content hash dd94b5bc9740, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (6 stars, last pushed 9d ago), licensed MIT. It adds 26 tokens to every session and 1,030 once invoked, about $0.0001 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-31.