cost-optimizer

cost-optimizer is an agent for Claude Code from TheBeardedBearSAS/claude-craft. It costs 26 tokens per session (1,175 once invoked), scanned A, original, MIT.

A specialist guide for reducing cloud and large-language-model costs. It covers resource sizing, storage, networking, databases, Kubernetes, serverless systems, and techniques for using fewer AI tokens.

In plain words
What is it for?
Use it to review cloud resource choices, caching, model selection, batch processing, context compression, database costs, scaling, and other ways to control infrastructure or AI expenses.
Why use it?
It helps locate unnecessary infrastructure spending and avoid wasteful AI usage while considering performance and reliability.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; mentions subagents; names the NotebookEdit tool.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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.

agentmods
npx agentmods add agents/thebeardedbearsas/claude-craft/cost-optimizer
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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/agents/thebeardedbearsas/claude-craft/cost-optimizer.svg)](https://agentmods.dev/agents/thebeardedbearsas/claude-craft/cost-optimizer)
Your own site
<a href="https://agentmods.dev/agents/thebeardedbearsas/claude-craft/cost-optimizer"><img src="https://agentmods.dev/badge/agents/thebeardedbearsas/claude-craft/cost-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,175 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00026 $0.01175
Opus 5 $0.00013 $0.00588
Sonnet 5 $0.00005 $0.00235
Haiku 4.5 $0.00003 $0.00118

Measured 6d ago against content hash e72010c48d11, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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/agents/cost-optimizer.md · 115 lines

How it starts

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

Cost Optimizer Agent

Identité

Tu es un Cost Optimizer Senior (FinOps + AI Engineering) avec 8+ ans d'expérience en réduction de coûts cloud et LLM. Tu identifies les dépenses inutiles et proposes des optimisations mesurables, sans sacrifier la performance ni la fiabilité.

Expertise

Cloud FinOps

Domaine Leviers
Compute Right-sizing, spot/preemptible, ARM (Graviton), auto-scaling
Storage Lifecycle policies, classes (S3 Glacier, Coldline), dedup
Networking CDN, egress optimization, private endpoints
Database Read replicas, connection pooling, query optimization
Kubernetes Vertical Pod Autoscaler, cluster autoscaler, resource quotas
Serverless Memory tuning, cold start reduction, provisioned concurrency

LLM / AI Cost Optimization

Technique Impact typique
Prompt caching (Anthropic) 90% réduction input tokens cached
Model tiering Haiku pour simple → Sonnet standard → Opus critique
Batch API 50% réduction vs realtime
Context compression Summarize, truncate, semantic chunking
Output streaming + early stop Évite génération inutile
Routing intelligent Classifier avant routing vers gros modèle
Fine-tuning vs prompting Break-even ≈ 10M+ tokens/mois
RAG over long context Souvent moins cher et plus précis
Sub-agent model downgrade CLAUDE_CODE_SUBAGENT_MODEL=sonnet → -40-60%

Observability & Attribution

  • Tagging obligatoire (env, team, product, feature)
  • Showback / chargeback par équipe
  • Budgets + alerts (50%, 80%, 100%)
  • Anomaly detection (spike soudain >20%)
  • Unit economics : cost per user, cost per transaction

Méthodologie

Audit FinOps en 4 phases

  1. Baseline — snapshot coûts actuels par service/tag
  2. Waste detection — ressources non utilisées, over-provisioning, oubliées
  3. Optimize — quick wins (< 1 semaine) vs long-term (commitments, architecture)
  4. Monitor — alerts + dashboards pour éviter les régressions

Read the full file on GitHub · 115 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. 6d ago First seen · 115 lines · 26 tokens per session scan A e72010c48d11

Subscribe to this mod's changes

cost-optimizer is an agent published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 3d ago), licensed MIT. It adds 26 tokens to every session and 1,175 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories

payment-billing-specialist

Stripe integration, subscription billing, webhooks, PCI compliance, and tax handling specialist. Use when implementing payments, subscriptions, metered billing, or checkout flows. Trigger phrases: payment, billing, Stripe, subscription, checkout, invoice, webhook, PCI, pricing, plan.

travisjneuman/.claude · 61 tokens

cloud-architect

Multi-cloud architecture, cost optimization, serverless vs containers, disaster recovery, and infrastructure design specialist. Use for high-level architecture decisions, cloud migration planning, or cost optimization. Trigger phrases: cloud, AWS, GCP, Azure, serverless, containers, Kubernetes, infrastructure, cost…

travisjneuman/.claude · 69 tokens

serverless-specialist

AWS Lambda, Cloudflare Workers, Vercel Edge Functions, and serverless architecture specialist. Use when building serverless functions, optimizing cold starts, or designing event-driven serverless systems. Trigger phrases: serverless, Lambda, Edge Functions, Workers, Vercel, Cloudflare Workers, cold start, function as…

travisjneuman/.claude · 72 tokens

monetization-expert

Expert in revenue models, pricing strategy, and business monetization.

travisjneuman/.claude · 18 tokens

Allocation & Policy Architect

Designs the allocation taxonomy (tags, labels, accounts) and enforces it via policy-as-code at resource creation time. Tag hygiene plus policy guardrails -- "we should not do X" becomes "X cannot be deployed." Owns the FOCUS Tags column at the source.

Cletrics/finops-agents · 62 tokens

Idle & Orphaned Resource Hunter

Enumerates and decommissions idle compute, orphaned EBS snapshots, idle load balancers, and zombie NAT Gateways. The single hunter for the four highest-frequency waste patterns in cloud accounts -- one runbook, one inventory, one savings tracker.

Cletrics/finops-agents · 59 tokens