perf-agent

perf-agent is a skill for Claude Code from oyi77/1ai-skills. It costs 22 tokens per session (1,346 once invoked), scanned A, original, MIT.

A performance-focused method that measures an application before suggesting or making optimizations. It uses profiling, benchmarks, and capacity analysis to identify actual slowdowns.

In plain words
What is it for?
Use it to investigate CPU, memory, input/output, network, database-query, allocation, or capacity issues and compare performance before and after changes.
Why use it?
It prevents time being spent optimizing code that is not causing the problem.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the 1ai-skills plugin — 250 skills, 4 commands shipped together

Good fit Use it to investigate CPU, memory, input/output, network, database-query, allocation, or capacity issues and compare performance before and after changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oyi77/1ai-skills/perf-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.

Any agent
npx skills add oyi77/1ai-skills --skill perf-agent
Clone the repo
git clone --depth 1 https://github.com/oyi77/1ai-skills

Made for: Claude Code.

Or install 1ai-skills, the plugin that ships this one along with the rest of its 250 skills, 4 commands.

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 perf-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/oyi77/1ai-skills/perf-agent/github.svg)](https://agentmods.dev/skills/oyi77/1ai-skills/perf-agent)
Your own site
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/perf-agent"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/perf-agent/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 perf-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/perf-agent"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/perf-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,346 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00022 $0.01346
Opus 5.5 $0.00009 $0.00538
Sonnet 5.5 $0.00004 $0.00269
Haiku 4.5 $0.00002 $0.00135

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

Security

Grade A, and why

perf-agent 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 2mo 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/coding/perf-agent/SKILL.md · 150 lines

How it starts

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

Overview

This agent measures before optimizing: it profiles, identifies actual bottlenecks, and only then proposes targeted changes with before/after evidence. Use it when something is slow and the cause is not yet proven. It rejects speculative rewrites in favor of changes that move a measured number.

Perf Agent

Quick Reference — see parent for full agent ecosystem.

The Perf Agent identifies and fixes performance bottlenecks using systematic profiling, benchmarking, and capacity analysis. Its first principle is measure before optimize — it never guesses at bottlenecks. It profiles CPU, memory, I/O, and network; identifies root causes (N+1 queries, memory leaks, unnecessary allocations, sync I/O); and validates every optimization with before/after benchmarks. The perf agent also projects cost impact so teams prioritize by ROI.

When Not to Use

  • Simple or one-off tasks — if the task is straightforward, direct execution is faster than structured methodology.
  • Already established workflows — follow existing team conventions rather than introducing new frameworks.
  • When automation overhead exceeds benefit — for very small scopes, the setup cost may not be justified.

Dependencies

  • Python 3.8+ or Node.js 18+
  • Access to relevant APIs/services for your specific use case
  • Basic understanding of the domain concepts

Commands

# Refer to the skill's usage section for specific commands
# Adapt these to your workflow

Key Responsibilities

  • Profile before optimize: Use profilers (py-spy, cProfile, valgrind, lighthouse, k6) to identify actual bottlenecks, not perceived ones
  • Root cause analysis: Trace slow endpoints, memory growth, or high CPU to specific code paths, queries, or resource contention
  • Validate with benchmarks: Every optimization must include a before/after benchmark — no improvement claim without a measurement

Code Example

"""Minimal perf agent pattern — profile and optimize."""

import json, sys, time, statistics
from pathlib import Path

def profile_endpoint(endpoint: str, samples: int = 100) -> dict:
    """Simple latency profiling for a given operation."""
    import requests  # simulated dependency

    latencies = []
    for _ in range(samples):
        start = time.perf_counter()
        # In practice: call the actual endpoint
        time.sleep(0.01)  # simulated work
        latencies.append((time.perf_counter() - start) * 1000)

    p50 = statistics.median(latencies)
    p95 = sorted(latencies)[int(samples * 0.95)]
    p99 = sorted(latencies)[int(samples * 0.99)]

    return {
        "endpoint": endpoint,
        "samples": samples,
        "p50_ms": round(p50, 1),
        "p95_ms": round(p95, 1),
        "p99_ms": round(p99, 1),
        "assessment": "healthy" if p95 < 200 else "needs_attention" if p95 < 500 else "critical"
    }

def suggest_optimizations(profile: dict) -> list[dict]:
    """Suggest fixes based on profile data."""
    suggestions = []
    if profile["p95_ms"] > 500:
        suggestions.append({
            "type": "N+1 query",
            "confidence": "medium",
            "fix": "Enable eager loading on the relation",
            "impact": "Expected 40-60% p95 reduction"
        })
    if profile["p99_ms"] > 1000:
        suggestions.append({
            "type": "Cache miss",
            "confidence": "low",
            "fix": "Add Redis caching layer with 60s TTL",
            "impact": "Expected 70-90% p99 reduction for cache hits"
        })
    return suggestions

if __name__ == "__main__":
    endpoint = sys.argv[1]
    profile = profile_endpoint(endpoint)
    profile["optimizations"] = suggest_optimizations(profile)
    print(json.dumps(profile, indent=2))

Read the full file on GitHub · 150 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. 2mo ago Changed · +11 lines ad22c429c41a
  2. 3mo ago First seen · 139 lines · 22 tokens per session scan A 2378d7c27de0

Subscribe to this mod's changes

perf-agent is a skill published in the GitHub repository oyi77/1ai-skills (19 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 1,346 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.

Related

perf-agent compared with skills from other repositories

perf-agent next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
perf-agentoyi77/1ai-skillsSkill19todayMITA22Claude Code
adk-debuggoogle/adk-pythonSkill22k2d agoApache-2.0A191Claude Code, Codex
rubber-duckkirodotdev/KiroCrewSkill5.1ktodayApache-2.0A161Claude Code, Codex
debug-gatewaykirodotdev/KiroCrewSkill5.1ktodayApache-2.0A63Claude Code, Codex
ai-discoverkirodotdev/KiroCrewSkill5.1ktodayApache-2.0A83Claude Code, Codex
debugging-websocket-issuesAgentWorkforce/relaySkill1.2ktodayApache-2.0A54Claude Code
goal-calculator-repairzhnt/loushangSkill2.1ktodayApache-2.0A16Claude Code, Codex