What it does
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.
How it works
1Find the plan and the projects
With the Supabase MCP server, call
list_organizations,get_organization(it returns the plan) andlist_projects. Without it, use the Management API:GET https://api.supabase.com/v1/organizations/{slug}andGET /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.2Measure database size
For each project run
select pg_database_size(current_database())throughexecute_sql, plus the five largest tables fromselect relname, pg_total_relation_size(relid) from pg_catalog.pg_statio_user_tables order by 2 desc limit 5.3Measure file storage
Run
select bucket_id, sum((metadata->>'size')::bigint) from storage.objects group by 1and add up the buckets. Storage quota is shared across the organization, so sum all projects before comparing.4Estimate monthly active users
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
5Compare 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%.
Post it to the board
With
BRIEFKIN_TOKENset, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Install and run it
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
Install the skill
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shell
curl -fsSL https://briefkin.dev/skills/supabase-usage-vs-plan-limits/install | shRun it
Ask Claude Code:
prompt
Run the supabase-usage-vs-plan-limits skillOr paste the prompt instead of installing:
prompt
Check my Supabase usage against my plan (read only). Use the Supabase MCP server or the Management API to find my organization's plan and projects. For each project, run select pg_database_size(current_database()) and list the five largest tables. Sum file storage from storage.objects (metadata->>'size') across all projects. Estimate monthly active users with count(*) from auth.users where last_sign_in_at is in the current billing cycle, and say it is a lower bound. Compare each number with the plan's included quota (Free: 500 MB database per project, 1 GB storage, 50,000 MAU; check the current billing docs for other plans). Lead with the resource closest to its limit as a percent, then the rest, and estimate days until 100% from the last week of growth if you have earlier numbers.Put it on a schedule
Every day at 8:00, from cron on any machine where Claude Code is signed in:
crontab
0 8 * * * claude -p "Run the supabase-usage-vs-plan-limits skill"Add it with
crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.Send it to your board
Connect Briefkin once with
curl -fsSL https://briefkin.dev/install | shand every run lands on your board as a stat tile. How setup works
View the SKILL.mdRaw file
SKILL.md---
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
What your agent needs
The Supabase MCP server (
https://mcp.supabase.com/mcp, ideally withread_only=true), or a personal access token inSUPABASE_ACCESS_TOKENplus a read-only Postgres connection string per project.Your billing cycle start date, if it is not the 1st of the month.
Connecting Supabase
- Supabase MCP server, Supabase's official remote server at
https://mcp.supabase.com/mcp, signed in with OAuth. URL options narrow it:project_ref=<ref>limits it to one project,read_only=trueruns every query as a read-only Postgres user, andfeatures=database,debugging,docsloads only those tool groups. In Claude Code:claude mcp add --scope project --transport http supabase "https://mcp.supabase.com/mcp?project_ref=<ref>&read_only=true", then/mcpand Authenticate. In Codex, add the URL under[mcp_servers.supabase]in~/.codex/config.tomland runcodex mcp login supabase; in Cursor, put it undermcpServersin.cursor/mcp.json. Supabase is also in Claude's connector directory (docs). - Unattended runs with a token. For CI or scheduled jobs, create a personal access token, store it in
SUPABASE_ACCESS_TOKEN, and send it asAuthorization: Bearerto the same project-scoped, read-only URL. - Direct Postgres or the CLI. Connect with a read-only Postgres role and the connection string from the project's Connect panel, stored in
DATABASE_URL, or runsupabase link --project-ref <ref>and then thesupabase inspect dbcommands.
Supabase's own advice for unattended routines: scope the server to one project, set read_only=true, limit features, and keep production out of reach unless the report needs it.
Questions
Why is egress not on the card?
As of October 2026 the Supabase Management API has no organization usage endpoint, and egress cannot be measured from inside the database. The skill covers what it can measure exactly or estimate fairly; for egress, glance at the organization Usage page, or paste the number into the run and the agent will include it.
Is the MAU number exact?
No, it is a floor. Supabase counts every user who signs in or refreshes a token during the billing cycle, while last_sign_in_at only moves on a sign-in. Apps with long sessions will see a billed MAU above this estimate; the dashboard number is the one on the invoice.
Do I need Briefkin to use the Supabase usage vs plan limits skill?
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.
Which agents can run it?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Can it work without an API or MCP server, from my browser?
Yes. Switch the data source to "Your browser" and the steps change to the Supabase pages themselves: the agent opens supabase.com/dashboard/org/_/usage in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.