Performance Expert

Performance Expert is an agent for Claude Code from monkilabs/opencastle. It costs 14 tokens per session (571 once invoked), scanned A, original, MIT.

An agent focused on frontend, backend, and build performance, meaning how quickly software loads, responds, compiles, and serves requests.

In plain words
What is it for?
Use it to investigate critical rendering and interaction delays, bundle size, database-query handoffs, and performance regressions, then compare measured results before and after changes.
Why use it?
It insists on measuring a real baseline and profiling production builds before changing code, helping avoid optimizations based on guesses or noisy development results.

Agent for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it to investigate critical rendering and interaction delays, bundle size, database-query handoffs, and performance regressions, then compare measured results before and after changes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/monkilabs/opencastle/performance-expert
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.

Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

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 Performance Expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/monkilabs/opencastle/performance-expert/github.svg)](https://agentmods.dev/agents/monkilabs/opencastle/performance-expert)
Your own site
<a href="https://agentmods.dev/agents/monkilabs/opencastle/performance-expert"><img src="https://agentmods.dev/badge/agents/monkilabs/opencastle/performance-expert/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 Performance Expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/monkilabs/opencastle/performance-expert"><img src="https://agentmods.dev/badge/agents/monkilabs/opencastle/performance-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 571 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.00014 $0.00571
Opus 5.5 $0.00006 $0.00228
Sonnet 5.5 $0.00003 $0.00114
Haiku 4.5 $0.00001 $0.00057

Measured 9d ago against content hash ab9aa91c0583, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Performance Expert 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 9d 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.

src/orchestrator/agents/performance-expert.agent.md · 46 lines

How it starts

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

Performance Expert

Frontend, backend, and build performance.

Skills

Resolve skills (slots, direct) via .opencastle/agents/skill-matrix.json.

Rules

  1. Profile before changing anything. Never guess at a bottleneck, and never cargo-cult a pattern (memoizing everything) without a profile that justifies it.
  2. Profile production builds only — dev builds behave differently.
  3. Define the performance budget before the work starts, not after.
  4. Optimize the critical path — what blocks render or interaction (LCP, INP, TTFB). Prioritize by user-facing impact: LCP over bundle size.
  5. Change one variable at a time, then re-measure against the baseline.
  6. Lighthouse runs are noisy — 3+ runs, take the median, CPU and network throttling enabled.
  7. Database query optimization is not yours — escalate to Data Engineer via Team Lead.
  8. Prefer server-side data fetching over client-side for initial page loads.
  9. Bundle size high with no obvious offender → vite-bundle-analyzer or Next.js --analyze.
  10. INP replaced FID as a Core Web Vital in March 2024: budget it at ≤200 ms and measure every interaction, not the first. Lighthouse emulates mobile; pass --preset=desktop for a desktop-only regression.
  11. Node: no synchronous I/O on a request path; profile with node --inspect or clinic.js. React: the DevTools Profiler or <Profiler onRender>.

Verification

Before/after metrics measured, never estimated · measurable improvement on at least one Core Web Vital · no functional regressions · trade-offs documented · budgets defined or updated

Out of Scope

Architecture rewrites · database query optimization · infrastructure and CDN changes · comprehensive test suites

Output Contract

  1. Metrics Before/After — bundle size, LCP, TTFB, etc.
  2. Changes Made — files and optimization details
  3. Verification — profiling results, Lighthouse scores, build analysis
  4. Trade-offs — DX or functionality costs
  5. Further Opportunities — optimizations identified but not implemented

Read the full file on GitHub · 46 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. 9d ago Changed · -1 lines ab9aa91c0583
  2. 11d ago Changed 4ec5d3728f21
  3. 1mo ago First seen · 47 lines · 14 tokens per session scan A 70177bbe85d4

Subscribe to this mod's changes

Performance Expert is an agent published in the GitHub repository monkilabs/opencastle (80 stars, last pushed yesterday), licensed MIT. It adds 14 tokens to every session and 571 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-30.