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.
npx agentmods add agents/thebeardedbearsas/claude-craft/cost-optimizergit clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craftWrote 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.
[](https://agentmods.dev/agents/thebeardedbearsas/claude-craft/cost-optimizer)<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>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.
| Model | Per session | Once 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 |
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.
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
- Baseline — snapshot coûts actuels par service/tag
- Waste detection — ressources non utilisées, over-provisioning, oubliées
- Optimize — quick wins (< 1 semaine) vs long-term (commitments, architecture)
- Monitor — alerts + dashboards pour éviter les régressions
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.
- 6d ago First seen · 115 lines · 26 tokens per session scan A e72010c48d11
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.
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.
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…
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…
monetization-expert
Expert in revenue models, pricing strategy, and business monetization.
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.
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.