LO

lower-anthropic-bill

Identifies opportunities to lower Claude API spend through cache optimization, batching, and model routing.

Install

mkdir -p .claude/skills/lower-anthropic-bill && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11781" && unzip -o skill.zip -d .claude/skills/lower-anthropic-bill && rm skill.zip

Installs to .claude/skills/lower-anthropic-bill

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when a developer wants to cut Claude or Anthropic API spend: "lower my Anthropic bill", "audit my Claude spend", "find prompt cache failures", "why is cache_read zero", "can we move this from Claude to OpenAI or a local model". Audits call sites, tokenizer risk, cache structure, batchability, and route candidates before any code edits.
341 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Inventory Anthropic call sites in a codebase
  • Re-baseline tokenizer risk for model upgrades
  • Audit prompt-cache structure for optimization opportunities
  • Rank opportunity ledger by route and estimate addressable spend
  • Pick candidate interventions for cost reduction
  • Generate a local audit report without code edits

How it works

The skill audits Anthropic API spend by inventorying call sites, re-baselining tokenizer risk, auditing prompt-cache structure, and ranking cost-saving opportunities. It generates a local audit report without making code edits.

Inputs & outputs

You give it
Path to app/service calling Anthropic, Anthropic usage export, gateway capture directory, sampled response `usage` block, or monthly call volume per route
You get back
Local audit report including call-site inventory, tokenizer re-baseline status, cache-hit findings, opportunity ledger, and route candidates

When to use lower-anthropic-bill

  • Reducing monthly Anthropic API costs
  • Auditing Claude API token usage
  • Optimizing prompt cache hit rates

About this skill

Lower Anthropic Bill

Use this worker for the installer happy path and for any developer who arrives with a Claude bill, Anthropic usage export, or codebase that calls the Messages API. The first deliverable is a local audit: call-site inventory, current price assumptions, tokenizer re-baseline risk, cache-hit opportunities, batchability, and route candidates. Do not edit code during the audit.

Safety Gates

  • Local-first. Static repo inspection and local usage-export parsing are the default. Do not upload source, prompts, traces, completions, datasets, repo paths, secrets, or private notes without explicit approval for that exact action.
  • No provider spend without a named surface, model, data class, row count, and dollar envelope. Token-counting, cache probes, OpenAI migration tests, and GEPA reflection all need approval if they call a provider. Recommend the decision-sized test and explain its expected savings, time, and confidence; one approval may cover the named bounded test matrix.
  • No silent source edits. Adding cache_control, changing model strings, rewriting prompts, or adding an OpenAI route is a follow-up change after the audit report is reviewed.
  • Treat dollar values as estimates until backed by usage exports or measured runs. Savings claims require the normal claim.json evidence path from ../optimize-workload/SKILL.md.

Intake

Default to the current repo. Ask for at most one missing input:

  • a path to the app or service that calls Anthropic;
  • an Anthropic usage export, gateway capture directory, or sampled response usage block;
  • monthly call volume per route if no export exists.

If the installer prompt set the lower-Anthropic-bill goal, assume the objective is cost reduction with no quality regression. Ask only for the target repo or usage export if you cannot infer it.

If the developer asks to inspect billing email, invoices, receipts, or an authenticated billing website, route that optional evidence source through ../inspect-billing-sources/SKILL.md before estimating hotspots from bill data.

