Optimization

Optimization is a skill for Claude Code from nxtg-ai/forge-plugin. It costs 110 tokens per session (1,901 once invoked), scanned A, original, MIT.

A guide to finding and fixing performance problems by measuring where time, memory, or input and output work is actually spent. It also describes checks for common codebase and frontend issues.

In plain words
What is it for?
Use it to investigate slow dashboards, delayed APIs, large frontend bundles, memory leaks, unnecessary code, duplicate dependencies, and similar performance issues.
Why use it?
It reduces guesswork when an application is slow, uses too much memory, or has an oversized bundle. Developers can identify the main bottleneck, change it, and measure again.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the nxtg-forge plugin — 27 skills, 24 commands, 33 agents shipped together

Good fit Use it to investigate slow dashboards, delayed APIs, large frontend bundles, memory leaks, unnecessary code, duplicate dependencies, and similar performance issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nxtg-ai/forge-plugin/optimization
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 nxtg-ai/forge-plugin --skill optimization
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin

Made for: Claude Code.

Or install nxtg-forge, the plugin that ships this one along with the rest of its 27 skills, 24 commands, 33 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 Optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/optimization/github.svg)](https://agentmods.dev/skills/nxtg-ai/forge-plugin/optimization)
Your own site
<a href="https://agentmods.dev/skills/nxtg-ai/forge-plugin/optimization"><img src="https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/optimization/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 Optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/nxtg-ai/forge-plugin/optimization"><img src="https://agentmods.dev/badge/skills/nxtg-ai/forge-plugin/optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,901 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.00110 $0.01901
Opus 5.5 $0.00044 $0.00760
Sonnet 5.5 $0.00022 $0.00380
Haiku 4.5 $0.00011 $0.00190

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

Security

Grade A, and why

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 12d 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/nxtg-forge/skills/optimization/SKILL.md · 135 lines

How it starts

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

Performance Optimization

Diagnose and fix performance problems from measurement, never from guessing. This skill is the reasoning layer; the deterministic scan lives in the /nxtg-forge:optimize command and the performance agent.

The one rule

Measure → find the real bottleneck → fix that one thing → re-measure. Repeat.

Premature optimization wastes effort on code that isn't hot. A profile that shows where time/memory/allocations actually go beats any intuition. Optimize the top item, prove the delta, then re-profile — the bottleneck usually moves.

Where this fits in Forge

Surface What it does When
/nxtg-forge:optimize (command) Deterministic 7-dimension static scan (large files, as any, dead exports, deps, dup, console, TODO debt) + optional --fix Codebase-health sweep, refactor triage
performance agent (agents/performance.md) Bundle analysis, React render profiling, memory-leak hunting, API latency Deep dive on a specific slow surface
This skill The measure-first method + fix patterns both of the above apply Any "it's slow" reasoning

/nxtg-forge:optimize is a TypeScript-oriented static-quality scan — it does not run a profiler. For actual runtime numbers you still profile (browser DevTools, cargo flamegraph, node --prof, EXPLAIN ANALYZE). Read reference/patterns.md for the full per-domain fix catalog; keep this file for triage.

Triage: classify the bottleneck first

Before touching code, put the symptom in one bucket — the fix set is different for each.

  • CPU-bound — high CPU, work scales with input. Causes: O(n²) loops, redundant recompute, heavy regex, no memoization. Fix: better algorithm/data structure, cache results, memoize.
  • Memory-bound — RSS climbs, GC thrash, OOM. Causes: leaks (unremoved listeners, growing caches), giant objects held in scope, no pagination. Fix: release refs, bound caches, stream/paginate.
  • I/O-bound — low CPU but slow wall-clock. Causes: sync I/O, N+1 queries, chatty network, missing cache. Fix: batch, async/parallel, cache, add indexes.

Read the full file on GitHub · 135 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago Changed · +4 tokens per session aa9b778d69cc
  2. 1mo ago First seen · 135 lines · 106 tokens per session scan A 610f4583b693

Subscribe to this mod's changes

Optimization is a skill published in the GitHub repository nxtg-ai/forge-plugin (6 stars, last pushed 4d ago), licensed MIT. It adds 110 tokens to every session and 1,901 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

fix-issue

Fixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to…

yonatangross/orchestkit · 82 tokens

error-analysis

Evals-first error analysis for LLM apps: clusters real Langfuse or JSONL traces into a human-confirmed failure taxonomy with counts, then recommends binary pass/fail evals for recurring named modes. Use to learn what to measure before writing evals. Not for CI failures.

yonatangross/orchestkit · 61 tokens

ci-debug

Diagnose a failing CI run against an 11-pattern playbook. Classifies the failure, cites the relevant memory entry, proposes the exact fix command — but NEVER applies without explicit user approval. Use when a specific PR check or GitHub Actions run failed and you want a diagnosis instead of speculation. Don't use for…

yonatangross/orchestkit · 92 tokens

monitoring-observability

Monitoring and observability patterns for Prometheus metrics, Grafana dashboards, Langfuse v4 LLM tracing (astype, scorecurrentspan, shouldexportspan, LangfuseMedia), and drift detection. Use when adding logging, metrics, distributed tracing, LLM cost tracking, or quality drift monitoring.

yonatangross/orchestkit · 69 tokens

paired-probe

Refuse a verdict a probe did not earn. Runs a check where the fault IS present and where it is NOT, and blocks the answer when both arms print the same thing, because a check that cannot disagree with you has measured nothing. Also catches the zero-sample sweep that reads as "clean" and the swallowed error that reads…

yonatangross/orchestkit · 100 tokens

code-coherence-review

Reviews code and plans for logic coherence, correctness, and structural integrity.

ntorga/agent-starter-kit · 19 tokens