optimize-codebase-performance

A procedure for improving software performance by measuring a specific problem, finding its cause, proposing a bounded change, and checking the result. Performance can include speed, memory, CPU, database work, network use, rendering, or operating cost.

In plain words
What is it for?
Use it to profile a slow operation, investigate high resource use, prepare a repeatable optimization plan, or implement and compare approved performance changes.
Why use it?
It prevents changes based only on guesswork and keeps optimization from accidentally changing what the software does.

Skill for Claude CodeCodex

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 skills/cmdr-chara/codex-toolkit/optimize-codebase-performance
Any agent
npx skills add cmdr-chara/codex-toolkit --skill optimize-codebase-performance
Clone the repo
git clone --depth 1 https://github.com/cmdr-chara/codex-toolkit

Made for: Claude Code, Codex.

Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,966 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00099 $0.01966
Opus 5 $0.00049 $0.00983
Sonnet 5 $0.00020 $0.00393
Haiku 4.5 $0.00010 $0.00197

Measured yesterday against content hash c994c6991626, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimize-codebase-performance 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 yesterday.

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.

skills/optimize-codebase-performance/SKILL.md · 179 lines

How it starts

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

Optimize Codebase Performance

Optimize a measured critical path, not code that merely looks inefficient. Separate diagnosis and proposal from authorized implementation.

Trigger boundary

Use this skill for:

  • profiling user-visible or system-visible latency, startup, throughput, or resource consumption;
  • locating CPU, memory, GPU, database, network, I/O, bundle, or rendering bottlenecks;
  • producing a reproducible performance proposal;
  • implementing approved optimization batches and verifying comparable before/after results.

Do not trigger for:

  • cleanup without a named performance path and metric;
  • incorrect output, crashes, races, leaks, or regressions whose cause is unknown - use debugging-investigator first;
  • dependency, runtime, schema, or platform migrations - use codebase-evolution-controller;
  • general web, Flutter, or Expo production audits without a performance decision - use the relevant builder;
  • deciding whether the integrated candidate can ship - use verification-and-release.

Required inputs

Obtain or state:

  1. critical path and affected user or system outcome;
  2. target metric and whether lower or higher is better;
  3. representative workload, input shape, concurrency, and cache state;
  4. environment, hardware, runtime, build mode, and dependency state;
  5. success threshold, correctness invariants, and acceptable trade-offs;
  6. available profiler, telemetry, benchmark, test, and operational evidence;
  7. time, compute, production-safety, privacy, and cost constraints;
  8. whether the user approved a previously proposed optimization batch.

If the target is vague, select the nearest observable path and metric but keep conclusions provisional until the user confirms relevance.

Safety baseline

  • Inspect repository and environment state before measurement. Preserve uncommitted and unrelated user work.
  • Treat profile, speed up, optimize, reduce, and improve requests as diagnosis and proposal authorization only at first.
  • Do not edit repository or infrastructure files until the user separately approves a concrete proposal produced by this skill.
  • Limit approval to named batches, files, settings, workloads, trade-offs, and verification. Re-propose materially different work.
  • Prefer local, sanitized, read-only measurement. Do not upload private code, traces, profiles, or customer data without authorization.
  • Do not run high-cost, destructive, production-load, permission-changing, or externally billable experiments without explicit authorization.
  • Never trade correctness, security, privacy, accessibility, observability, or maintainability for an unproven or marginal gain.
  • Never claim improvement from non-comparable measurements.

Read the full file on GitHub · 179 lines

Files

What ships with it

3 files 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. yesterday First seen · 179 lines · 99 tokens per session scan A c994c6991626

Subscribe to this mod's changes

optimize-codebase-performance is a skill published in the GitHub repository cmdr-chara/codex-toolkit (2 stars, last pushed 4d ago), licensed MIT. It adds 99 tokens to every session and 1,966 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories