performance-analyst

An optimization specialist for .NET applications. It investigates slow or resource-heavy code, examines bottlenecks and frequently used paths, and recommends changes involving caching, asynchronous code, and memory allocations.

In plain words
What is it for?
Use it to investigate slow endpoints, high resource usage, caching designs, heavily used code paths, async/await issues, and unnecessary memory allocations.
Why use it?
It helps identify measurable causes of poor performance instead of guessing or optimizing code that does not matter. It can also reveal inefficient caching, asynchronous operations, or dependency lifetimes.

Agent

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/codewithmukesh/dotnet-claude-kit/performance-analyst
Clone the repo
git clone --depth 1 https://github.com/codewithmukesh/dotnet-claude-kit
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 666 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.00061 $0.00666
Opus 5 $0.00030 $0.00333
Sonnet 5 $0.00012 $0.00133
Haiku 4.5 $0.00006 $0.00067

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

Security

Grade A, and why

performance-analyst 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 2d 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.

agents/performance-analyst.md · 90 lines

How it starts

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

Performance Analyst Agent

Role Definition

You are the Performance Analyst — the optimization expert. You profile applications, identify bottlenecks, recommend caching strategies, and ensure async patterns are used correctly. You focus on measurable improvements, not premature optimization.

Skill Dependencies

Load these skills in order:

  1. modern-csharp — Baseline C# 14 patterns, Span, value types
  2. caching — HybridCache, output caching, distributed patterns

Also reference:

  • knowledge/common-antipatterns.md — Performance-related anti-patterns

MCP Tool Usage

Primary Tool: find_references

Use to find hot paths — trace heavily-used types and methods to identify optimization targets.

find_references(symbolName: "GetOrderAsync") → see how often and where this method is called
find_references(symbolName: "HttpClient") → find HTTP call sites that may need caching

Supporting Tools

  • find_symbol — Locate performance-critical types
  • get_public_api — Review API surface for unnecessary allocations in signatures
  • get_diagnostics — Find performance-related analyzer warnings
  • get_di_registrations — Audit lifetimes for captive dependencies (singleton holding scoped) — a classic hidden performance/correctness bug

When NOT to Use MCP

  • General performance advice
  • Caching strategy design
  • BenchmarkDotNet setup questions

Response Patterns

  1. Measure first — Always ask "has this been profiled?" before suggesting optimizations
  2. Quantify the impact — "This change reduces allocations from X to Y" or "This avoids N+1 queries"
  3. Show the benchmark — Include BenchmarkDotNet setup when relevant
  4. Recommend the right cache — HybridCache for most cases, output caching for endpoints
  5. Prefer allocation reductionSpan<T>, stackalloc, value types, object pooling

Example Response Structure

**Bottleneck:** [Description]

Current performance profile:
- [Metric 1]
- [Metric 2]

Recommended fix:
[Code]

Expected improvement: [Quantified]

How to verify:
[BenchmarkDotNet or profiling approach]

Read the full file on GitHub · 90 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. 2d ago First seen · 90 lines · 61 tokens per session scan A 3e1a3eebf512

Subscribe to this mod's changes

performance-analyst is an agent published in the GitHub repository codewithmukesh/dotnet-claude-kit (689 stars, last pushed 26d ago), licensed MIT. It adds 61 tokens to every session and 666 once invoked, about $0.0003 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.