/aws-billing-and-cost-management
Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage.
$ npx -y skills add aws/agent-toolkit-for-aws --skill aws-billing-and-cost-management --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/aws-billing-and-cost-management
Context preview
The summary Claude sees to decide when to auto-load this skill.
Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage.
SKILL.md
aws-billing-and-cost-management.SKILL.mdname: aws-billing-and-cost-management
description: |
Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and
Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer,
look up service pricing, query CUR with Athena, detect cost anomalies,
scope costs to billing views, and monitor Free Tier usage. Triggers on:
AWS bill, cost analysis, reduce spend, savings plan, reserved instance,
right-size, budget alert, cost optimization, pricing, free tier, cost
anomaly, CUR, cost audit, billing view, billing view ARN.
metadata:
version: "1"
Billing and Cost Management
Overview
Analyze, optimize, and manage AWS costs. This skill encodes domain expertise from AWS's cost management products — gotchas, correct API usage patterns, and optimization workflows that models frequently get wrong.
Usage
Use this skill when:
- Analyzing AWS spending, cost trends, or cost breakdowns
- Setting up or managing budget alerts
- Evaluating Savings Plans or Reserved Instance purchases
- Right-sizing EC2, Lambda, RDS, or EBS resources
- Looking up AWS service pricing
- Running cost audits or investigating cost spikes
- Querying CUR data with Athena
- Scoping cost analysis to a specific billing view
- Checking Free Tier usage
Core Concepts
- **Cost Explorer** — query cost/usage data by service, account, tag, or time range
- **Budgets** — set spending thresholds with alerts; supports billing view scoping
- **Billing Views** — scope cost data to a subset of billing (custom view, billing group, or primary)
- **Compute Optimizer** — right-sizing recommendations for EC2, Lambda, EBS, RDS
- **Cost Optimization Hub** — aggregated savings recommendations across services
- **Savings Plans / Reserved Instances** — commitment-based discounts
- **CUR 2.0** — detailed line-item billing data queryable via Athena
**Recommended setup:** Use the AWS MCP server for sandboxed execution, audit logging, and enterprise controls. See: https://docs.aws.amazon.com/aws-mcp/
**Without AWS MCP:** All commands use standard AWS CLI syntax and work with any agent that has CLI access.
Critical Rule: Always Check the Current Date
**Before making ANY Cost Explorer, Budgets, or Savings Plans API call, you MUST determine the current date.** Use a tool to get the current date and time — do NOT assume or guess the year. LLMs frequently default to dates from their training data instead of the actual current date, producing analyses of stale data that appear correct but are completely wrong.
Critical Rule: Deterministic Calculations
**You MUST NEVER perform numerical calculations (sums, averages, percentages, comparisons, counts, min/max) by reasoning in your response.** LLM arithmetic is unreliable and produces wrong answers on cost data.
**You MUST ALWAYS use a script or calculator tool** for any math on data returned from API calls. Write a Python script that performs the calculation and prints the result. If the AWS MCP server's `run_script` tool is available, use it. Otherwise, run the script locally.
Read `references/deterministic-calculations.md` for patterns and examples.
Decision Guide
| Question | Tool | Reference | |----------|------|-----------| | What am I spending? Where are costs going up? | Cost Explorer | `references/cost-explorer.md` | | How much does a service cost? | Price List API | `references/pricing-lookup.md` | | Where can I save money? (start here) | Cost Optimization Hub | `references/cost-optimization-hub.md` | | Should I buy Savings Plans? | CE SP Recommendations | `references/savings-plans.md` | | Should I buy Reserved Instances? | CE RI Recommendations | `references/reserved-instances.md` | | Deep-dive on a specific EC2/Lambda/EBS/RDS rec? | Compute Optimizer | `references/ec2-rightsizing.md`, `references/lambda-optimization.md`, `references/rds-optimization.md`, `references/ebs-optimization.md` | | How do I set up budget alerts? | Budgets | `references/budgets.md` | | What's causing a cost spike? | Cost Anomaly Detection | `references/cost-explorer.md` | | Am I within Free Tier? | Free Tier API | `references/free-tier.md` | | How do I reduce my bill? | Cost Audit workflow | `references/cost-audit.md` | | How do I query detailed billing data? | CUR 2.0 + Athena | `references/cur-athena.md` | | How do I optimize specific services? | Per-service patterns | `references/service-optimization.md` | | How do I scope costs to a billing view? | Billing Views | See [Billing Views](#billing-views) below |
Common Tasks
Analyze costs by service
aws ce get-cost-and-usage \
--time-period Start=2026-03-01,End=2026-04-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICE
Default to `UnblendedCost`. Exclude Credits/Refunds with `--filter '{"Not":{"Dimensions":{"Key":"RECORD_TYPE","Values":["Credit","Refund"]}}}'`. End date is exclusive.
Run a cost audit
Read `references/cost-audit.md` for the full 7-step workflow: top cost drivers → month-over-month comparison → optimization recommendations → idle resources → commitment coverage → per-service quick wins → report.
Get right-sizing recommendations
Compute Optimizer requires opt-in first: `aws compute-optimizer update-enrollment-status --status Active`. Then read `references/ec2-rightsizing.md` for EC2 or the relevant resource-specific reference.
Look up service pricing
Read `references/pricing-lookup.md` for service codes and attribute filters. Common trap: Price List API service codes differ from Cost Explorer service names.
Billing Views
A billing view scopes cost and usage data to a specific slice of an account's billing (e.g., a billing group, custom view, or the default primary view). When the user wants to analyze costs through a particular billing view, add `--billing-view-arn` to supported API calls.
Discover available billing views
aws billing list-billing-views \
--billing-view-types PRIMARY
Read more
name: aws-billing-and-cost-management description: | Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN. metadata: version: "1"
Billing and Cost Management
Overview
Analyze, optimize, and manage AWS costs. This skill encodes domain expertise from AWS's cost management products — gotchas, correct API usage patterns, and optimization workflows that models frequently get wrong.
Usage
Use this skill when:
- Analyzing AWS spending, cost trends, or cost breakdowns
- Setting up or managing budget alerts
- Evaluating Savings Plans or Reserved Instance purchases
- Right-sizing EC2, Lambda, RDS, or EBS resources
- Looking up AWS service pricing
- Running cost audits or investigating cost spikes
- Querying CUR data with Athena
- Scoping cost analysis to a specific billing view
- Checking Free Tier usage
Core Concepts
- **Cost Explorer** — query cost/usage data by service, account, tag, or time range
- **Budgets** — set spending thresholds with alerts; supports billing view scoping
- **Billing Views** — scope cost data to a subset of billing (custom view, billing group, or primary)
- **Compute Optimizer** — right-sizing recommendations for EC2, Lambda, EBS, RDS
- **Cost Optimization Hub** — aggregated savings recommendations across services
- **Savings Plans / Reserved Instances** — commitment-based discounts
- **CUR 2.0** — detailed line-item billing data queryable via Athena
**Recommended setup:** Use the AWS MCP server for sandboxed execution, audit logging, and enterprise controls. See: https://docs.aws.amazon.com/aws-mcp/
**Without AWS MCP:** All commands use standard AWS CLI syntax and work with any agent that has CLI access.
Critical Rule: Always Check the Current Date
**Before making ANY Cost Explorer, Budgets, or Savings Plans API call, you MUST determine the current date.** Use a tool to get the current date and time — do NOT assume or guess the year. LLMs frequently default to dates from their training data instead of the actual current date, producing analyses of stale data that appear correct but are completely wrong.
Critical Rule: Deterministic Calculations
**You MUST NEVER perform numerical calculations (sums, averages, percentages, comparisons, counts, min/max) by reasoning in your response.** LLM arithmetic is unreliable and produces wrong answers on cost data.
**You MUST ALWAYS use a script or calculator tool** for any math on data returned from API calls. Write a Python script that performs the calculation and prints the result. If the AWS MCP server's `run_script` tool is available, use it. Otherwise, run the script locally.
Read `references/deterministic-calculations.md` for patterns and examples.
Decision Guide
| Question | Tool | Reference | |----------|------|-----------| | What am I spending? Where are costs going up? | Cost Explorer | `references/cost-explorer.md` | | How much does a service cost? | Price List API | `references/pricing-lookup.md` | | Where can I save money? (start here) | Cost Optimization Hub | `references/cost-optimization-hub.md` | | Should I buy Savings Plans? | CE SP Recommendations | `references/savings-plans.md` | | Should I buy Reserved Instances? | CE RI Recommendations | `references/reserved-instances.md` | | Deep-dive on a specific EC2/Lambda/EBS/RDS rec? | Compute Optimizer | `references/ec2-rightsizing.md`, `references/lambda-optimization.md`, `references/rds-optimization.md`, `references/ebs-optimization.md` | | How do I set up budget alerts? | Budgets | `references/budgets.md` | | What's causing a cost spike? | Cost Anomaly Detection | `references/cost-explorer.md` | | Am I within Free Tier? | Free Tier API | `references/free-tier.md` | | How do I reduce my bill? | Cost Audit workflow | `references/cost-audit.md` | | How do I query detailed billing data? | CUR 2.0 + Athena | `references/cur-athena.md` | | How do I optimize specific services? | Per-service patterns | `references/service-optimization.md` | | How do I scope costs to a billing view? | Billing Views | See [Billing Views](#billing-views) below |
Common Tasks
Analyze costs by service
aws ce get-cost-and-usage \ --time-period Start=2026-03-01,End=2026-04-01 \ --granularity MONTHLY \ --metrics UnblendedCost \ --group-by Type=DIMENSION,Key=SERVICE
Default to `UnblendedCost`. Exclude Credits/Refunds with `--filter '{"Not":{"Dimensions":{"Key":"RECORD_TYPE","Values":["Credit","Refund"]}}}'`. End date is exclusive.
Run a cost audit
Read `references/cost-audit.md` for the full 7-step workflow: top cost drivers → month-over-month comparison → optimization recommendations → idle resources → commitment coverage → per-service quick wins → report.
Get right-sizing recommendations
Compute Optimizer requires opt-in first: `aws compute-optimizer update-enrollment-status --status Active`. Then read `references/ec2-rightsizing.md` for EC2 or the relevant resource-specific reference.
Look up service pricing
Read `references/pricing-lookup.md` for service codes and attribute filters. Common trap: Price List API service codes differ from Cost Explorer service names.
Billing Views
A billing view scopes cost and usage data to a specific slice of an account's billing (e.g., a billing group, custom view, or the default primary view). When the user wants to analyze costs through a particular billing view, add `--billing-view-arn` to supported API calls.
Discover available billing views
aws billing list-billing-views \ --billing-view-types PRIMARY
Help AI coding agents build, deploy, and manage applications on AWS. The Agent Toolkit for AWS gives AI coding agents the tools, knowledge, and guardrails they need to work with AWS services.
Repo: aws/agent-toolkit-for-aws
Other skills on agent-toolkit-for-aws.
- /analyzing-release-readiness
Trigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code changes for risk, correctness, and potential rollback issues before merging. Trigger words include release readiness, analyze PR, analyze MR, review
Open skill - /chatting-with-aws-devops-agent
Have a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 5-30 second answer rather than a
Open skill - /coordinating-multi-space-devops-agent
Coordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space (prod vs staging vs knowledge), query several spaces in parallel and synthesize, or compare findings across accounts. Use whenever the user has more than
Open skill - /diff-scanning-with-aws-security-agent
Run a fast AWS Security Agent diff scan on only the changed code since a git ref. Use when the user asks to scan changes, run a diff scan, check what changed for security issues, scan before committing, scan before PR, or any pre-commit/pre-push security check.
Open skill - /investigating-incidents-with-aws-devops-agent
Run a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or unexplained behavior — keywords like "5xx", "503", "OOM", "latency spike", "deployment failure", "rollback", "sev1", "investigate", "root cause", "debug",
Open skill - /pentesting-with-aws-security-agent
Run an AWS Security Agent penetration test against a live web application — registers and verifies the target domain, exercises the supplied endpoints with the managed Security Agent service, and returns verified runtime findings. Use when the user asks to pentest, run a
Open skill

