performance-and-cost-optimization

performance-and-cost-optimization is a skill for Claude Code from aneja5/forge-skills. It costs 54 tokens per session (1,489 once invoked), scanned A, original, MIT.

A process for setting measurable limits on speed, cost, caching, and frontend bundle size before optimizing a system. It also identifies which slow or expensive paths should be measured and profiled.

In plain words
What is it for?
Use it to define request-latency budgets, track AI-call costs, plan caching, control bundle growth, and investigate slow code paths.
Why use it?
It replaces vague concerns such as “the service feels slow” with targets that guide practical optimization decisions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the forge-skills plugin — 42 skills, 36 commands, 1 hook shipped together

Good fit Use it to define request-latency budgets, track AI-call costs, plan caching, control bundle growth, and investigate slow code paths.

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

Made for: Claude Code.

Or install forge-skills, the plugin that ships this one along with the rest of its 42 skills, 36 commands, 1 hook.

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-and-cost-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/aneja5/forge-skills/performance-and-cost-optimization.svg)](https://agentmods.dev/skills/aneja5/forge-skills/performance-and-cost-optimization)
Your own site
<a href="https://agentmods.dev/skills/aneja5/forge-skills/performance-and-cost-optimization"><img src="https://agentmods.dev/badge/skills/aneja5/forge-skills/performance-and-cost-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,489 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.00054 $0.01489
Opus 5 $0.00027 $0.00745
Sonnet 5 $0.00011 $0.00298
Haiku 4.5 $0.00005 $0.00149

Measured 5d ago against content hash 4ea43acf29b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

performance-and-cost-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 5d 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.

skills/performance-and-cost-optimization/SKILL.md · 124 lines

How it starts

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

Performance and Cost Optimization

Overview

Define what "fast enough" and "cheap enough" mean before optimizing anything. Output is .forge/performance-budget.md — latency budgets per request path, LLM cost budgets per call type, the caching strategy (key schema, TTLs, invalidation), frontend bundle budgets, and the profiling targets. Pairs with observability (the dashboards that measure compliance) and scalability-analysis (the growth projection that decides when to invest).

When to Use

  • A new service is being designed and there's no latency or cost target
  • An LLM-heavy feature is shipping and per-call cost is unbounded
  • The frontend bundle is growing organically and ship time is increasing
  • A query or endpoint is approaching its SLO and the team is debating where to optimize
  • Caching is being added ad-hoc with no key convention or invalidation story

When NOT to Use

  • A one-off script with no user-facing latency
  • Pure refactoring or rename work with no perf surface
  • "It feels slow" with no measurement — start with observability first

Common Rationalizations

Thought Reality
"Premature optimization is evil" Setting budgets isn't optimizing — it's defining done. You can't tell what's premature without a target.
"LLM costs are fine for now" Unbounded token usage scales linearly with users. The first viral spike turns a $50/day bill into a $5000/day bill overnight.
"We'll cache later" Cache invalidation designed after the fact creates stale-data bugs you find in production. Design the invalidation strategy with the cache.
"Bundle size doesn't matter, our users have fast internet" You don't know that. Mobile carriers, hotel wifi, rural backhaul, parking-garage signal — all real.
"Profile when it's slow" "Slow" is a feeling. Without a budget, you'll profile randomly or never.
"Auto-scaling fixes performance" Auto-scaling fixes capacity, not per-request latency. A slow request stays slow under any cluster size.

Read the full file on GitHub · 124 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. 5d ago First seen · 124 lines · 54 tokens per session scan A 4ea43acf29b6

Subscribe to this mod's changes

performance-and-cost-optimization is a skill published in the GitHub repository aneja5/forge-skills (3 stars, last pushed 3mo ago), licensed MIT. It adds 54 tokens to every session and 1,489 once invoked, about $0.0003 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-09-03.