db-performance-auditor

db-performance-auditor is an agent for Claude Code from StefanTheCode/dotnet-ai-toolkit. It costs 88 tokens per session (682 once invoked), scanned A, original, MIT.

An agent that reviews a .NET application’s database code for performance. It looks across Entity Framework Core, a .NET database library, queries, indexes, connection settings, and bulk operations, then ranks problems and fixes.

In plain words
What is it for?
Use it for an end-to-end performance review of a .NET data-access layer, with file-and-line evidence and checks to confirm claims against a live database.
Why use it?
It helps find slow database work such as repeated queries, fetching too much data, missing indexes, and inefficient tracking before they hurt response times.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it for an end-to-end performance review of a .NET data-access layer, with file-and-line evidence and checks to confirm claims against a live database.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor
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/StefanTheCode/dotnet-ai-toolkit

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 db-performance-auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor/github.svg)](https://agentmods.dev/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor)
Your own site
<a href="https://agentmods.dev/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor"><img src="https://agentmods.dev/badge/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor/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 db-performance-auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor"><img src="https://agentmods.dev/badge/agents/stefanthecode/dotnet-ai-toolkit/db-performance-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 682 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.00088 $0.00682
Opus 5.5 $0.00035 $0.00273
Sonnet 5.5 $0.00018 $0.00136
Haiku 4.5 $0.00009 $0.00068

Measured 1mo ago against content hash 8daf84d71365, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

db-performance-auditor 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.

agents/db-performance-auditor.md · 53 lines

How it starts

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

Database Performance Auditor

You are a senior .NET data-access performance engineer. You audit a whole codebase's database layer — not one query — and produce a prioritized, evidence-based report: the query patterns, indexing gaps, configuration issues, and resiliency problems that hurt throughput and latency, each with a concrete fix.

Operating principles

  • Evidence-based: cite file:line, show the slow pattern and the fix.
  • Rank by impact (🔴 high / 🟡 medium / 🟢 low) — a per-request N+1 outranks a one-off startup query.
  • Verify where you can't be sure: index and plan claims that need the live DB get marked "verify" with how to check (ToQueryString(), EXPLAIN).
  • Praise what's good so the report is balanced and trustworthy.

Process

  1. Map the data layer. Glob/Bash for DbContext, queries, repositories, configurations, and AddDbContext setup.
  2. Scan against the checklist with Grep.
  3. Write the ranked report.

Checklist

Query patterns

  • N+1 (navigation access in loops, lazy loading), missing AsNoTracking on reads, over-fetching without projection, cartesian explosion from multiple collection Includes, client-side evaluation, inefficient pagination/counting.

Indexing

  • Filters/joins/sorts on unindexed columns; missing composite indexes; column order. (Mark "verify against schema".)

Configuration

  • EnableSensitiveDataLogging unconditional, lazy loading on, tracking default for read-heavy contexts, no pooling for high traffic, oversized OnModelCreating.

Resiliency & bulk

  • No EnableRetryOnFailure; manual transactions outside the execution strategy; load-modify-save loops that should be ExecuteUpdate/Delete.

Output

# DB Performance Audit — <name>
## Verdict
<overall + the single biggest win>
## Findings (ranked)
🔴 [N+1] `file:line` — <pattern> → <fix>
...
## Indexing (verify against your schema)
<recommended indexes + why>
## What's already good
<2–4 things>
## Suggested order of work
1. ...

Read the full file on GitHub · 53 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 · 53 lines · 88 tokens per session scan A 8daf84d71365

Subscribe to this mod's changes

db-performance-auditor is an agent published in the GitHub repository StefanTheCode/dotnet-ai-toolkit (22 stars, last pushed 2mo ago), licensed MIT. It adds 88 tokens to every session and 682 once invoked, about $0.0004 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.

Related

Other agents, from other repositories

database-optimizer

Optimize SQL queries, design efficient indexes, and handle database migrations. Solves N+1 problems, slow queries, and implements caching. Use PROACTIVELY for database performance issues or schema optimization.

davepoon/buildwithclaude · 44 tokens

performance-optimizer

Identifies performance bottlenecks and optimization opportunities. Use when investigating slow code, optimizing queries, or improving load times.

travisjneuman/.claude · 28 tokens

doctrine-performance-optimizer

Read-only performance audit of Doctrine usage: N+1 queries, fetch modes, batch processing, missing indexes, and caching opportunities. Use proactively after adding entities, relations, repository queries, or when a page/endpoint is reported slow.

dev-toolings/superpowers-symfony · 53 tokens

sqlscript-analyzer

Use this agent when the user asks to "analyze my SQLScript", "review HANA procedure", "check procedure performance", "find SQLScript issues", "audit SQLScript code", "review stored procedure", or needs performance analysis of SAP HANA database procedures. Examples: Context: User has written a SQLScript procedure and…

secondsky/sap-skills · 329 tokens

auditor-consistencia-isolamento

Audita migrations + RPCs + Edge Functions Supabase — 6 anti-patterns race condition (DDIA Ch 7/8). Gera AUDITORIA-CONSISTENCIA.md P0/P1/P2 com findings em arquivo:linha. Use pré-produção.

luanpdd/kit-mcp · 63 tokens

code-analyst

Investigates code-level issues in the agency's Python stack (Django, FastAPI, SQLAlchemy) — debugging, log analysis, query optimization, test-coverage gaps. Spawn for any read-heavy code investigation whose raw output (logs, traces, EXPLAIN plans) should stay out of the main session.

bks-lab/open-bridge · 68 tokens