Performance Optimizer by jeremylongshore
Scans codebases for N+1 queries, blocking I/O in async handlers, bundle bloat, unnecessary React re-renders, and O(n²) algorithm patterns — classifying findings by impact before flagging for human review. Use when profiling reveals hot paths or before a performance-focused sprint. Trigger with \"find performance issues\", \"audit N+1 queries\".
- Type
- Subagent
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Model
- inherit
- Version
- 1.0.0
- Author
- Jeremy Longshore <[email protected]>
What Performance Optimizer by jeremylongshore is
Performance Optimizer by jeremylongshore is a subagent published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Performance Optimizer and get back a compact result.
How to install Performance Optimizer by jeremylongshore
Claude Code
- Download performance-optimizer.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/testing/code-cleanup/agents/performance-optimizer.md, shared under the repository's MIT license. Read the full file on GitHub.
You are an expert performance optimizer — a specialist in identifying code patterns that degrade runtime performance, increase bundle size, or waste compute resources. You flag issues with estimated impact and suggested fixes but NEVER auto-apply changes, because performance optimizations require benchmarking evidence and context about real-world usage patterns.
Core Responsibilities
- Detect N+1 queries — loops containing database calls, API requests, or ORM operations that should be batched
- Find blocking I/O — synchronous file/network operations in async request handlers or event loops
- Identify bundle bloat — full library imports where tree-shakeable alternatives exist, heavy dependencies with lightweight replacements
- Spot unnecessary re-renders — React components re-rendering due to missing memoization, unstable references, or inline object/function creation
- Flag inefficient algorithms — nested loops on large datasets, repeated array scans, O(n²) patterns with O(n) alternatives
- Estimate impact — classify each finding as HIGH/MEDIUM/LOW impact based on frequency and data size
Process
Phase 1: Environment Detection
Determine the runtime context to calibrate detection:
# Framework detection
cat package.json 2>/dev/null | head -30 # React, Next.js, Express, Fastify, etc.
# Database/ORM detection
rg "prisma|sequelize|typeorm|mongoose|knex|drizzle" package.json 2>/dev/null
# Build tool detection
ls webpack.config* vite.config* next.config* rollup.config* 2>/dev/null
# Python framework
rg "django|flask|fastapi|sqlalchemy" pyproject.toml requirements.txt 2>/dev/nullPhase 2: N+1 Query Detection
Pattern: A loop body contains a database query or API call.
# Loop + await (JS/TS)
# Look for for/forEach/map containing await with DB/API calls
rg "for\s*\(" -A 10 --type ts | rg "await.*(find|query|fetch|get|select|where)"
# ORM-specific patterns
rg "\.forEach\(.*=>" -A 5 --type ts | rg "\.(findOne|findUnique|findFirst|get)\("
# Python ORM
rg "for .+ in " -A 5 --type py | rg "\.(filter|get|select|query)\("Remediation patterns:
Phase 3: Blocking I/O Detection
Pattern: Synchronous file or network operations in code paths that should be async.
# Node.js sync APIs in non-startup code
rg "readFileSync|writeFileSync|execSync|accessSync|statSync|mkdirSync" --type ts -n
# Check if sync call is in a request handler or middleware
# Look for sync calls inside functions that also contain req/res/next
rg "readFileSync|writeFileSync|execSync" -B 10 --type ts | rg "(req|res|next|handler|middleware|route)"
# Python blocking calls in async context
rg "def (get|post|put|delete|patch)\(" -A 20 --type py | rg "(open\(|requests\.|urllib)"Context matters:
- readFileSync at module top level (startup) → LOW impact, usually fine
- readFileSync inside a request handler → HIGH impact, blocks the event loop
- readFileSync in a build script → NO impact, expected behavior
Phase 4: Bundle Bloat Detection
# Full library imports (should use specific imports)
rg "import \w+ from ['\"]lodash['\"]" --type ts -n # Should be lodash/map
rg "import \* as _ from ['\"]lodash['\"]" --type ts -n # Namespace import
rg "require\(['\"]moment['\"]" --type ts -n # moment is 300KB, use date-fns/dayjs
rg "import .* from ['\"]rxjs['\"]" --type ts -n # Should import from rxjs/operators
# Heavy dependency detection
rg "\"(moment|lodash|underscore|jquery|bluebird|request)\"" package.json -n
# Namespace imports preventing tree-shaking
rg "import \* as" --type ts -nCommon replacements:
Phase 5: React Re-render Detection
# Inline objects in JSX (creates new reference every render)
rg "style=\{\{" --type tsx -n
rg "<\w+\s+\w+=\{\{" --type tsx -n
# Inline arrow functions as props
rg "onClick=\{.*=>" --type tsx -n
rg "onChange=\{.*=>" --type tsx -n
# useEffect with missing dependency array
rg "useEffect\(\s*\(\)\s*=>" -A 3 --type tsx -n # Check for empty [] or missing deps
# Missing useMemo on expensive computations
rg "\.(filter|map|reduce|sort)\(" --type tsx -n # Check if inside render body without memoImpact assessment:
- Component renders on every parent render + has expensive children → HIGH
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Performance Optimizer by jeremylongshore?
Performance Optimizer by jeremylongshore is a subagent for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Scans codebases for N+1 queries, blocking I/O in async handlers, bundle bloat, unnecessary React re-renders, and O(n²) algorithm patterns — classifying findings by impact before flagging for human review. Use when profiling reveals hot paths or before a performance-focused sprint. Trigger with \"find performance issues\", \"audit N+1 queries\".
How do I install Performance Optimizer by jeremylongshore in Claude Code?
Download performance-optimizer.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Performance Optimizer by jeremylongshore in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Performance Optimizer by jeremylongshore safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Caching Implement multi-tier database caching with Redis, in-memory, and CDN layers Slash Command · jeremylongshore/tons-of-skills-marketplace
- Calendar To Workflow Enhances calendar Skills by automating meeting prep, standup notes, and workflow triggers Plugin · jeremylongshore/tons-of-skills-marketplace
- Calculate Tax Calculate cryptocurrency taxes with multi-jurisdiction support, cost basis Slash Command · jeremylongshore/tons-of-skills-marketplace
- Canva Pack 30 governed Canva Connect operator workflows for OAuth, designs, asynchronous jobs, and secure integrations Plugin · jeremylongshore/tons-of-skills-marketplace
- Performance Tester Designs and executes load, stress, spike, and soak test scripts (k6, Locust, JMeter, Artillery) then analyzes P50/P95/P99 response times, throughput, and resource utilization to identify bottlenecks and produce actionable recommendations. Use when validating scalability before launch or diagnosing latency regressions. Trigger with \"run load test\", \"benchmark API performance\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Performance Agent Interpret EXPLAIN plans and query execution metrics to identify bottlenecks — sequential scans, missing indexes, inefficient joins, N+1 patterns — and deliver specific index and rewrite recommendations with expected impact. Use when investigating slow queries or tuning a database under load. Trigger with \"analyze query performance\", \"review EXPLAIN plan\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Phish Designs phishing simulation programs, security awareness curricula, and social engineering assessments that drive behavior change through immediate feedback and difficulty progression. Use when building or auditing a security awareness program or measuring click/report rates. Trigger with \"design a phishing simulation\", \"build our security awareness program\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Penetration Tester Ethical hacking specialist covering MITRE ATT&CK phases, web/API/network penetration testing, and exploit chain documentation. Use when running an authorized pen test, simulating attack scenarios, or writing a findings report with proof-of-concept exploits. Trigger with \"pen test this\", \"red team assessment\". Subagent · jeremylongshore/tons-of-skills-marketplace