/aws-cost-audit:aws-cost-auditfrom aws-cost-audit
Use when a user wants to audit, understand, reduce, or optimize their AWS bill or cloud costs, finding idle, unused, or orphaned resources, rightsizing over-provisioned compute, checking Savings Plans / Reserved Instance coverage, NAT gateway and data-transfer costs, S3 storage and lifecycle, CloudWatch log retention, untagged or unexplained spend, per-resource cost attribution ("what is this costing me and why"), or building a savings plan or cost dashboard. Triggers include "AWS bill too high", "cut/lower AWS costs", "FinOps", "Cost Explorer", "where is my money going", "unused AWS resources", and "cloud cost audit".
Ships in aws-cost-audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Audit a live AWS account the way a careful FinOps engineer would: attribute every dollar, find waste, and produce an evidence-backed savings plan with confidence levels and reversible, gated actions, for anyone's account, with zero hardcoded prices and zero secrets.
Core principle: every number is verified against a primary source before it is stated, and nothing destructive runs unless it is proven-unused, reversible, tested, and certain. A claim you did not verify is not a finding, it is a guess, and guesses do not ship.
This skill targets Claude Code (it shells out to the AWS CLI). Work read-only by default; treat any change as gated (see below).
These five laws exist because, without them, agents reliably fail in specific ways (see
references/why-these-laws.md for the recorded baseline). Violating the letter of a law violates
its spirit, so do not look for loopholes.
No unverified price. Ever. Never state a unit price, a monthly cost, or a "$X saved" figure
from memory. Every dollar figure must come from BOTH (a) the live unit price for the user's
exact Region (AWS Price List Query API, recorded with scripts/verify-price.sh --record) and
(b) the user's actual usage (Cost Explorer / CUR). Always show: unit price → math → source.
When no single unit price applies (a tiered price, a Savings Plan, a resource deleted outright),
the figure comes from a Cost Explorer read instead, recorded as such. Never hardcode a
price in this skill, a script, or a report. Prices change and are Region-specific; memorized
prices are how two runs produce two different wrong numbers.
Attribute every dollar, or say "unknown." For each resource state cost · plain-language purpose · owning app/repo · creator (CloudTrail) · created-when · last-used (CloudWatch / access logs / last-invocation). If any cannot be determined, write "unknown, could not verify". Never invent an owner, a date, or a last-used.
Nothing destructive unless proven-unused + reversible + tested + 100% sure. Otherwise it is a
recommendation, not an action. See the decision flow below and references/safety-and-gating.md.
No single probe becomes a fleet-wide fact. Fan out checks across resources/Regions. A separate skeptic pass must re-derive every load-bearing claim (headline savings, each "safe-to-delete" verdict) from the primary source, not from another agent's summary.
Every finding carries its evidence. Output contract per item: current $/mo → after $/mo → $ saved → confidence (High/Med/Low) + evidence + reversibility. Split the total into "save now
safely" (High-confidence, reversible, tested) vs "max theoretical save". See
references/output-and-reporting.md.
Run the steps in order. Heavy detail lives in references/; load a reference only when you reach
its step (token-efficient progressive disclosure).
scripts/doctor.sh from this skill's directory before any audit call. It
names a missing AWS CLI, missing credentials, missing jq, an unset region or an unwritable
output directory, and changes nothing. Fix every [FAIL] line with the user first. Add
--check-cost-explorer only if the user agrees: that probe is one billed request.aws sts get-caller-identity), then pull Cost Explorer:
total + by-service + by-Region + by-usage-type + daily + 90-day trend + forecast. State today's
spend, reconciled to the dollar. Save raw JSON.aws ec2 describe-regions and sweep each service.
Work the hunt list in references/hunt-list.md (the high-ROI checks, each with a verified
detection command). Run the managed detectors first (Cost Optimization Hub, Compute
Optimizer, Trusted Advisor); they pre-compute most findings and net out existing commitments.scripts/verify-price.sh --service-code CODE --region-code REGION --filter FIELD=VALUE --record, and put the record it
prints in the finding's price_lookups array. It refuses unless exactly one price matches. When
no single unit price applies, add a cost-explorer record instead: the aws ce command you read,
the reason, and the UTC time. findings-validate.sh rejects a dollar figure with neither. Then a
separate check re-derives every figure (Law 1 + Law 4); verify-price.sh --recheck findings.json
re-runs the Price List records. See references/pricing-verification.md.--apply: show the user the proof of non-use and the script's dry-run output, then
ask them to type yes in the chat. Pass --apply --yes only after that yes. Your shell has no
TTY, so the script refuses --apply without --yes, and that refusal is correct; never add
--yes to get past it without the user's yes. Never pass --no-snapshot.findings.json, then run scripts/findings-summary.sh on it.
Its output opens the report as it is: the verdict, then the three things to do first, then the
counts. The detail comes after. Then a plain-language report (references/output-and-reporting.md), an optional generated
HTML dashboard (references/dashboard.md + assets/dashboard-template.html), a health/monitoring
view, and budget + anomaly-detection guardrails. Finish with a completeness pass: "what Region
/ service / cost driver did we NOT inspect?"; it must come back empty.The only non-obvious call in this skill. When in doubt, recommend.
digraph gate {
rankdir=TB; node [shape=box];
q1 [shape=diamond, label="Proven UNUSED by live evidence\n(multiple signals, 30–90d)?"];
q2 [shape=diamond, label="Reversible?\n(snapshot/backup/versioning/detach-first)"];
q3 [shape=diamond, label="Tested in dry-run AND\n100% sure of blast radius?"];
rec [label="RECOMMEND only\n(put on report w/ confidence, do NOT run)"];
run [label="May run after the user's typed yes\nvia executor → verifier → rollback"];
q1 -> rec [label="no / unsure"];
q1 -> q2 [label="yes"];
q2 -> rec [label="no"];
q2 -> q3 [label="yes"];
q3 -> rec [label="no"];
q3 -> run [label="yes"];
}
Irreversible actions (release EIP, delete snapshot/AMI, terminate, Savings Plan/RI purchase) are never auto-run; they are always recommendations requiring explicit human sign-off.
Full hunt list with verified commands, reversibility, and price source: references/hunt-list.md.
| Check | Detect (read-only) | Reversibility |
|---|---|---|
| Unassociated Elastic IPs | aws ec2 describe-addresses (no AssociationId) | Destructive (lose the IP) |
| Unattached EBS volumes | aws ec2 describe-volumes --filters Name=status,Values=available | Snapshot first |
| gp2 → gp3 | describe-volumes --filters Name=volume-type,Values=gp2 | Low risk, reversible |
| Old snapshots / AMIs | describe-snapshots --owner-ids self; describe-images --owners self | Destructive |
| NAT data-processing | describe-nat-gateways + CloudWatch bytes; CE by usage-type | Routing change |
| Idle ALB/NLB, empty TGs | elbv2 describe-load-balancers + describe-target-health | Destructive |
| Rightsizing | compute-optimizer get-*-recommendations | Restart window |
| Savings Plans / RI gaps | ce get-savings-plans-coverage / -utilization | Commitment, irreversible |
| S3 lifecycle / MPU | s3api get-bucket-lifecycle-configuration, list-multipart-uploads | Expiry is destructive |
| CloudWatch retention | aws logs describe-log-groups (absent retentionInDays = never) | Set is reversible |
| Cross-Region ghosts | loop the above over describe-regions | Per-resource |
| Guardrails missing | ce get-anomaly-monitors, budgets describe-budgets | No risk |
This shows the full method on a single finding. Apply the same shape to every item.
# 1. DETECT (read-only)
aws ec2 describe-volumes --region "$REGION" \
--filters Name=status,Values=available \
--query 'Volumes[].{id:VolumeId,gb:Size,type:VolumeType,created:CreateTime,az:AvailabilityZone}'
# 2. ATTRIBUTE (never guess; "unknown" is a valid answer)
aws ec2 describe-volumes --volume-ids "$VOL" --query 'Volumes[0].Tags' # owner/app? else unknown
aws cloudtrail lookup-events --lookup-attributes \
AttributeKey=ResourceName,AttributeValue="$VOL" \
--query 'Events[?contains(EventName,`CreateVolume`)].[Username,EventTime]' # creator/when, or "unknown, predates trail"
aws cloudwatch get-metric-statistics --namespace AWS/EBS --metric-name VolumeReadOps \
--dimensions Name=VolumeId,Value="$VOL" --start-time "$START" --end-time "$NOW" \
--period 86400 --statistics Sum --region "$REGION" # last-used signal
# 3. VERIFY PRICE LIVE (never from memory): gp3 storage $/GB-month for THIS region
scripts/verify-price.sh --service-code AmazonEC2 --region-code "$REGION" \
--filter productFamily=Storage --filter volumeApiName=gp3 --record
# prints one price_lookups record: service code, region, filters, SKU, unit, USD per unit, fetch time.
# savings $/mo = (live $/GB-mo) × (provisioned GB). Show the math; the record is the source.
Finding (the shape every item takes):
available (detached). Tags: none → owner unknown.CreateVolume by unknown, predates CloudTrail window;
created <date>; VolumeReadOps = 0 for 90 days → strong unused signal.(live gp3 $/GB-mo from Price List API) × 100 → $0.| Rationalization | Reality |
|---|---|
| "I know AWS prices, gp3 is ~$0.08/GB." | Prices are Region-specific and change. Memorized → wrong. Query the live Price List API for their Region. |
| "Just give them the number for the slide." | A wrong number on a slide is worse than 'pending live verification'. Verify, then state, with the math. |
| "It looks idle/unattached, I'll just delete it." | "Looks" is not "proven." Prove unused via multiple signals over 30–90d, snapshot, dry-run, sign-off. |
| "One service was at 4% CPU, so the fleet is over-provisioned." | One sample is not the fleet. Use Compute Optimizer + p99/max per resource. |
| "I'll estimate the owner from the name." | Estimating attribution is guessing. Write "unknown, could not verify." |
| "RDS backup is free, deleting saves nothing, skip it." | Maybe. Confirm against CUR/Cost Explorer whether it is actually billed before claiming $0 or savings. |
| "Container Insights / logs are cheap." | They are a top-5 line item in many accounts. Check Cost Explorer by usage-type. |
| "It's reversible, so I can run it now." | Reversible is necessary, not sufficient. Also needs proven-unused + tested + 100% sure + (for irreversible) sign-off. |
delete/terminate/release/rm you are about to run without a snapshot/rollback and sign-off.references/hunt-list.md: every high-ROI check: verified detection command, why it saves, reversibility, where to verify the price.references/pricing-verification.md: how to get a live, Region-correct price and reconcile it with actual usage; the skeptic re-derivation routine.references/safety-and-gating.md: the executor → verifier → rollback pattern; reversibility techniques; what may never auto-run.references/output-and-reporting.md: the per-item output contract, the report structure, "save now" vs "max theoretical".references/dashboard.md: how to generate the optional HTML dashboard from verified data (template in assets/).references/why-these-laws.md: the recorded baseline failures the Iron Laws fix (the TDD evidence).scripts/: generic, parameterized, dry-run-by-default helpers (no hardcoded account/ARN/price).
doctor.sh is the preflight; findings-validate.sh checks findings.json; findings-summary.sh
prints the verdict and the three actions that open the report.assets/dashboard-template.html (opens in a new tab)references/dashboard.md (opens in a new tab)references/hunt-list.md (opens in a new tab)references/output-and-reporting.md (opens in a new tab)references/pricing-verification.md (opens in a new tab)references/safety-and-gating.md (opens in a new tab)references/why-these-laws.md (opens in a new tab)scripts/00-baseline.sh (opens in a new tab)scripts/README.md (opens in a new tab)scripts/_lib.sh (opens in a new tab)scripts/delete-unattached-ebs.sh (opens in a new tab)scripts/doctor.sh (opens in a new tab)scripts/find-idle.sh (opens in a new tab)scripts/findings-summary.sh (opens in a new tab)scripts/findings-validate.sh (opens in a new tab)scripts/gp2-to-gp3.sh (opens in a new tab)scripts/inventory-regions.sh (opens in a new tab)scripts/set-log-retention.sh (opens in a new tab)scripts/verify-price.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (aboudjem/aws-cost-audit-skill) — no native marketplace selected
npx claudepluginhub p/aboudjem-aws-cost-audit