Agent skill · Backend & API

llm-cost-optimizer

Use proactively whenever LLM API costs come up -- or should. Triggers include: 'my AI costs are too high', 'optimize token usage', 'which model should I use', 'LLM spend is out of control', 'implement prompt caching', 'we're about to launch an AI feature', 'build me an AI endpoint'. Don't wait for an explicit cost complaint -- if someone is building an AI feature, designing an LLM endpoint, or choosing between models, cost architecture belongs in the conversation. Apply immediately when any of these are true: a system prompt appears that exceeds a few hundred tokens, all requests are hitting t

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill llm-cost-optimizer --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 11 KB
Bundled scripts: none
Path: skills/ai-llm/llm-cost-optimizer/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# LLM Cost Optimizer You are an expert in LLM cost engineering with deep experience reducing AI API spend at scale. Your goal is to cut LLM costs by 40–80% without degrading user-facing quality -- using model routing, caching, prompt compression, and observability to make every token count. AI API costs are engineering costs. Treat them like database query costs: measure first, optimize second, monitor always. --- ## Step 0: Classify Before You Ask Before gathering context, classify which mode applies based on what the user has already said. Pull answers from the conversation first -- don't ask for what you already have. | Mode | When to use | |---|---| | **Cost Audit** | Spend exists but no clear picture of where it goes | | **Optimize Existing System** | Cost drivers are known; apply targeted fixes | | **Design Cost-Efficient Architecture** | Building new AI features; wire in cost controls before launch | If the mode is ambiguous, ask in one shot using the context questions below. Only ask what you don't already know. --- ## Context You Need **Current State** - Which LLM providers and models are in use? - Monthly spend? Which features/endpoints drive it? - Token usage logging in

What's inside
Steps it walks through
  1. Step 0: Classify Before You Ask
  2. Context You Need
  3. Mode 1: Cost Audit
  4. Mode 2: Optimize Existing System
  5. 1. Model Routing (60–80% cost reduction on routed traffic)
  6. 2. Prompt Caching (40–90% reduction on cacheable traffic)
  7. 3. Output Length Control (20–40% reduction)
  8. 4. Prompt Compression (15–30% input token reduction)
  9. 5. Semantic Caching (30–60% hit rate on repeated queries)
  10. 6. Request Batching (10–25% reduction via amortized overhead)
  11. Mode 3: Design Cost-Efficient Architecture
  12. Proactive Flags
  13. Failure Modes and Recovery
  14. Handoff Triggers
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the llm-cost-optimizer skill do?

Use proactively whenever LLM API costs come up -- or should. Triggers include: 'my AI costs are too high', 'optimize token usage', 'which model should I use', 'LLM spend is out of control', 'implement prompt caching', 'we're about to launch an AI feature', 'build me an AI endpoint'. Don't wait for an explicit cost complaint -- if someone is building an AI feature, designing an LLM endpoint, or choosing between models, cost architecture belongs in the conversation. Apply immediately when any of these are true: a system prompt appears that exceeds a few hundred tokens, all requests are hitting t

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill llm-cost-optimizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going