cost-optimizer

cost-optimizer is a skill for Claude Code from curiositech/some_claude_skills. It costs 107 tokens per session (1,148 once invoked), scanned A, original, MIT.

A budgeting skill for workflows where several language-model tasks run as a directed graph, meaning tasks connected by dependencies. It tracks spending and can choose lower-cost models, skip optional tasks, or stop when a budget is exceeded.

In plain words
What is it for?
Setting budgets, monitoring costs during execution, changing model levels as funds run low, skipping optional work, stopping safely, and reviewing spending afterward.
Why use it?
It helps keep an execution within a spending limit and shows which tasks use the most money.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Part of the cost-optimizer plugin — 1 skill shipped together

Good fit Setting budgets, monitoring costs during execution, changing model levels as funds run low, skipping optional work, stopping safely, and reviewing spending afterward.

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

Made for: Claude Code.

Or install cost-optimizer, the plugin that ships this one along with the rest of its 1 skill.

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 cost-optimizer

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/curiositech/some_claude_skills/cost-optimizer"><img src="https://agentmods.dev/badge/skills/curiositech/some_claude_skills/cost-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,148 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00107 $0.01148
Opus 5.5 $0.00043 $0.00459
Sonnet 5.5 $0.00021 $0.00230
Haiku 4.5 $0.00011 $0.00115

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

Security

Grade A, and why

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 3mo 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.

.claude/skills/cost-optimizer/SKILL.md · 118 lines

How it starts

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

Cost Optimizer

Tracks cumulative LLM costs across DAG execution and makes real-time decisions to stay within budget: downgrade models, skip optional nodes, or stop early.


When to Use

✅ Use for:

  • Setting and enforcing cost budgets for DAG executions
  • Real-time cost monitoring during execution
  • Deciding when to downgrade model tiers mid-execution
  • Identifying which nodes are most expensive and why
  • Post-execution cost analysis and optimization recommendations

❌ NOT for:

  • Choosing which model to use per node (use llm-router)
  • Provider pricing comparisons (static data, not a skill)
  • Billing or invoicing features

Budget Enforcement Process

flowchart TD
  N[Node about to execute] --> C[Check: spent + estimated_node_cost vs budget]
  C --> S{Within budget?}
  S -->|Yes, &gt;20% remaining| E[Execute at planned model tier]
  S -->|Yes, &lt;20% remaining| W[Execute but downgrade to Tier 1 if possible]
  S -->|No| D{Node optional?}
  D -->|Yes| SK[Skip node]
  D -->|No| H{Human gate available?}
  H -->|Yes| A[Ask human: continue over budget?]
  H -->|No| ST[Stop execution, return partial results]

Budget Tiers

Budget Remaining Action
>50% Execute at planned model tier
20-50% Log warning. Continue at planned tier.
10-20% Downgrade remaining Tier 2 nodes to Tier 1 (Haiku)
5-10% Downgrade ALL remaining nodes to Tier 1. Skip optional nodes.
<5% Stop execution unless next node is critical path
0% Stop. Return partial results with cost breakdown.

Cost Estimation Per Node

Before each node executes, estimate its cost:

estimated_cost = (avg_input_tokens × input_price + avg_output_tokens × output_price)

Use historical averages for this skill + model combination. If no history, use defaults:

  • Tier 1 (Haiku): ~800 input + 400 output = ~$0.001
  • Tier 2 (Sonnet): ~2000 input + 1000 output = ~$0.012
  • Tier 3 (Opus): ~3000 input + 1500 output = ~$0.16

Read the full file on GitHub · 118 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. 3mo ago First seen · 118 lines · 107 tokens per session scan A bc7525f164e7

Subscribe to this mod's changes

cost-optimizer is a skill published in the GitHub repository curiositech/some_claude_skills (278 stars, last pushed 3d ago), licensed MIT. It adds 107 tokens to every session and 1,148 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-08-30.

Related

cost-optimizer compared with skills from other repositories

cost-optimizer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cost-optimizercuriositech/some_claude_skillsSkill2783d agoMITA107Claude Code
imagegenopenai/codexSkill137kyesterdayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101kyesterdayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144kyesterdayMITA95Claude Code