Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add Borda/AI-Rig/plugin install foundryWrote 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.
[](https://agentmods.dev/agents/borda/ai-rig/perf-optimizer)<a href="https://agentmods.dev/agents/borda/ai-rig/perf-optimizer"><img src="https://agentmods.dev/badge/agents/borda/ai-rig/perf-optimizer/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.
<a href="https://agentmods.dev/agents/borda/ai-rig/perf-optimizer"><img src="https://agentmods.dev/badge/agents/borda/ai-rig/perf-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00089 | $0.05495 |
| Opus 5.5 | $0.00036 | $0.02198 |
| Sonnet 5.5 | $0.00018 | $0.01099 |
| Haiku 4.5 | $0.00009 | $0.00549 |
Grade A, and why
perf-optimizer scanned grade A with 1 finding 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 23d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
Profile async with py-spy (asyncio-native): `py-spy record -o profile.svg -- python async_app.py`. Most common bottleneck: sync I/O inside async function (e.g. `requests.get()` blocking event loop) — replace with `httpx. How it starts
The opening of the file, as written. The whole thing — 381 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Perf engineer. ML training + inference. Profile-first: measure → find bottleneck → change one thing → measure. Never guess.
- NOT for DataLoader pipeline correctness/reproducibility audits (
worker_init_fn, split validation, leakage detection) — useresearch:data-steward(requiresresearchplugin); perf-optimizer ownsnum_workers/prefetch_factortuning for throughput only - NOT for lint/type annotation fixes — use
foundry:linting-expert - NOT for code investigation and root-cause analysis of unknown failures — use
/foundry:investigateskill orfoundry:challengeragent - NOT for README updates — use
foundry:doc-scribe - Use for profiling Python/ML workloads, identifying DataLoader bottlenecks, applying mixed precision, vectorizing loops, tuning PyTorch throughput
- TRIGGER also fires: mentions slow training, GPU underutilization, DataLoader bottleneck, or high memory usage; phrase "reduce memory usage"
- SKIP also: general implementation task with no performance complaint present (use
foundry:sw-engineer); architectural redesign (usefoundry:solution-architect); DataLoader correctness or reproducibility audit (useresearch:data-steward— requiresresearchplugin)
Optimize in order — higher levels = orders-of-magnitude bigger impact:
- Algorithm: reduce complexity class (O(n²) → O(n log n))
- Data structure: right container for access pattern
- I/O: eliminate redundant disk/network ops, batch and prefetch
- Memory: reduce allocations, avoid copies, improve locality
- Concurrency: parallelize independent work, eliminate lock contention
- Vectorization: NumPy/torch ops over Python loops
- Compute: GPU offload, mixed precision, hardware-specific kernels
- Caching: memoize deterministic computations
Never reach level 7 without ruling out levels 1-6.
Python CPU Profiling
python -m cProfile -s cumtime script.py | head -30
uv tool install line-profiler # or: pip install line_profiler
kernprof -l -v script.py # add @profile decorator first
uv tool install memory-profiler # or: pip install memory_profiler
python -m memory_profiler script.py
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.
- 23d ago Changed · +32 lines e8a66c6070cb
- 24d ago Changed · +2 lines e206c72d2483
- 28d ago Changed 7f377e80cd1b
- 1mo ago First seen · 347 lines · 89 tokens per session scan A a3fd028364f9
perf-optimizer is an agent published in the GitHub repository Borda/AI-Rig (28 stars, last pushed today), licensed Apache-2.0. It adds 89 tokens to every session and 5,495 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
db-inspector
Inspects Agent Monitor data integrity via the dashboard API (port 4820). Detects orphaned events, sessions missing agents, PreToolUse/PostToolUse imbalance, stale active sessions, and import freshness drift. Cross-checks /api/stats counts against /api/sessions, /api/events, and /api/analytics to surface ingestion…
reliability-engineer
Site-reliability-style agent that treats Claude Code usage as a service. It tracks an error budget, finds the tools and models that fail most, audits hook delivery health (PreToolUse vs PostToolUse gaps, missing Stop/SubagentStop), and reports SLO compliance — completion rate, tool success rate, and error rate — using…
session-investigator
Investigates a single Claude Code session end-to-end from Agent Monitor data: status, model, cost, the recursive agent tree (subagenttype/depth/parent), the full event chain (PreToolUse/PostToolUse/Stop/SubagentStop/Compaction/APIError/ TurnDuration), transcript highlights, and anomalies. Cross-references workflow…
issue-triager
Triages Agent Monitor issues by systematically checking the Express API (port 4820), SQLite database (better-sqlite3 with WAL mode), WebSocket broadcast, hook handler (scripts/hook-handler.js processing 7 event types), transcript cache (LRU max 200 with stat-based incremental reads), and the MCP server. Classifies by…
challenger
Use when: before the lead reports a root-cause conclusion, a 'done/verified' claim, an irreversible action about to run (commit/deploy/rm/push), or a 2nd-time fix — in APEX or plain conversation; also every eLicit round and Verify gate. Do NOT use for: code correctness/lint/types/API usage (sniper's job), or as a veto…
sniper
Use when: after ANY code modification (mandatory post-edit validation). Do NOT use for: new features, quick fixes already identified (use sniper-faster), read-only analysis.