LLM Cost Optimizer

LLM Cost Optimizer is a skill for Claude Code, Codex from Notysoty/openagentskills. It costs 31 tokens per session (1,642 once invoked), scanned A, original, MIT.

A review guide for finding unnecessary spending in an AI application that uses language models. It examines prompts, model choices, request patterns, and the amount of text sent and returned.

In plain words
What is it for?
Use it to review an AI application’s prompts, call volume, models, and response lengths. It considers caching repeated prompts, choosing different models, shortening requests, batching work, and limiting output.
Why use it?
It helps locate avoidable token use and expensive model calls before they become a large recurring bill.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for cline. Also seen: positional $N argument; mentions Claude Code; mentions Codex.

Good fit Use it to review an AI application’s prompts, call volume, models, and response lengths. It considers caching repeated prompts, choosing different models, shortening requests, batching work, and limiting output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/notysoty/openagentskills/llm-cost-optimizer
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 Notysoty/openagentskills --skill llm-cost-optimizer
Clone the repo
git clone --depth 1 https://github.com/Notysoty/openagentskills

Made for: Claude Code, Codex.

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 LLM Cost Optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/notysoty/openagentskills/llm-cost-optimizer/github.svg)](https://agentmods.dev/skills/notysoty/openagentskills/llm-cost-optimizer)
Your own site
<a href="https://agentmods.dev/skills/notysoty/openagentskills/llm-cost-optimizer"><img src="https://agentmods.dev/badge/skills/notysoty/openagentskills/llm-cost-optimizer/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 LLM Cost Optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/notysoty/openagentskills/llm-cost-optimizer"><img src="https://agentmods.dev/badge/skills/notysoty/openagentskills/llm-cost-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,642 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.00031 $0.01642
Opus 5 $0.00015 $0.00821
Sonnet 5 $0.00006 $0.00328
Haiku 4.5 $0.00003 $0.00164

Measured 9d ago against content hash 43ac1af7e3b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

LLM Cost Optimizer 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 9d 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/llm-cost-optimizer/SKILL.md · 185 lines

How it starts

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

LLM Cost Optimizer

What this skill does

This skill audits an LLM application's prompts, call patterns, and model selection to identify cost reduction opportunities. It covers prompt caching, model routing (right-sizing), token reduction, batching, and output length control — the techniques that typically cut LLM costs by 40–80% without sacrificing quality.

How to use

Claude Code / Cline

Copy this file to .agents/skills/llm-cost-optimizer/SKILL.md in your project root.

Then ask:

  • "Use the LLM Cost Optimizer to audit our AI application."
  • "How can I reduce our OpenAI API costs? Here are our prompts..."

Provide:

  • Your system prompt(s)
  • Approximate daily call volume
  • Which model(s) you're using
  • Typical input/output token counts if known
  • Whether calls are real-time (low latency required) or batch (latency tolerant)

Cursor / Codex

Paste your prompts, call patterns, and current monthly spend alongside these instructions.

The Prompt / Instructions for the Agent

When asked to optimize LLM costs, audit the following areas in order of typical savings impact:

Audit 1 — Prompt Caching (savings: 50–90% on repeated prefixes)

Check: Does the system prompt stay the same across calls?

If yes, enable prompt caching. The system prompt is sent once and cached — subsequent calls only pay for the new user tokens.

# Anthropic Claude — cache_control on system prompt
response = client.messages.create(
    model="claude-opus-4-6",
    system=[{
        "type": "text",
        "text": your_system_prompt,
        "cache_control": {"type": "ephemeral"}  # cached for 5 minutes
    }],
    messages=[{"role": "user", "content": user_message}]
)

# OpenAI — automatic prompt caching for prompts > 1024 tokens
# No code change needed — cached automatically, check usage.prompt_tokens_details.cached_tokens

When it applies: Any app where the system prompt is > 1024 tokens and reused across calls. Support bots, coding assistants, document analyzers.

Read the full file on GitHub · 185 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. 9d ago First seen · 185 lines · 31 tokens per session scan A 43ac1af7e3b3

Subscribe to this mod's changes

LLM Cost Optimizer is a skill published in the GitHub repository Notysoty/openagentskills (9 stars, last pushed 25d ago), licensed MIT. It adds 31 tokens to every session and 1,642 once invoked, about $0.0002 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

thought-based-reasoning

Use when tackling complex reasoning tasks requiring step-by-step logic, multi-step arithmetic, commonsense reasoning, symbolic manipulation, or problems where simple prompting fails - provides comprehensive guide to Chain-of-Thought and related prompting techniques (Zero-shot CoT, Self-Consistency, Tree of Thoughts…

NeoLabHQ/context-engineering-kit · 85 tokens

prompt-engineering

Use this skill when you writing commands, hooks, skills for Agent, or prompts for sub agents or any other LLM interaction, including optimizing prompts, improving LLM outputs, or designing production prompt templates.

NeoLabHQ/context-engineering-kit · 45 tokens

devlab-ai-agent-engineering

A method for designing applications that use AI agents or large language models. It separates the application into stages such as understanding input, extracting information, choosing a strategy, executing, checking results, and producing an answer.

seed-forge/harness-ai-kit · 135 tokens

audit-langfuse-llm

Run a PDCA quality audit on LLM/AI features: traces, prompts, costs, evals, grounding, hallucination. Use for "audit LLM quality", "check Langfuse", "audit prompts", "check AI quality", "audit AI costs", "check traces". Jailbreak/OWASP LLM → audit-llm-security. Token caps → plan-llm-cost-guardrails.

kensaurus/cursor-kenji · 93 tokens

data-pipeline

Wire ETL, ingestion, cron, edge-function, and queue jobs correctly. Use for "build a pipeline", "sync X into Y", "nightly aggregation", "cron double-counts", "dedupe", "backfill", "the numbers are wrong after a retry". Bakes in idempotency, atomic writes, data contracts, dead-letter, and observability.

kensaurus/cursor-kenji · 81 tokens

plan-llm-cost-guardrails

Audit an LLM-powered app for runaway-cost and quota-abuse exposure, then produce a phased guardrail plan. Use when the user says "cap my AI costs", "my LLM bill could blow up", "rate limit my AI", "token budget", "runaway agent loop", or is hardening LLM features before launch.

kensaurus/cursor-kenji · 78 tokens