pn-audit-performance

pn-audit-performance is a command for Claude Code, Cursor from perniemann/pnCore. It costs 38 tokens per session (948 once invoked), scanned A, original, MIT.

A review of server-side code and database access for operations that make an application slow or exhaust its resources.

In plain words
What is it for?
Use it to inspect routes, services, and data-access code when backend performance is poor.
Why use it?
It helps find repeated database queries, missing caches, blocking work, inefficient queries, and connection-pool problems.

Command for Claude CodeCursor

Written for Cursor and Claude Code: shipped in a Cursor plugin, but also a Claude Code command (commands/*.md).

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to inspect routes, services, and data-access code when backend performance is poor.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/perniemann/pncore/pn-audit-performance
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/perniemann/pnCore

Made for: Claude Code, Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-audit-performance

README.md
[![agentmods](https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-performance.svg)](https://agentmods.dev/commands/perniemann/pncore/pn-audit-performance)
Your own site
<a href="https://agentmods.dev/commands/perniemann/pncore/pn-audit-performance"><img src="https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-performance.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 948 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.00038 $0.00948
Opus 5 $0.00019 $0.00474
Sonnet 5 $0.00008 $0.00190
Haiku 4.5 $0.00004 $0.00095

Measured 6d ago against content hash 2a8daee2256e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pn-audit-performance 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 6d 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.

packages/pn-core-mcp/content/commands/pn-audit-performance.md · 102 lines

How it starts

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

pn-audit-performance

Start every response with: [pn-command] 🔺

Advanced (palette-hidden). Not in the / slash palette. Invoked by the /pn-backend-audit umbrella, or directly via get_command("pn-audit-performance").

Focused backend performance pass: identify and fix N+1 queries, missing caching, unoptimized DB queries, blocking I/O, and resource exhaustion. No API design changes, no security changes — performance only.

Flow

1. Context

Check .pncore-stack.md for DB, ORM, caching layer, and hosting environment. If not found, ask:

  • "What database and ORM? (PostgreSQL + Prisma / MySQL + Sequelize / etc.)"
  • "Any caching in use? (Redis / Memcached / in-memory / none)"
  • "Any observability showing slow queries? (Datadog / Sentry / logs / no visibility)"

2. Scope

If not specified: "Which routes, services, or data access patterns should I focus on? Or reply 'all' for a full pass."

3. Audit

Load get_skill("pn-caching") and consult pn-core://skills/backend/reference/database-patterns.md.

N+1 queries:

  • Loops calling DB inside each iteration?
  • ORM lazy loading associations accessed in a response handler?
  • Repeated identical queries with different IDs visible in logs?
// N+1 pattern to look for:
for (const order of orders) {
  const user = await db.users.findById(order.userId); // N+1
}

// Fix: batch or JOIN
const orders = await db.orders.findAll({ include: ['user'] }); // ORM eager load
// OR: SELECT o.*, u.* FROM orders o JOIN users u ON u.id = o.user_id

Missing indexes:

  • FK columns without indexes?
  • High-traffic WHERE columns without indexes?
  • ORDER BY with LIMIT without index on sort column?
  • Queries using sequential scans on large tables? (EXPLAIN ANALYZE results)

Caching opportunities:

  • Frequently-read data that rarely changes? (config, user permissions, product catalog)
  • Expensive aggregations recalculated on every request?
  • External API calls made on every request for slowly-changing data?
  • Session data loaded from DB on every authenticated request?

Read the full file on GitHub · 102 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. 6d ago First seen · 102 lines · 38 tokens per session scan A 2a8daee2256e

Subscribe to this mod's changes

pn-audit-performance is a command published in the GitHub repository perniemann/pnCore (0 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 948 once invoked, about $0.0002 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-31.