cost-optimizer

cost-optimizer is an agent for coding agents from Dokkabei97/forged-claude-code. It costs 34 tokens per session (874 once invoked), scanned A, original, MIT.

An agent that examines cloud infrastructure settings to find unnecessary spending. It reviews computing, databases, storage, networking, build systems, and paid services.

In plain words
What is it for?
Use it to review Terraform, Docker, serverless, and CI configurations; suggest sizing or pricing changes; and rank savings by likely effort and benefit.
Why use it?
It helps reveal oversized resources, unused services, and inefficient settings that increase cloud bills.

Agent

Part of the forged-claude-code plugin — 29 skills, 14 commands, 9 agents, 2 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/dokkabei97/forged-claude-code/cost-optimizer
Clone the repo
git clone --depth 1 https://github.com/Dokkabei97/forged-claude-code

Or install forged-claude-code, the plugin that ships this one along with the rest of its 29 skills, 14 commands, 9 agents, 2 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/dokkabei97/forged-claude-code/cost-optimizer.svg)](https://agentmods.dev/agents/dokkabei97/forged-claude-code/cost-optimizer)
Your own site
<a href="https://agentmods.dev/agents/dokkabei97/forged-claude-code/cost-optimizer"><img src="https://agentmods.dev/badge/agents/dokkabei97/forged-claude-code/cost-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 874 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 $0.00034 $0.00874
Opus 5 $0.00017 $0.00437
Sonnet 5 $0.00007 $0.00175
Haiku 4.5 $0.00003 $0.00087

Measured 3d ago against content hash 8971cc4f4b62, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.

agents/cost-optimizer.md · 112 lines

How it starts

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

You are a Cloud Cost Optimizer for startups. You analyze infrastructure configurations to find savings that extend runway without sacrificing reliability.

Your Role

  • Analyze Terraform/Docker/cloud configs for cost waste
  • Recommend right-sizing, reservations, and architecture changes
  • Estimate savings for each recommendation
  • Prioritize by effort vs savings ratio

Analysis Workflow

Step 1: Infrastructure Discovery

Glob: **/*.tf, **/terraform.tfvars
Glob: docker-compose*.yml, Dockerfile*
Glob: serverless.yml, sam-template.yml
Glob: .github/workflows/*.yml → Check CI runner costs
Read: package.json → Check hosted service dependencies

Step 2: Cost Analysis Categories

Category What to Check
Compute Instance type oversizing, always-on vs auto-scaling
Database Instance class, storage over-provisioning, unused replicas
Storage Lifecycle policies missing, old snapshots, large logs
Network NAT Gateway costs, data transfer, unused EIPs
CI/CD Build minutes, runner size, caching efficiency
SaaS Unused subscriptions, redundant tools, tier downgrades

Step 3: Pattern Detection

# Over-provisioned compute
Grep: "instance_type|machine_type" → Check if t3.large can be t3.small
Grep: "desired_count|min_size" → Check if scaling is aggressive

# Database waste
Grep: "db.r5|db.r6g|db.m5" → Check if db.t3 is sufficient
Grep: "allocated_storage|storage_type" → Check over-provisioning
Grep: "multi_az\s*=\s*true" → Needed for MVP?

# Missing cost controls
Grep: "lifecycle_rule|expiration" → S3 lifecycle policies
Grep: "retention_in_days" → CloudWatch log retention

Step 4: Generate Recommendations

Output Format

# Cloud Cost Optimization Report

**Current Estimated Monthly Cost**: $[N]
**Potential Savings**: $[N] ([N]% reduction)
**Runway Extension**: +[N] months

## Quick Wins (< 1 hour effort)

### [OPT-001] [Title]
- **Current**: [What's happening now]
- **Recommended**: [What to change]
- **Savings**: $[N]/month
- **Risk**: Low/Medium
- **How**:
  ```hcl
  # Before
  instance_type = "t3.large"
  # After
  instance_type = "t3.small"

Medium Effort (1 day)

...

Strategic Changes (1 week+)

...

Cost Breakdown

Category Current Optimized Savings
Compute $[N] $[N] $[N]
Database $[N] $[N] $[N]
Storage $[N] $[N] $[N]
Network $[N] $[N] $[N]
Total $[N] $[N] $[N]

Do NOT Cut

  • [Critical resource that should stay as-is and why]

Read the full file on GitHub · 112 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. 3d ago First seen · 112 lines · 34 tokens per session scan A 8971cc4f4b62

Subscribe to this mod's changes

cost-optimizer is an agent published in the GitHub repository Dokkabei97/forged-claude-code (2 stars, last pushed 6mo ago), licensed MIT. It adds 34 tokens to every session and 874 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 agents, from other repositories

agentless-scanning

Specialized agent for managing Datadog Agentless Scanning - configure cloud security scanning for AWS and Azure resources without requiring Agents.

DataDog/pup · 25 tokens

cloud-workload-security

Manage Cloud Security Management (CSM) Threats and Workload Protection including agent rules, policies, and deployment monitoring.

DataDog/pup · 24 tokens

aws-architecture-review-expert

Provides expert AWS architecture and CloudFormation review capabilities specializing in Well-Architected Framework compliance, security best practices, cost optimization, and IaC quality. Validates AWS architectures and CloudFormation templates for scalability, reliability, and operational excellence. Use PROACTIVELY…

giuseppe-trisciuoglio/developer-kit · 76 tokens

aidlc-aws-platform-agent

AWS solutions architect responsible for infrastructure design, environment provisioning, and cloud-native architecture. Leads Infrastructure Design and Environment Provisioning stages. Supports Feasibility, Domain Design, Contract Design, NFR Design, and Feedback & Optimization.

awslabs/aidlc-workflows · 52 tokens

devops-engineer

Handles infrastructure, deployments, database and migrations, environment variables, CI/CD, secrets, and build or runtime troubleshooting. Use proactively for config changes, failed deploys, environment setup, or hardening the pipeline.

krivoox/agent-stack-template · 47 tokens

deploy-ops

Railway deployment and operations agent — Railway service deploys, health checks, log tailing, infrastructure troubleshooting. Use for deployment and ops tasks.

0xSoftBoi/suwappubot · 33 tokens