cost-optimization

cost-optimization is a skill for Claude Code, Codex from wshobson/agents. It costs 48 tokens per session (1,664 once invoked), scanned A, original, MIT.

A guide to reducing spending on cloud infrastructure across AWS, Azure, Google Cloud, and Oracle Cloud. It explains how to track usage, adjust resource sizes, and choose suitable pricing plans.

In plain words
What is it for?
Use it to review cloud bills, right-size resources, remove idle infrastructure, set budget alerts, and compare reserved, spot, or committed-use pricing.
Why use it?
It helps find wasted spending from oversized, idle, or poorly managed cloud resources while keeping required performance. It also provides a structure for budgets, tagging, and cost oversight.

Skill for Claude CodeCodex

Part of the cloud-infrastructure plugin — 8 skills, 3 agents shipped together

About the project

Agentic Plugin Marketplace is a collection of reusable plugins, agents, skills, commands, and rules for coding-agent tools including Claude Code, Codex CLI, Cursor, OpenCode, Antigravity CLI, and GitHub Copilot. It is for developers assembling agentic workflows across multiple harnesses from shared Markdown sources, and the catalogue entries are examples or subsets of those workflow components.

wshobson/agents · 39,428 stars · on GitHub

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 skills/wshobson/agents/cost-optimization
Any agent
npx skills add wshobson/agents --skill cost-optimization
Clone the repo
git clone --depth 1 https://github.com/wshobson/agents

Made for: Claude Code, Codex.

Or install cloud-infrastructure, the plugin that ships this one along with the rest of its 8 skills, 3 agents.

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-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/wshobson/agents/cost-optimization.svg)](https://agentmods.dev/skills/wshobson/agents/cost-optimization)
Your own site
<a href="https://agentmods.dev/skills/wshobson/agents/cost-optimization"><img src="https://agentmods.dev/badge/skills/wshobson/agents/cost-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,664 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.00048 $0.01664
Opus 5 $0.00024 $0.00832
Sonnet 5 $0.00010 $0.00333
Haiku 4.5 $0.00005 $0.00166

Measured 2d ago against content hash ee0bd8b8054a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cost-optimization 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 2d 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.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

plugins/cloud-infrastructure/skills/cost-optimization/SKILL.md · 314 lines

How it starts

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

Cloud Cost Optimization

Strategies and patterns for optimizing cloud costs across AWS, Azure, GCP, and OCI.

Purpose

Implement systematic cost optimization strategies to reduce cloud spending while maintaining performance and reliability.

When to Use

  • Reduce cloud spending
  • Right-size resources
  • Implement cost governance
  • Optimize multi-cloud costs
  • Meet budget constraints

Cost Optimization Framework

1. Visibility

  • Implement cost allocation tags
  • Use cloud cost management tools
  • Set up budget alerts
  • Create cost dashboards

2. Right-Sizing

  • Analyze resource utilization
  • Downsize over-provisioned resources
  • Use auto-scaling
  • Remove idle resources

3. Pricing Models

  • Use reserved capacity
  • Leverage spot/preemptible instances
  • Implement savings plans
  • Use committed use discounts

4. Architecture Optimization

  • Use managed services
  • Implement caching
  • Optimize data transfer
  • Use lifecycle policies

AWS Cost Optimization

Reserved Instances

Savings: 30-72% vs On-Demand
Term: 1 or 3 years
Payment: All/Partial/No upfront
Flexibility: Standard or Convertible

Savings Plans

Compute Savings Plans: 66% savings
EC2 Instance Savings Plans: 72% savings
Applies to: EC2, Fargate, Lambda
Flexible across: Instance families, regions, OS

Spot Instances

Savings: Up to 90% vs On-Demand
Best for: Batch jobs, CI/CD, stateless workloads
Risk: 2-minute interruption notice
Strategy: Mix with On-Demand for resilience

S3 Cost Optimization

resource "aws_s3_bucket_lifecycle_configuration" "example" {
  bucket = aws_s3_bucket.example.id

  rule {
    id     = "transition-to-ia"
    status = "Enabled"

    transition {
      days          = 30
      storage_class = "STANDARD_IA"
    }

    transition {
      days          = 90
      storage_class = "GLACIER"
    }

    expiration {
      days = 365
    }
  }
}

Azure Cost Optimization

Reserved VM Instances

  • 1 or 3 year terms
  • Up to 72% savings
  • Flexible sizing
  • Exchangeable

Read the full file on GitHub · 314 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 314 lines · 48 tokens per session scan A ee0bd8b8054a

Subscribe to this mod's changes

cost-optimization is a skill published in the GitHub repository wshobson/agents (39,428 stars, last pushed 3d ago), licensed MIT. It adds 48 tokens to every session and 1,664 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-09-03.

Related

Other skills, from other repositories

flow-nexus-swarm

Cloud-based AI swarm deployment and event-driven workflow automation with Flow Nexus platform.

ruvnet/ruflo · 20 tokens

artifact-deploy

One-click deploy a user's pre-built app/artifact into their OWN AWS account and get a global public HTTPS link (Vercel-like), with a default TTL and promote-to-persistent. Use when the user says "deploy this", "ship this demo", "give me a public link", "share this externally", or "deploy to AWS".

kirodotdev/KiroCrew · 74 tokens

infra-sync

Keep Terraform and CDK infrastructure in sync. Compares terraform/aws-ecs/ and infra/ to identify discrepancies in ECS services, networking, storage, secrets, IAM, and configuration. Reports parity gaps and generates fixes for the target IaC tool. Use when changes are made to either Terraform or CDK infrastructure.

agentic-community/mcp-gateway-registry · 66 tokens

vigilante-issue-implementation-on-terraform

Implement a GitHub issue end-to-end when Vigilante dispatches work for a Terraform repository with fmt, validate, and secret-safe infrastructure guidance.

aliengiraffe/vigilante · 40 tokens

container-apps-deployment

Container Apps deployment gotchas and SPA frontend patterns for Azure. Supplements the official azure-prepare plugin skill with additional patterns for zone redundancy, azure.yaml configuration, and SPA frontend deployment (VITEAPIURL). USE FOR: Container Apps zone redundancy errors, managed-identity ACR pulls…

DanWahlin/github-azure-agentic-journeys · 124 tokens

superset-azure

Deploy Apache Superset on Azure. Use when deploying Superset for BI/data visualization with PostgreSQL backend.

DanWahlin/github-azure-agentic-journeys · 26 tokens