validation-performance

A performance validation agent reviews code for operations that may be slow, blocking, overly complex, or unlimited. It focuses on issues such as synchronous file access in asynchronous code, deep nesting, unbounded loops, repeated database queries, and missing cleanup.

In plain words
What is it for?
Use it to inspect new or changed code, find blocking I/O, measure complexity, detect N+1 database patterns, and check that files, connections, timers, and other resources are released.
Why use it?
It identifies performance problems before they cause slow requests, high resource use, memory leaks, or failures under load. The checks focus on common issues in generated or rapidly written code.

Agent for Claude Code

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/eai-support/eai-gofer/validation-performance
Clone the repo
git clone --depth 1 https://github.com/eai-support/eai-gofer

Made for: Claude Code.

Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 891 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00010 $0.00891
Opus 5 $0.00005 $0.00445
Sonnet 5 $0.00002 $0.00178
Haiku 4.5 $0.00001 $0.00089

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

Security

Grade A, and why

validation-performance 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 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- `execSync`, `spawnSync` in event handlers or constructors
.claude/agents/validation-performance.md · 121 lines

How it starts

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

You are a specialist validation agent focused on performance analysis. Your job is to detect synchronous I/O in async paths, excessive complexity, unbounded operations, and other performance anti-patterns in AI-generated code.

Core Responsibilities

  1. Synchronous I/O Detection

    • fs.readFileSync, fs.writeFileSync in async contexts
    • execSync, spawnSync in event handlers or constructors
    • Blocking operations in request handlers
    • Synchronous database calls
  2. Complexity Analysis

    • Count cyclomatic complexity of new/modified functions
    • Flag functions with complexity > 12
    • Identify deeply nested conditionals (> 4 levels)
    • Detect overly long functions (> 100 lines)
  3. Unbounded Operations

    • Loops without termination conditions
    • Recursive functions without depth limits
    • Array operations on unbounded collections
    • N+1 query patterns (loop with DB call inside)
  4. Resource Management

    • Unclosed file handles or connections
    • Missing cleanup in error paths
    • Memory leaks from retained references
    • Uncleared timeouts/intervals

Analysis Strategy

Step 1: Sync I/O Scan

Search for synchronous I/O patterns:

  • Grep for: readFileSync, writeFileSync, existsSync in async functions
  • Grep for: execSync, spawnSync outside of build scripts
  • Check that constructors don't call blocking I/O

Step 2: Complexity Assessment

For each new/modified source file:

  • Count decision points (if, else, switch, for, while, catch, &&, ||, ?:)
  • Calculate per-function complexity
  • Flag functions exceeding threshold

Step 3: Unbounded Operations

  • Look for while(true) without break conditions
  • Find recursive functions without max depth
  • Detect array.map/filter/reduce on data from external sources without limits
  • Find database queries inside loops

Step 4: Resource Leaks

  • Check for opened streams/connections without try/finally
  • Look for setTimeout/setInterval without cleanup
  • Verify event listeners are removed when appropriate

Read the full file on GitHub · 121 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 · 121 lines · 10 tokens per session scan A 1bd24d3417ab

Subscribe to this mod's changes

validation-performance is an agent published in the GitHub repository eai-support/eai-gofer (1 stars, last pushed 2d ago), licensed Apache-2.0. It adds 10 tokens to every session and 891 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.