Skip to content
Back to skills

Cloud Bill Jump

ASecurity

Explain why an AWS or GCP bill went up, from the billing export (AWS CUR 2.0 in Athena, GCP billing export in BigQuery, or FOCUS), with a method that separates calendar effects, one-off charges, expired Savings Plans / Reserved Instances / CUDs, price changes and real usage growth, then finds the day and the change that caused it. Use this whenever someone says their AWS or GCP bill jumped, spiked, doubled or is "up X% month over month", asks what happened to cloud spend, has to explain a cos...

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsgobashsqlnodeexpresskubernetesawsgcpazureterraform

Works with

  • api

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add costory-io/finops-skills --skill cloud-bill-jump --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cloud Bill Jump?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cloud Bill Jump
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/costory-io-cloud-bill-jump/badge)](https://www.skillsdirectory.com/skills/costory-io-cloud-bill-jump)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cloud-bill-jump
description: Explain why an AWS or GCP bill went up, from the billing export (AWS CUR 2.0 in Athena, GCP billing export in BigQuery, or FOCUS), with a method that separates calendar effects, one-off charges, expired Savings Plans / Reserved Instances / CUDs, price changes and real usage growth, then finds the day and the change that caused it. Use this whenever someone says their AWS or GCP bill jumped, spiked, doubled or is "up X% month over month", asks what happened to cloud spend, has to explain a cost increase to finance or a CFO, gets a budget or anomaly alert, or pastes Cost Explorer, CUR or billing export numbers for two periods and asks why, even if they never say "analysis" or "root cause".
---

# Cloud bill jump

"The bill went up" is usually several things at once: a longer month, a yearly fee, a commitment that expired, a price change, and some real growth. Reading the top services in a console mixes them. This skill takes them apart in a fixed order, so each euro or dollar of the increase ends up in exactly one box with evidence next to it.

| Step | Question | AWS (Athena) | GCP (BigQuery) | FOCUS |
|------|----------|--------------|----------------|-------|
| 1 | Is it the calendar? | `sql/aws/01-period-summary.sql` | `sql/gcp/01-period-summary.sql` | `sql/focus/01-period-summary.sql` |
| 2 | One-off, periodic or commitment change? | 01 + `sql/aws/02-commitments.sql` | 01 + `sql/gcp/02-credits.sql` | 01 |
| 3 | Price, usage or mix? | `sql/aws/03-price-usage-mix.sql` | `sql/gcp/03-price-usage-mix.sql` | `sql/focus/03-price-usage-mix.sql` |
| 4 | Where exactly, and since which day? | `04-daily-step.sql`, `05-top-resources.sql` | same | adapt the AWS/GCP files |
| 5 | What changed that day? | deploy log, Terraform, CloudTrail | deploy log, Terraform, Audit Logs | |
| 6 | Will it stay? | step vs spike vs trend from the daily series | | |

Everything here is read-only: SELECT queries on the billing export, plus reading logs the user gives you. Never change resources, commitments, budgets or export settings. If a fix involves buying a commitment or deleting something, present it; the user decides and does it.

## 0. Set up

Ask for, or discover:
- **Data source**. AWS: a CUR 2.0 export from Data Exports, queried in Athena (the export can ship a Glue crawler template; the table is partitioned by `billing_period` = `YYYY-MM`). GCP: the Cloud Billing export to BigQuery, standard (`gcp_billing_export_v1_<BILLING_ACCOUNT_ID>`) or detailed (`gcp_billing_export_resource_v1_<BILLING_ACCOUNT_ID>`, adds `resource.name`, `resource.global_name`). Or a FOCUS export (AWS `FOCUS_1_2_AWS` table, or a FOCUS view on another provider). Legacy CUR (CUR 1.0, `lineItem/...` columns in CSV, `line_item_...` in Athena) works with the same logic; check column names first.
- **Periods**. A = baseline, B = the period that "went up". Half-open `[start, end)` dates in UTC, no overlap. Default: the last complete month vs the one before; for "since last week", two equal windows of 7 or 14 days. If B is the current month, end it 3 days before today (see Watch for).
- **Cost basis**, which changes the answer (details in Watch for). AWS default: amortized. GCP default: `cost` plus credits. FOCUS default: `EffectiveCost`.
- **Permissions**: Athena query access to the CUR database and its S3 bucket, plus the Athena query-results location; `bigquery.jobs.create` somewhere and read on the billing dataset.
- **Cost of the analysis**: the queries scan the whole window of the export. On BigQuery the runner caps bytes billed at 100 GB (about $0.6 at a $6.25/TiB on-demand list price, estimate); the detailed export of a large account can need more. Athena bills per data scanned too; Parquet and the `billing_period` filter keep it low.

Run a check with the bundled runner, which fills placeholders and day counts:

```bash
scripts/run_check.sh aws 01 cur_db.cur2 2026-09-01 2026-10-01 2026-10-01 2026-11-01
COST=unblended scripts/run_check.sh aws 01 cur_db.cur2 2026-09-01 2026-10-01 2026-10-01 2026-11-01
SERVICE=AmazonEC2 DETAIL='%BoxUsage%' scripts/run_check.sh aws 04 cur_db.cur2 2026-09-01 2026-10-01 2026-10-01 2026-11-01
scripts/run_check.sh gcp 03 '`proj.billing.gcp_billing_export_resource_v1_XXXX`' 2026-09-01 2026-10-01 2026-10-01 2026-11-01
DRY_RUN=1 scripts/run_check.sh focus-athena 01 focus_db.focus 2026-02-01 2026-03-01 2026-03-01 2026-04-01  # print SQL only
```

Or open the `.sql` file and replace `{{TABLE}}`, `{{A_START}}`, `{{A_END}}`, `{{B_START}}`, `{{B_END}}`, `{{A_DAYS}}`, `{{B_DAYS}}`, `{{COST}}` (and `{{SERVICE}}`, `{{DETAIL}}` for 04-05) yourself. The cost expressions are at the top of `scripts/run_check.sh`.

### No billing export yet

You can do a rough version in the consoles, with limits you must state in the answer:
- **AWS Cost Explorer**: daily granularity, metric Amortized cost, group by Service, then filter one service and group by Usage type, then by Linked account. Its Compare view (Cost Comparison) explains changes between two months, including usage and discount changes; it compares whole months, so normalize days yourself. Limits: 14 months of daily history by default (up to 38 months at monthly granularity once multi-year data is enabled), at most two group-by dimensions per API query, resource-level data only through a separate opt-in (Cost Management preferences, management account) that covers the past 14 days, refreshed at least every 24 hours, and the API costs $0.01 per paginated request. You cannot do step 3 cleanly: price vs usage per usage type needs both cost and usage quantity per type, which means one view per usage type.
- **GCP Billing Reports**: group by SKU, daily, and toggle credits on and off (verify the current option names) to see whether a credit (CUD, sustained use, promotion) disappeared. No resource level.
- Recommend enabling the export (CUR 2.0 with resource IDs; GCP detailed export) so the next jump can be explained properly. History differs: a GCP export to a multi-region dataset (EU or US) is backfilled from the start of the previous month, one to a regional dataset starts on the day it is enabled. A new AWS CUR 2.0 export starts with the current billing period; older months need a backfill request to AWS Support, whose maximum AWS does not document. Do not promise more history than that.

## 1. Normalize for the calendar

Always compare cost per day, never monthly totals. Check 01 does it.
- 31 vs 30 days is +3.3% with identical daily spend; 31 (March) vs 28 (February) is +10.7%. This alone explains many "+10%" escalations. Say so first, with the arithmetic.
- Partial current month: compare month-to-date daily average to the previous month's daily average, never MTD to a full month. Drop the last 2-3 days (data lag).
- Weekday mix matters for business-hours workloads (dev environments, batch on weekdays): a month with 23 weekdays vs 21 moves cost without any change. Check `04-daily-step.sql` for a weekly pattern before calling a small residual "growth".
- Report the calendar effect as an amount: `days_B x daily_avg_A - total_A` (measured arithmetic), and the rest as the "real" delta per day and per 30.4 days (estimate).

## 2. Separate one-off, periodic and commitment changes

Before decomposing usage, pull out what is not usage. Check 01 splits by charge type; read every row whose delta is material.

AWS (`line_item_line_item_type`):
- `Fee`, `SavingsPlanUpfrontFee`: upfront payments (All/Partial Upfront RI or Savings Plan, other upfront subscription fees). In unblended cost they land on one day; amortized cost spreads them. A jump caused only by these is a payment, not a consumption change.
- `RIFee`, `SavingsPlanRecurringFee`: monthly RI fee and hourly SP commitment. In amortized cost these rows carry only the unused part of the commitment, so a rise here means commitment waste (usage fell below commitment).
- `Credit`, `Refund`: credits that expired or ran out (promotional, Activate, migration programs) and refunds present in A but not B make the bill rise with flat usage. Both can be applied after the month closes.
- `Discount`, `BundledDiscount`: private pricing or EDP style discounts and bundled free usage. A discount that ended is a price effect.
- `Tax`: follows the taxable amount; a jump in tax alone usually means a tax registration or entity change.
- Annual Marketplace subscriptions and the Support plan also produce lumpy charges (verify how they appear in your export: product code and line type). Check 03 `b_days_active = 1` flags any usage type charged on a single day.

Commitments that expired (check `02-commitments.sql`): a Savings Plan or RI whose `b_covered_qty_per_day` falls to 0, with `end_time` or `last_day_covered` inside the window, while the same usage types continue as `Usage`. Effective cost jumps, usage is flat. This shows as a **price effect** in step 3 (amortized basis), concentrated on the usage types the commitment covered.

GCP:
- Check 01 shows gross `cost` by `cost_type` (`regular`, `tax`, `adjustment`, `rounding_error`) and every credit type as its own row. Check `02-credits.sql` lists each credit with first and last day seen.
- Credit types (`credits.type`): `COMMITTED_USAGE_DISCOUNT` (resource-based CUD), `COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE` (legacy spend-based CUD), `FEE_UTILIZATION_OFFSET` (newer spend-based CUD model), `SUSTAINED_USAGE_DISCOUNT`, `DISCOUNT` (contract threshold), `PROMOTION` (trial, milestone and other grants), `FREE_TIER`, `SUBSCRIPTION_BENEFIT`, `RESELLER_MARGIN`.
- A credit row with `last_day_seen` inside the window is the classic "nothing changed but the bill went up": a CUD term ended, a promotion was used up or expired. Commitment fees appear as their own rows: legacy resource-based fees have SKUs starting `Commitment v1:`; under the new spend-based CUD model the fee row carries a `subscription.instance_id` and a `FEE_UTILIZATION_OFFSET` credit, and what the offset does not cancel is the unused commitment.
- `adjustment` rows are billing corrections; read `adjustment_info.description` before attributing anything to usage.

FOCUS: `ChargeCategory` (`Usage`, `Purchase`, `Tax`, `Credit`, `Adjustment`) and `ChargeFrequency` (`One-Time`, `Recurring`, `Usage-Based`) carry the same split; `One-Time` rows are the one-off candidates. With `EffectiveCost`, `Purchase` rows that cover usage are 0 and the cost sits on the usage rows.

## 3. Decompose the remaining delta: price, usage, mix

Check 03 works per key: AWS (`line_item_product_code`, `line_item_usage_type`), GCP (`service.description`, `sku.id`, `usage.pricing_unit`), FOCUS (`ServiceName`, `SkuId`, `PricingUnit`). One key has one unit, so quantities compare. All values are daily averages. With c = cost, q = usage quantity, p = c / q:

```
usage effect  = (qB - qA) x pA          more or less of the same thing, at the old unit cost
price effect  = (pB - pA) x qB          same thing, different unit cost
mix effect    = cB - cA                 for keys present in only one period (new or removed SKUs / usage types)
check         : usage + price = cB - cA exactly for keys present in both periods
```

How to read it:
- **Price effect** covers more than list-price changes: an expired SP/RI/CUD or discount (on amortized or net basis), a pricing-tier crossing (S3 storage, data transfer, some API tiers), a currency move, or on-demand rates replacing spot. Flat `qty`, higher `unit_cost` = look at step 2 first.
- **Usage effect** is real consumption: more instance hours, GB stored, requests, bytes transferred. Next question is who and why (step 4).
- **Mix effect** is new or removed keys: a new instance family (`BoxUsage:m7i...` replacing `m6i`), a new region, a new service. A migration shows as a pair: one key removed, one added. Net them before reporting.
- `no_quantity` rows have cost without usage quantity in one period (fees, some subscriptions); treat them as step 2 items.
- AWS: the query excludes `SavingsPlanNegation` because its usage amount is negative and would cancel covered usage. Use the amortized basis here; on unblended, SP-covered usage shows at the on-demand rate and the saving hides in the negation rows.
- Sum the effects by service for the summary table; keep the per-key rows as evidence for the top 3-5 drivers only.

## 4. Drill down and find the first day

For each driver worth more than about 10% of the real delta:
1. `04-daily-step.sql` with `SERVICE` and `DETAIL` set to that driver: daily cost, quantity and unit cost. The step day is the first day where `crosses_midpoint` turns TRUE and stays TRUE, usually with the largest `day_over_day` jump. Quantity steps = usage; unit cost steps = price or commitment.
2. `05-top-resources.sql` for the same driver: which account or project, which resource IDs, and `first_seen` for each. A resource with `first_seen` on the step day is the prime suspect. AWS needs the export option INCLUDE_RESOURCES (`line_item_resource_id`); GCP needs the detailed export.
3. Go one level further only if it changes the action: tags or labels (`resource_tags` in CUR 2.0, `labels` in GCP) to name the team or service.

Note the hour if the export is hourly; it narrows the list of deploys a lot.

## 5. Correlate with changes and name the cause

The bill says what and when, not why. Ask the user for the change record around the step day (plus or minus 1 day, UTC): deploy log or CI history, Terraform/Pulumi plan history or git log of the infra repo, Kubernetes autoscaler or node pool events, CloudTrail (AWS) or Cloud Audit Logs (GCP) for create/modify calls on the resource IDs from step 4, feature launches, traffic events, incidents. Read what they give you; do not query their accounts yourself unless they ask and the access is read-only.

Then name the likely cause with a confidence level:
- **Confirmed**: a change on the step day touches the same resource or usage type, and the size matches.
- **Likely**: timing matches, the link is indirect (a new feature increasing traffic, a config change).
- **Unexplained**: no change found. Say so, list what you checked, and say what would settle it (for example, resource-level export, VPC Flow Logs for a transfer jump).

Common patterns: logging or debug level left on (CloudWatch Logs, Cloud Logging ingestion), NAT gateway or cross-AZ / inter-region transfer after a topology change, a backup or snapshot policy change, autoscaling minimums raised, a forgotten load test, a new managed service tier, a retry storm or crash loop (request and egress usage types), and commitments expiring.

## 6. Will the new level persist?

Classify from the daily series:
- **Step**: a new flat level from the step day on. Persists until someone changes something. Monthly impact = daily delta x 30.4 (estimate).
- **Spike**: back to baseline after a few days. Report the one-time amount (measured) and say no recurring impact is expected.
- **Trend**: the daily cost keeps rising after the step. Fit roughly (cost per day per week) and say the next month will be higher still (forecast).
- Commitment expiry is a step that lasts until a new commitment is bought. Do not buy one; say which usage it would cover and that sizing it is a separate exercise.

## Watch for

- **Cost column**. AWS: `line_item_unblended_cost` is what is invoiced, with upfront fees on the purchase day; amortized (runner preset) spreads upfront fees and puts commitment cost on covered usage; net columns (`line_item_net_unblended_cost`, `savings_plan_net_savings_plan_effective_cost`, `reservation_net_effective_cost`, ...) apply negotiated discounts but exist only when the account had a discount in the billing period. Answer "why is the invoice higher" on unblended, "what changed in consumption" on amortized or net amortized, and say which you used. The amortized formula follows the widely used community pattern (verify it matches Cost Explorer amortized cost for one month before relying on it). GCP: `cost` excludes credits; net = `cost` + `SUM(credits.amount)` (credits are negative). FOCUS: `BilledCost` is the invoice view, `EffectiveCost` the amortized one.
- **Data lag and restatement**. AWS refreshes the CUR 2.0 export at least once a day, may update the previous billing period during the first two weeks after it ends, and can add credits or refunds after the bill is finalized. GCP data is typically available within a day but can take longer; corrections arrive as new rows that negate the originals, and late usage can land on the next `invoice.month`. So a jump in the last 2-3 days may be incomplete or overstated: exclude those days, or re-run tomorrow and compare. `b_last_day_with_data` in check 01 shows where the data stops.
- **Invoice month vs usage date**. The queries use usage time in UTC. To match a GCP invoice, filter on `invoice.month` instead; AWS invoices follow `bill_billing_period_start_date`. GCP invoice months follow Pacific time (Google's own invoice queries truncate `usage_start_time` in `US/Pacific`), so daily totals near month boundaries can differ from the console.
- **Tags and labels only exist from when they apply**. AWS cost allocation tags appear in billing data only once activated (up to 24 hours to activate); a management account can request a backfill of up to 12 months. GCP labels only cover usage from the date they were applied. A "new team cost" that starts on a tag activation date is a reporting change, not a cost change.
- **Currency**. AWS `line_item_currency_code`, GCP `currency` and `currency_conversion_rate` (divide `cost` by it for USD). Check 01 counts currencies; if more than one, convert before comparing, and treat an FX move as a price effect, not usage.
- **AWS Organizations membership**. An account that joined the organization shows up in the management account's CUR from the join date only: that is mix effect from the payer's point of view, not new spend.
- **Rounding**. Many small rows; compare at 2 decimals and do not report deltas under 1% of the total as findings.

## Report

Lead with the answer. Keep caveats next to the number they qualify.

```
# Why the <AWS|GCP> bill went up: <period A> vs <period B>

<One paragraph: what changed, by how much per day and per month (label each number), the cause with
confidence, and whether it persists (step / spike / trend). Mention the calendar effect if it is material.>

## Decomposition (cost basis: <amortized | unblended | net>, per day, A -> B)
| Component | Per day | Per month equiv. (est.) | Share of the jump |
| Calendar (days in period) | | | |
| One-off / periodic charges | | | |
| Commitments and credits (expired, used up) | | | |
| Price effect (other) | | | |
| Usage effect | | | |
| Mix (new / removed SKUs) | | | |
| Total | | | |

## Evidence
<Top 3-5 drivers: service > usage type / SKU > account / project > resource, step day, the matching
change from the deploy or audit log, and the query output rows that show it.>

## Next actions
<Owner-level actions, ranked by monthly impact. Purchases and deletions are proposals for the user.
What this analysis could not see (no resource IDs, last days incomplete, no change log provided).>
```

Rules for the numbers:
- Label every figure: **measured** (read from the export), **estimate** (derived, for example x 30.4 for a month) or **forecast** (projected forward).
- Per-day first, per-month as an estimate, never annualized unless asked.
- If a step could not run (no resource IDs, no change log), say which and what it would take.

## When you cannot run it yourself

If you have no access to the user's environment, paste the complete, filled-in SQL or command in your answer so the user can run it as is, with their project, period and table names already substituted where known. Do not point the user to this skill's file paths (`sql/...`, `scripts/...`): they usually cannot see them. Then interpret the output they paste back with the rules above.

## Going further

A bill jump found a month later has already cost a month. Catching it on the step day means putting deploy events and usage metrics on the same timeline as daily cost, with alerts that check it every day, across AWS, GCP, Azure, data platforms (Snowflake, Databricks, BigQuery) and AI APIs. You can build that on the billing exports plus your change logs; tools such as Costory (costory.io), whose team wrote this skill, do it as a product.

Files in this skill

  • SKILL.md19.9 KB
  • references/sources.md8.9 KB
  • scripts/run_check.sh6.4 KB
  • sql/aws/01-period-summary.sql3 KB
  • sql/aws/02-commitments.sql2.9 KB
  • sql/aws/03-price-usage-mix.sql3 KB
  • sql/aws/04-daily-step.sql1.7 KB
  • sql/aws/05-top-resources.sql2 KB
  • sql/focus/01-period-summary.sql2.3 KB
  • sql/focus/03-price-usage-mix.sql2.4 KB
  • sql/gcp/01-period-summary.sql2.4 KB
  • sql/gcp/02-credits.sql1.6 KB
  • sql/gcp/03-price-usage-mix.sql2.6 KB
  • sql/gcp/04-daily-step.sql1.3 KB
  • sql/gcp/05-top-resources.sql1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.