---
name: aws-daily-cost-report
description: "Every morning: what AWS cost yesterday, against the 7-day average, with the top services, the one that moved and month-to-date spend. Use when the user asks for this, or when it runs on a schedule."
---

# AWS daily cost report

Every morning: what AWS cost yesterday, against the 7-day average, with the top services, the one that moved and month-to-date spend.

Cost Explorer can answer "what did we spend yesterday", but it takes a few clicks, a date picker and a group-by every time, and the default view is the month. So most teams look at AWS cost once, when the invoice arrives.

The agent makes one Cost Explorer call each morning for the last 30 days by service, and turns it into one number for yesterday, the average it should be compared with, and the service that moved. It leaves out credits and refunds so a promotional credit does not hide a real increase.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- AWS credentials for the management (payer) account, or a member account, allowed `ce:GetCostAndUsage` and, for the projection, `ce:GetCostForecast`.
- Or the AWS Billing and Cost Management MCP server (`awslabs.billing-cost-management-mcp-server`), which wraps the same Cost Explorer calls.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Pull 30 days by service** (AWS): `aws ce get-cost-and-usage --time-period Start=<30 days ago>,End=<today> --granularity DAILY --metrics UnblendedCost --group-by Type=DIMENSION,Key=SERVICE`. `End` is exclusive, so this ends with yesterday. Each request costs $0.01.
2. **Leave out credits, refunds and tax**: Add `--filter '{"Not":{"Dimensions":{"Key":"RECORD_TYPE","Values":["Credit","Refund","Tax"]}}}'` so the daily line shows usage, not the timing of a credit.
3. **Compare yesterday**: Sum yesterday across services and compare with the average of the 7 days before it and with the same weekday last week. Rank services by cost and by change; a service up 30% and $25 or more is worth naming.
4. **Add the month** (AWS): Sum month to date from the same data, and if you want the projection, one `aws ce get-cost-forecast --time-period Start=<today>,End=<first of next month> --metric UNBLENDED_COST --granularity MONTHLY` call for the rest of the month.
5. **Report**: Yesterday's total, the change against the 7-day average, the top five services with their change, month to date, and the forecast if requested.

## Route B: the browser

### What you need

- Signed in to the AWS console with an IAM user or role that has Cost Explorer access (`ce:GetCostAndUsage` through the `AWSBillingReadOnlyAccess` policy or similar), and Cost Explorer enabled on the account.
- In a member account you only see that account's cost unless the payer has shared it.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://console.aws.amazon.com/costmanagement/home#/cost-explorer. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open Cost Explorer in the payer account**: Sign in to the management (payer) account if you want every member account, otherwise the one account you care about. The link opens Billing and Cost Management > Cost Explorer; if it shows the saved report list, click **New cost and usage report**.
2. **Set the range and grouping**: In the right-hand panel set **Date Range** to a custom range from 30 days ago to yesterday, **Granularity** to `Daily` and **Group by** Dimension to `Service`. The chart turns into one bar per day with a table below it.
3. **Exclude credits, refunds and tax**: Under **Filters**, open **Charge type**, choose `Credit`, `Refund` and `Tax`, and switch the filter to **Exclude**. The table caps the number of services and puts the rest in "Others", so click **Download as CSV** to get every service per day.
4. **Read yesterday against the week**: From the CSV, total yesterday, the average of the 7 days before it and the same weekday last week. Rank services by yesterday's cost and by change; name any service up 30% and $25 or more.
5. **Add the month**: Change **Date Range** to the `Month to date` preset for the total so far. Extending the end date to the last day of the month adds AWS's own forecast as a hatched bar, if you want the projection.

Note: Cost Explorer data refreshes a few times a day, so an early-morning look at yesterday can still grow by a few percent. Each Cost Explorer page load also runs API requests billed at $0.01 each. The on-screen table shows a limited number of groups; the CSV has them all.

## The report

- **Yesterday's spend**, against the 7-day average and the same weekday last week.
- **Top services** by cost with their change.
- **What moved**: the service and usage type behind any jump.
- **Month to date**, and the forecast for the month if asked.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "aws-daily-cost-report/<date of this run, e.g. 2026-10-16>",
  "item_key": "aws-daily-cost-report",
  "project": "Acme AWS",
  "source": "AWS daily cost report skill",
  "kind": "metric",
  "title": "Yesterday cost $1,284, 10% above the 7-day average",
  "metric": {
    "label": "AWS spend yesterday",
    "value": 1284.37,
    "prefix": "$",
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "7-day average",
            "value": 1166,
            "prefix": "$"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Month to date",
            "value": 18642,
            "prefix": "$"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Top service",
            "value": "EC2"
          }
        }
      ]
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Service",
          "Yesterday",
          "vs 7-day avg"
        ],
        "align": [
          "left",
          "right",
          "right"
        ],
        "rows": [
          [
            "Amazon EC2",
            "$512.40",
            "+4%"
          ],
          [
            "Amazon RDS",
            "$268.10",
            "+1%"
          ],
          [
            "Amazon S3",
            "$141.85",
            "+3%"
          ],
          [
            "Amazon CloudWatch",
            "$96.20",
            "+48%"
          ],
          [
            "Data transfer",
            "$88.30",
            "+2%"
          ],
          [
            "Everything else",
            "$177.52",
            "+5%"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "CloudWatch went from about $65 to $96 a day after new log groups appeared in acme-prod on Oct 15. The usage type is log ingestion.",
        "tone": "warn"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Every day at 8:00 (`0 8 * * *`). From cron, with the agent signed in on that machine:

```bash
0 8 * * * claude -p "Run the aws-daily-cost-report skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/aws-daily-cost-report#schedule

Source: https://briefkin.dev/skills/aws-daily-cost-report
