Skip to content

Guide · Agent skill

How to use the AWS Cost Optimizer agent skill (aws-cost-optimize)

Updated · written with AI from the project's own documentation and checked against our catalogue data

The aws-cost-optimize skill is a set of written instructions that an AI agent (such as Claude) follows to review your Amazon Web Services bill and suggest cuts. It reads your infrastructure-as-code files, queries your AWS account through the AWS CLI, and then creates tracked GitHub issues for each saving it finds. This guide explains what the skill does, how to install it, how to ask for it, and what to check before you give it access to your account.

AWS Cost Optimizergithub/awesome-copilot · MIT

Quick start

  1. 1Check prerequisites. Confirm the AWS CLI is configured by running aws sts get-caller-identity, and confirm the GitHub MCP server is authenticated.
  2. 2Download the skill. Download the ZIP of SKILL.md from this page from the aws-cost-optimize skill folder.
  3. 3Install the skill. Unzip it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder, or upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
  4. 4Make a natural request. Ask the agent to review your AWS costs for a repository and create GitHub issues for any savings.
  5. 5Review the summary. Read the current monthly cost, potential savings and priority list the agent shows before it creates anything.
  6. 6Approve or stop. Answer y to create one issue per optimization plus an EPIC issue, or n to stop without creating anything.
  7. 7Validate changes. Test each recommended change in a non-production environment and confirm savings in AWS Cost Explorer before applying it.

What is an agent skill and what does this one do?

An agent skill is a folder containing a SKILL.md file. The file tells an AI agent how to carry out a task, step by step. This skill's SKILL.md describes a seven-step cost review of your AWS workloads.

When it runs, the agent first fetches AWS cost optimization best practices from AWS documentation. It then discovers your resources with AWS CLI commands (EC2, RDS, Lambda, ECS, S3, ElastiCache, NAT Gateways and load balancers), pulls CloudWatch usage metrics and Cost Explorer data for the last 7 and 30 days, and checks the results against cost-saving patterns such as right-sizing, Graviton/ARM, Savings Plans, S3 lifecycle rules and gp2-to-gp3 EBS conversion.

Before creating anything on GitHub, it shows you a summary of the findings and waits for your yes or no. After approval it creates one issue per optimization, labelled cost-optimization and aws, plus one EPIC issue that links them into a checklist.

Install the skill: download, unzip, place

Download the ZIP of the skill from this page. The skill is a single file, SKILL.md, in the skills/aws-cost-optimize folder of the github/awesome-copilot repository. Unzip it so that the aws-cost-optimize folder with SKILL.md inside sits in one of these locations:

  • Personal skills for all projects: ~/.claude/skills/
  • Project-only skills: the .claude/skills/ folder inside your project
  • Claude apps: upload the ZIP under Settings → Capabilities → Skills

Set up the prerequisites

The skill depends on three things outside the skill itself. Check each one before you start, because the agent will stop if they are missing.

The AWS CLI must be installed and configured with valid credentials. Run aws sts get-caller-identity in your terminal; if it succeeds, the agent can use the same identity. The GitHub MCP server must be configured and authenticated, and you need a target GitHub repository for the issues. Cost Explorer must also be enabled in the AWS Console, because the skill's error handling asks you to do this if it is not.

  • AWS CLI installed and configured (aws sts get-caller-identity succeeds)
  • GitHub MCP server configured and authenticated
  • A target GitHub repository
  • Network access to AWS documentation URLs
  • Deployed AWS resources (IaC files are optional but helpful)
aws sts get-caller-identity

How do you trigger the skill with a natural request?

You do not need a special command. Describe what you want in plain language and mention AWS costs and the repository. The agent should match your request to the skill's description, which covers analysing IaC files and AWS resources and creating GitHub issues for optimizations.

If the agent does not pick up the skill on its own, name it directly in your request, for example by saying to use the aws-cost-optimize skill.

  • Review our AWS bill for this repo and open GitHub issues for any savings you find.
  • Analyse the Terraform in this project and the resources in us-east-1, then propose cost cuts.
  • Run a monthly AWS cost review and create tracked issues in our GitHub repo.

