performance-optimization

performance-optimization is a command for Claude Code from wshobson/agents. It costs 13 tokens per session (5,129 once invoked), scanned A, original, MIT.

A command that coordinates application-performance work from profiling through monitoring. It runs ordered phases, saves each phase's results in a dedicated directory, and pauses at approval checkpoints.

In plain words
What is it for?
Use it to profile an application, work through performance improvements, record results between phases, and monitor the outcome.
Why use it?
It keeps a performance investigation traceable and prevents later steps from running when an earlier step fails or has not been approved.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the application-performance plugin — 1 command, 3 agents shipped together

Good fit Use it to profile an application, work through performance improvements, record results…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wshobson/agents/performance-optimization
About the project

Agentic Plugin Marketplace is a collection of reusable plugins, agents, skills, commands, and rules for coding-agent tools including Claude Code, Codex CLI, Cursor, OpenCode, Antigravity CLI, and GitHub Copilot. It is for developers assembling agentic workflows across multiple harnesses from shared Markdown sources, and the catalogue entries are examples or subsets of those workflow components.

wshobson/agents · 39,449 stars · on GitHub · sethhobson.com

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/wshobson/agents

Made for: Claude Code.

Or install application-performance, the plugin that ships this one along with the rest of its 1 command, 3 agents.

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 performance-optimization

README.md
[![agentmods](https://agentmods.dev/badge/commands/wshobson/agents/performance-optimization.svg)](https://agentmods.dev/commands/wshobson/agents/performance-optimization)
Your own site
<a href="https://agentmods.dev/commands/wshobson/agents/performance-optimization"><img src="https://agentmods.dev/badge/commands/wshobson/agents/performance-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,129 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.00013 $0.05129
Opus 5 $0.00006 $0.02565
Sonnet 5 $0.00003 $0.01026
Haiku 4.5 $0.00001 $0.00513

Measured 7d ago against content hash 97390bee4441, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

performance-optimization 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 7d 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.

plugins/application-performance/commands/performance-optimization.md · 682 lines

How it starts

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

Performance Optimization Orchestrator

CRITICAL BEHAVIORAL RULES

You MUST follow these rules exactly. Violating any of them is a failure.

  1. Execute steps in order. Do NOT skip ahead, reorder, or merge steps.
  2. Write output files. Each step MUST produce its output file in .performance-optimization/ before the next step begins. Read from prior step files — do NOT rely on context window memory.
  3. Stop at checkpoints. When you reach a PHASE CHECKPOINT, you MUST stop and wait for explicit user approval before continuing. Use the AskUserQuestion tool with clear options.
  4. Halt on failure. If any step fails (agent error, test failure, missing dependency), STOP immediately. Present the error and ask the user how to proceed. Do NOT silently continue.
  5. Use only local agents. All subagent_type references use agents bundled with this plugin or general-purpose. No cross-plugin dependencies.
  6. Never enter plan mode autonomously. Do NOT use EnterPlanMode. This command IS the plan — execute it.

Pre-flight Checks

Before starting, perform these checks:

1. Check for existing session

Check if .performance-optimization/state.json exists:

  • If it exists and status is "in_progress": Read it, display the current step, and ask the user:

    Found an in-progress performance optimization session:
    Target: [name from state]
    Current step: [step from state]
    
    1. Resume from where we left off
    2. Start fresh (archives existing session)
    
  • If it exists and status is "complete": Ask whether to archive and start fresh.

2. Initialize state

Create .performance-optimization/ directory and state.json:

{
  "target": "$ARGUMENTS",
  "status": "in_progress",
  "focus": "balanced",
  "depth": "comprehensive",
  "current_step": 1,
  "current_phase": 1,
  "completed_steps": [],
  "files_created": [],
  "started_at": "ISO_TIMESTAMP",
  "last_updated": "ISO_TIMESTAMP"
}

Parse $ARGUMENTS for --focus and --depth flags. Use defaults if not specified.

Read the full file on GitHub · 682 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. 7d ago First seen · 682 lines · 13 tokens per session scan A 97390bee4441

Subscribe to this mod's changes

performance-optimization is a command published in the GitHub repository wshobson/agents (39,449 stars, last pushed 5d ago), licensed MIT. It adds 13 tokens to every session and 5,129 once invoked, about $0.0001 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.