aws-cost-optimization

aws-cost-optimization is a skill for Claude Code, Codex from BagelHole/DevOps-Security-Agent-Skills. It costs 41 tokens per session (2,700 once invoked), scanned A, original, MIT.

A guide for lowering the cost of running workloads on Amazon Web Services (AWS) while considering reliability and performance.

In plain words
What is it for?
Use it to review AWS spending, resize EC2, RDS, EKS, or Lambda workloads, choose pricing commitments, set budget alerts, remove waste, and improve data-transfer and storage costs.
Why use it?
It helps explain unexpected cloud bills and identify unused, oversized, or unnecessarily expensive resources.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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/bagelhole/devops-security-agent-skills/aws-cost-optimization
Any agent
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill aws-cost-optimization
Clone the repo
git clone --depth 1 https://github.com/BagelHole/DevOps-Security-Agent-Skills

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/bagelhole/devops-security-agent-skills/aws-cost-optimization.svg)](https://agentmods.dev/skills/bagelhole/devops-security-agent-skills/aws-cost-optimization)
Your own site
<a href="https://agentmods.dev/skills/bagelhole/devops-security-agent-skills/aws-cost-optimization"><img src="https://agentmods.dev/badge/skills/bagelhole/devops-security-agent-skills/aws-cost-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,700 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.00041 $0.02700
Opus 5 $0.00020 $0.01350
Sonnet 5 $0.00008 $0.00540
Haiku 4.5 $0.00004 $0.00270

Measured 6d ago against content hash 32439efd3ece, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

aws-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 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.

infrastructure/cloud-aws/aws-cost-optimization/SKILL.md · 315 lines

How it starts

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

AWS Cost Optimization

Apply practical FinOps controls to reduce AWS spend without sacrificing reliability or performance.

When to Use This Skill

  • Monthly AWS bill spikes unexpectedly or exceeds budget thresholds
  • Preparing cost reviews with engineering and finance teams
  • Rightsizing EC2, RDS, EKS, or Lambda workloads after load testing
  • Choosing between Savings Plans, Reserved Instances, or on-demand pricing
  • Setting up automated budget alerts and anomaly detection
  • Cleaning up unused resources (unattached EBS, idle load balancers, old snapshots)
  • Optimizing data transfer costs across regions and AZs

Prerequisites

  • AWS CLI v2 installed and configured (aws configure)
  • IAM permissions: ce:*, budgets:*, ec2:Describe*, cloudwatch:PutMetricAlarm, s3:PutLifecycleConfiguration
  • Cost Explorer enabled in the AWS billing console (takes 24 hours to populate)
  • Cost allocation tags activated in the Billing console

Cost Review Workflow

  1. Tag every resource by team, service, environment, and cost center.
  2. Enable Cost Explorer and activate Cost and Usage Reports (CUR) to S3.
  3. Identify top spend drivers by service, account, and tag.
  4. Rightsize underutilized compute and storage based on CloudWatch metrics.
  5. Apply commitment discounts (Savings Plans or RIs) for stable baseline usage.
  6. Set budgets, anomaly alerts, and build KPI dashboards.
  7. Review monthly and iterate.

Cost Explorer CLI Commands

# Get cost and usage for the last 30 days grouped by service
aws ce get-cost-and-usage \
  --time-period Start=2026-02-01,End=2026-03-01 \
  --granularity MONTHLY \
  --metrics "BlendedCost" "UnblendedCost" "UsageQuantity" \
  --group-by Type=DIMENSION,Key=SERVICE

# Get cost forecast for the next 30 days
aws ce get-cost-forecast \
  --time-period Start=2026-03-24,End=2026-04-24 \
  --metric UNBLENDED_COST \
  --granularity MONTHLY

# Get cost grouped by a specific tag (e.g., team)
aws ce get-cost-and-usage \
  --time-period Start=2026-02-01,End=2026-03-01 \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --group-by Type=TAG,Key=team

# Get rightsizing recommendations for EC2
aws ce get-rightsizing-recommendation \
  --service "AmazonEC2" \
  --configuration '{"RecommendationTarget":"SAME_INSTANCE_FAMILY","BenefitsConsidered":true}'

# Get Savings Plans purchase recommendation
aws ce get-savings-plans-purchase-recommendation \
  --savings-plans-type COMPUTE_SP \
  --term-in-years ONE_YEAR \
  --payment-option NO_UPFRONT \
  --lookback-period-in-days SIXTY_DAYS

# Get Savings Plans utilization
aws ce get-savings-plans-utilization \
  --time-period Start=2026-02-01,End=2026-03-01 \
  --granularity MONTHLY

# Get Reserved Instance utilization
aws ce get-reservation-utilization \
  --time-period Start=2026-02-01,End=2026-03-01 \
  --granularity MONTHLY

Read the full file on GitHub · 315 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 · 315 lines · 41 tokens per session scan A 32439efd3ece

Subscribe to this mod's changes

aws-cost-optimization is a skill published in the GitHub repository BagelHole/DevOps-Security-Agent-Skills (1,053 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 2,700 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-30.

Related

Other skills, from other repositories

implementing-aws-config-rules-for-compliance

Implementing AWS Config rules for continuous compliance monitoring of AWS resources, deploying managed and custom rules aligned to CIS and PCI DSS frameworks, configuring automatic remediation with SSM Automation, and aggregating compliance data across accounts.

adriannoes/awesome-agentic-ai · 53 tokens

implementing-aws-config-rules-for-compliance

Implementing AWS Config rules for continuous compliance monitoring of AWS resources, deploying managed and custom rules aligned to CIS and PCI DSS frameworks, configuring automatic remediation with SSM Automation, and aggregating compliance data across accounts.

xalgorix/xalgorix · 53 tokens

ec2

AWS EC2 virtual machine management — instances, security groups, key pairs, AMIs, EBS volumes, Auto Scaling Groups, Spot Instances, Session Manager, placement groups, and instance lifecycle automation. Trigger on ANY of these, even when EC2 isn't named explicitly: - Launching or provisioning: "spin up a server"…

itsmostafa/aws-agent-skills · 320 tokens

implementing-aws-security-hub-compliance

Implementing AWS Security Hub to aggregate security findings across AWS accounts, enable compliance standards like CIS AWS Foundations and PCI DSS, configure automated remediation with EventBridge and Lambda, and create custom security insights for organizational risk management.

xalgorix/xalgorix · 53 tokens

ecs

AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.

itsmostafa/aws-agent-skills · 35 tokens

cloudformation

AWS CloudFormation infrastructure as code for stack management. Use when writing templates, deploying stacks, managing drift, troubleshooting deployments, or organizing infrastructure with nested stacks.

itsmostafa/aws-agent-skills · 34 tokens