What happens during a run, and what you approve

The run has a defined order. The agent collects data, applies the optimization patterns, and calculates a priority score for each item: High above 20, Medium from 5 to 20, Low below 5. It then shows a summary with the current monthly cost, potential monthly savings and the number of high-priority items, and asks whether to proceed (y/n).

Nothing is created on GitHub until you answer yes. Each issue includes a description, implementation notes, CloudWatch evidence, validation steps to test in a non-production environment, and a risk section. The EPIC issue holds the prioritised checklist (High, then Medium, then Low) and success criteria.

Safety: permissions, scripts and network

The skill runs read commands against your live AWS account, such as describe, list, get-metric-statistics and ce get-cost-and-usage. The source does not list IAM policies, so grant read-only permissions and avoid credentials with broad write or billing rights. The skill's error handling says to list the read-only IAM permissions required if access is insufficient.

The skill runs scripts and uses the network. It fetches AWS documentation pages and calls the AWS CLI and the GitHub MCP server. Run it first on a test account or a repository you control, and check the issues it creates before anyone acts on them. The skill recommends changes only; the validation steps still need a person to test them.

  • Use read-only AWS credentials where possible
  • Review the summary before answering y
  • Treat every recommendation as untested until validated in a non-production environment

Tips for getting useful results

Keep your IaC files in the repository. The agent uses them as the source of truth and ignores application code, so Terraform, CloudFormation, SAM or CDK files give it the most to work with. If it finds no IaC files, it stops and reports this to you.

Run the review on a regular schedule, such as monthly, so the 7-day metrics and 30-day cost data reflect current usage. Compare the EPIC issue's savings target with your actual Cost Explorer results afterwards.

  • Point the agent at a specific region if you do not want it to use the default from aws configure get region
  • Ask for only the High-priority items if the summary is long
  • Close or update issues as you apply each change so the EPIC checklist stays accurate

What people use it for

  • Monthly review of EC2, RDS and Lambda spend for an engineering team, with each saving tracked as its own GitHub issue
  • Finding S3 buckets that would benefit from lifecycle rules from Standard to Standard-IA after 30 days and Glacier after 90 days
  • Spotting unattached EBS volumes and gp2 volumes that could move to gp3
  • Checking Lambda functions that could switch to arm64 or use less memory
  • Reviewing non-production NAT Gateways and VPC endpoints for S3 and DynamoDB

Frequently asked questions

How do I install the aws-cost-optimize skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

What do I need before the skill will work?

You need the AWS CLI installed and configured so that aws sts get-caller-identity succeeds, a GitHub MCP server that is configured and authenticated, and a target GitHub repository. Deployed AWS resources are needed too, while IaC files are optional but helpful.

Is the aws-cost-optimize skill free and what is its licence?

The skill is published in the github/awesome-copilot repository under the MIT licence. The source does not mention any price for the skill itself, but using it requires an AWS account and access to the AWS CLI and GitHub.

Will the skill change my AWS resources automatically?

No. The skill recommends changes and creates GitHub issues, and it waits for your approval before creating them. The source says the validation steps still need a person to test changes before they are made in production.

Does it work with non-AWS clouds or serverless setups with no IaC files?

No. It is built for AWS. If no IaC files such as Terraform, CloudFormation or CDK files are found, the workflow stops and reports this to you.

Why does the skill say my AWS CLI command fails or Cost Explorer returns nothing?

The skill's error handling covers authentication failure (guide through aws configure), insufficient permissions (list the required read-only IAM permissions), and Cost Explorer not being enabled (enable it in the AWS Console). Check these in that order.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if your team runs on AWS, keeps infrastructure as code in GitHub, and wants a structured monthly cost review with tracked follow-up tasks. Pick something else if your AWS credentials have broad write or billing access, if you are not on AWS, or if you need changes applied automatically without human review.

Download the skill