Flow

  1. Refresh vendor facts. Read reference.md before quoting prices, tokenizer changes, cache minimums, batch discounts, or OpenAI migration advice. Re-verify online when the work will be sent externally.
  2. Inventory Anthropic call sites. Inspect dependencies, wrappers, env var names, model IDs, prompt builders, tool definitions, retries, batch jobs, and tracing. Use the scan checklist in reference.md and surface the inventory before recommending changes.
  3. Add optional bill evidence. If the developer approved email, invoice, usage-export, or browser inspection, read the hotspot ledger produced by inspect-billing-sources and join it to the call-site inventory. Keep unattributed spend explicit.
  4. Re-baseline token risk. Flag Opus 4.7+ or newer model upgrades, because Anthropic documents a new tokenizer that can increase token counts for the same text. Prefer usage blocks or /v1/messages/count_tokens on synthetic or approved payloads; otherwise report this as a risk requiring measurement.
  5. Audit prompt-cache structure. Check whether stable tools, system prompts, few-shots, schemas, documents, and long histories are eligible for caching; whether volatile values appear before cache breakpoints; whether prefixes meet current model minimums; and whether response usage shows cache_read_input_tokens.
  6. Rank the opportunity ledger. Group findings by route and estimate addressable spend only from explicit volume, usage exports, or clearly labeled synthetic assumptions. Rank by addressable spend × confidence × expected implementation leverage so a small, easy tail item does not displace the concentrated cost center. Include confidence: high, medium, unknown, or pending eval. When value depends on who or what consumes an output now or later, do not invent a universal taxonomy: expose the candidate segments and let the developer drill into representative rows before labeling work as low-value or removable.
  7. Pick candidate interventions. Start with the intervention offering the largest expected addressable savings at sufficient quality and confidence. Consider cache fixes, batch moves, max-token/output tightening, older or cheaper Anthropic models, local/open-weight candidates, OpenAI routes, and GEPA prompt repair in the order supported by the opportunity ledger—not a fixed cheapest-first ladder. Prefer the lower-cost test only when alternatives have comparable expected information value. Follow ../understudy/reference.md → Outcome-first spend posture. Route model comparisons to ../compare-model-sweep/SKILL.md and GEPA to ../optimize-workload/SKILL.md.
  8. Stop at the audit unless asked to implement. If the developer chooses a fix, make one small reviewable change and verify it with the relevant usage field or eval. Do not bundle unrelated route migrations.
  9. Offer anonymous savings sharing only after evidence exists. When a value report or claim.json supports the result, route to ../share-savings/SKILL.md. Never send prompts, traces, repo names, company names, or contact details.

Output Standard

End with:

  • repo or export inspected;
  • Anthropic call-site inventory;
  • tokenizer re-baseline status;
  • cache-hit findings and exact invalidators, when known;
  • opportunity ledger with assumptions and confidence labels;
  • route candidates split into cache, batch, cheaper Anthropic, OpenAI, and local/open-weight lanes;
  • result type: audit, measured sample, migration plan, validation, or blocked;
  • one recommended next local command or approval-gated test.

References

When not to use it

  • When the user wants to upload source, prompts, traces, completions, datasets, repo paths, secrets, or private notes without explicit approval
  • When the user wants to make silent source edits
  • When the user wants to implement code changes during the audit phase

Limitations

  • No provider spend without a named surface, model, data class, row count, and dollar cap
  • No silent source edits
  • Treats dollar values as estimates until backed by usage exports or measured runs

How it compares

This skill provides a structured audit of Anthropic API usage to identify cost-saving opportunities before any code changes, offering a data-driven approach to optimize spend rather than direct modification.

Compared to similar skills

lower-anthropic-bill side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
lower-anthropic-bill (this skill)01moNo flagsAdvanced
get-available-resources17moReviewBeginner
google-analytics436moReviewIntermediate
backtesting-trading-strategies1026dReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

get-available-resources

davila7

This skill should be used at the start of any computationally intensive scientific task to detect and report available system resources (CPU cores, GPUs, memory, disk space). It creates a JSON file with resource information and strategic recommendations that inform computational approach decisions such as whether to use parallel processing (joblib, multiprocessing), out-of-core computing (Dask, Zarr), GPU acceleration (PyTorch, JAX), or memory-efficient strategies. Use this skill before running analyses, training models, processing large datasets, or any task where resource constraints matter.

10

google-analytics

davila7

Analyze Google Analytics data, review website performance metrics, identify traffic patterns, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization.

43193

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

spark-optimization

wshobson

Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.

431

perf-analyzer

ComposioHQ

Use when synthesizing perf findings into evidence-backed recommendations and decisions.

324

clickhouse-io

affaan-m

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

620

Search skills

Search the agent skills registry