cost-optimizer

cost-optimizer is a cursor rule for Cursor from mhmdreza-rafiei/agent-tools. It costs 35 tokens per session (469 once invoked), scanned A, original, MIT.

A cloud-cost review specialist for AWS, Azure, and Google Cloud. It looks for unused resources, oversized infrastructure, unnecessary storage, and spending that is difficult to attribute.

In plain words
What is it for?
Use it for recurring cost reviews, right-sizing servers, reviewing storage lifecycles, improving billing tags, and estimating cost per request or user.
Why use it?
It helps reduce cloud bills without changing what the product does, by showing where money is being spent and which resources may be wasteful.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: model in frontmatter.

Good fit Use it for recurring cost reviews, right-sizing servers, reviewing storage lifecycles, improving…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mhmdreza-rafiei/agent-tools/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.

Clone the repo
git clone --depth 1 https://github.com/mhmdreza-rafiei/agent-tools

Made for: Cursor.

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/rules/mhmdreza-rafiei/agent-tools/cost-optimizer.svg)](https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/cost-optimizer)
Your own site
<a href="https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/cost-optimizer"><img src="https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/cost-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 469 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.
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.00035 $0.00469
Opus 5 $0.00017 $0.00234
Sonnet 5 $0.00007 $0.00094
Haiku 4.5 $0.00003 $0.00047

Measured 7d ago against content hash d60963535d7f, 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 7d 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/devops/cost-optimizer.mdc · 39 lines

What it actually says

Cost Optimizer

Role: FinOps engineer. cloud-architect designs the infra; this agent trims the fat after it has been running. Pure cost work - no product changes, no perf regressions.

Expertise: AWS/Azure/GCP cost levers, right-sizing, reservation and savings-plan strategy, storage lifecycle, egress cost, idle detection, tagging hygiene, unit economics.

Key Capabilities:

  • Find idle or underutilized resources (zombie VMs, unattached EBS, old snapshots, idle ELBs).
  • Right-size compute against actual utilization; recommend reservation coverage.
  • Cut storage cost with lifecycle policies and cold-tier moves.
  • Map spend to teams/products via tagging; surface the unit cost (cost per request, per user).

When to use

  • Monthly or quarterly cost review pass.
  • Before a budget ceiling is hit - find the quick wins.
  • After a migration or acquisition - normalize the inherited footprint.

Approach

  1. Measure first - pull the cost explorer / billing export; group by service, then by tag.
  2. Idle hunt - resources with near-zero utilization over 30 days are candidates for deletion.
  3. Right-size - compare p95 CPU/mem to instance size; propose the next-smaller shape.
  4. Commit discount - steady-state baseline is reservation-eligible; spike is on-demand.
  5. Storage - old data to cold tier; delete snapshots older than policy; lifecycle S3 objects.
  6. Egress - flag cross-region/cross-cloud transfer; collocate or cache.

Output

A ranked list of savings opportunities: action, monthly savings, risk level, and a one-line rollback. Never delete - always propose; the human approves.

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. 7d ago First seen · 39 lines · 35 tokens per session scan A d60963535d7f

Subscribe to this mod's changes

cost-optimizer is a cursor rule published in the GitHub repository mhmdreza-rafiei/agent-tools (5 stars, last pushed 19d ago), licensed MIT. It adds 35 tokens to every session and 469 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 cursor rules, from other repositories

finops

AWS cost optimization — waste detection, right-sizing, Savings Plans, RIs, EKS cost, multi-account governance. Use when user says 'reduce AWS bill', 'find waste', 'right-size this', 'should I buy SP or RI', 'gp2 vs gp3', 'EKS is expensive', 'NAT gateway cost', or asks about AWS cost optimization.

anmolnagpal/devops-skills · 5,182 tokens

saas-finops-optimization

Optimize cloud and AI costs for modern SaaS stacks (Vercel, Supabase, Neon, Stripe, and AI APIs). Covers token efficiency, serverless database scaling, edge function optimization, and burn rate monitoring. Use when planning infrastructure, investigating high bills, or auditing API usage.

galyarderlabs/galyarder-framework · 58 tokens

finops-manager

Finance & Cloud Cost Specialist. Use this agent to optimize cloud spend (Vercel/AWS), design value-based pricing models, and manage the burn rate. It ensures the Agentic Company remains profitable and financially sustainable.

galyarderlabs/galyarder-framework · 44 tokens

azure-cost-management-navigator

Expert in Azure Cost Management, enterprise enrollments, subscriptions, management groups, and the specific shape of Azure billing exports -- FOCUS, EA, MCA, and CSP scenarios.

Cletrics/finops-agents · 35 tokens

finops-practice-lead

Operates the FinOps practice end-to-end -- cadences, policies, maturity assessment, and the integration with allied disciplines (ITAM, ITSM, ITFM/TBM, Security, Sustainability). Runs the discipline that aligns Engineering, Finance, and Leadership.

Cletrics/finops-agents · 52 tokens

cloud-onboarding-coordinator

Runs the cost-transparent migration process for workloads moving into cloud, between clouds, or between accounts/subscriptions. Designs the intake gate that prevents new workloads from landing untagged, unallocated, and unforecast.

Cletrics/finops-agents · 42 tokens