---
name: supabase-usage-vs-plan-limits
description: "Every morning: how close each Supabase project is to its plan limits for database size, storage and monthly active users, with the closest one named. Use when the user asks for this, or when it runs on a schedule."
---

# Supabase usage vs plan limits

Every morning: how close each Supabase project is to its plan limits for database size, storage and monthly active users, with the closest one named.

On the Free plan a Supabase database that passes 500 MB goes read-only, and on Pro the overage simply lands on the invoice. Either way the warning sits on the organization Usage page, which nobody opens until something breaks or the bill arrives.

The agent measures each project the way Postgres sees it, with `pg_database_size` and the `storage.objects` table, estimates monthly active users from the auth schema, and compares all three with your plan. You get one percentage, the resource behind it, and how many days of growth are left at the current pace.

## 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

- The Supabase MCP server (`https://mcp.supabase.com/mcp`, ideally with `read_only=true`), or a personal access token in `SUPABASE_ACCESS_TOKEN` plus a read-only Postgres connection string per project.
- Your billing cycle start date, if it is not the 1st of the month.

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

### Steps

1. **Find the plan and the projects** (Supabase): With the Supabase MCP server, call `list_organizations`, `get_organization` (it returns the plan) and `list_projects`. Without it, use the Management API: `GET https://api.supabase.com/v1/organizations/{slug}` and `GET /v1/projects`. Note the included quotas for that plan from the billing docs, for example Free: 500 MB database per project, 1 GB storage, 50,000 MAU.
2. **Measure database size** (Supabase): For each project run `select pg_database_size(current_database())` through `execute_sql`, plus the five largest tables from `select relname, pg_total_relation_size(relid) from pg_catalog.pg_statio_user_tables order by 2 desc limit 5`.
3. **Measure file storage** (Supabase): Run `select bucket_id, sum((metadata->>'size')::bigint) from storage.objects group by 1` and add up the buckets. Storage quota is shared across the organization, so sum all projects before comparing.
4. **Estimate monthly active users** (Supabase): Count `select count(*) from auth.users where last_sign_in_at >= <billing cycle start>`. Supabase bills distinct users who sign in or refresh a token in the cycle, so treat this as a floor, not the billed number.
5. **Compare and project**: Turn each measurement into a percent of its limit and lead with the highest. Compare with yesterday's run (kept in a small JSON file next to the skill) and, from the last 7 days of growth, estimate how many days are left before 100%.

## Route B: the browser

### What you need

- Signed in to Supabase with an account that is a member of the organization; any role can read the Usage page.

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

### Steps

Start at https://supabase.com/dashboard/org/_/usage. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open the organization Usage page**: The URL asks which organization to open when you belong to several; pick the one that owns the projects. The Usage page shows the current billing cycle by default; leave the cycle picker at the top on the current period.
2. **Read the plan and the included quotas**: The page header names the plan (Free, Pro, Team). Each usage section states what the plan includes next to the number used, so there is no need to look the quotas up: on Free, **Database size** shows 500 MB per project, **Storage size** 1 GB and **Monthly Active Users** 50,000.
3. **Read database size per project**: In the **Database size** section switch the breakdown to show each project and note the current value for each one. A project past its limit on Free is shown as read-only here before anything else tells you.
4. **Read storage, MAU and egress**: Scroll to **Storage size**, **Monthly Active Users** and **Egress** and note the used value and the included amount for each. These are the billed figures, so MAU here is exact rather than the floor the SQL route estimates, and egress is available at all.
5. **Compare and project**: Turn each number into a percent of its included amount and lead with the highest. The charts cover the whole cycle, so read the value from about 7 days ago off the database size chart and estimate how many days remain before 100% at that pace.

Note: The Usage page is the better route for this report: it shows billed MAU and egress, which the SQL route can only estimate or not measure at all. It does not list the largest tables; for those, open the project and run the pg_total_relation_size query in the SQL Editor. Usage figures on the page refresh periodically rather than live, so a sudden import can take a while to appear.

## The report

- **Closest to its limit**: the resource, project and percent.
- **Per project**: database size against the plan, with the five largest tables.
- **Organization**: file storage and the MAU estimate against the plan.
- **Runway**: days until the closest limit at the last week's growth.
- One line on the cheapest fix, such as pruning a log table or moving old files.

## 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": "supabase-usage-vs-plan-limits/<date of this run, e.g. 2026-10-16>",
  "item_key": "supabase-usage-vs-plan-limits",
  "project": "acme-web",
  "source": "Supabase usage vs plan limits skill",
  "kind": "metric",
  "title": "Database at 71% of the 500 MB Free plan limit",
  "metric": {
    "label": "Highest usage vs plan limit (database)",
    "value": 71,
    "unit": "%",
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": [
    {
      "type": "Progress",
      "props": {
        "label": "Database size",
        "value": 71,
        "text": "355 MB of 500 MB",
        "tone": "warn"
      }
    },
    {
      "type": "Grid",
      "props": {
        "columns": 2
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "File storage",
            "value": 42,
            "unit": "%"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "MAU (floor)",
            "value": 25,
            "unit": "%"
          }
        }
      ]
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Resource",
          "Used",
          "Plan limit",
          "Share"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "Database (acme-web)",
            "355 MB",
            "500 MB",
            "71%"
          ],
          [
            "File storage",
            "420 MB",
            "1 GB",
            "42%"
          ],
          [
            "Monthly active users",
            "12,480",
            "50,000",
            "25%"
          ]
        ]
      }
    },
    {
      "type": "Bars",
      "props": {
        "unit": "MB",
        "items": [
          {
            "label": "events",
            "value": 182
          },
          {
            "label": "audit_log",
            "value": 64
          },
          {
            "label": "messages",
            "value": 41
          },
          {
            "label": "profiles",
            "value": 18
          },
          {
            "label": "orders",
            "value": 12
          }
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "The database grew about 11 MB a day this week, so it reaches 500 MB in roughly 13 days. Half of it is the events table.",
        "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 supabase-usage-vs-plan-limits 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/supabase-usage-vs-plan-limits#schedule

Source: https://briefkin.dev/skills/supabase-usage-vs-plan-limits
