Agent skill

Supabase Cost Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization.

MITAuto-check passedDatabases

Install Supabase Cost Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-cost-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-cost-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/supabase-cost-tuning .claude/skills/supabase-cost-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
supabase-cost-tuning
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
840 words
Files
7 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization.

  • Works in 3 steps: Audit current usage and identify cost… → Optimize database, storage, and bandwidth → Right-size compute and reduce Edge…
  • Analyzing Supabase billing
  • SKILL.md covers Overview, Prerequisites, Pricing Reference and Instructions, plus 5 more sections
  • Calls npm

What it does

Supabase Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization. Use when analyzing Supabase billing, reducing costs, right-sizing compute, or implementing usage tracking and budget alerts. Trigger with phrases like "supabase cost", "supabase billing", "reduce supabase costs", "supabase pricing", "supabase expensive", "supabase budget".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/audit-queries.md`, `references/cost-estimation.md` and `references/cost-reduction-strategies.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Database administration. It works with Supabase. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Analyzing Supabase billing
  • Right-sizing compute
  • Implementing usage tracking and budget alerts
  • With phrases like supabase cost

Example prompts

  • “supabase cost”
  • “supabase billing”
  • “reduce supabase costs”
  • “/supabase-cost-tuning”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Bash(supabase:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Audit current usage and identify cost drivers
  2. Optimize database, storage, and bandwidth
  3. Right-size compute and reduce Edge Function costs

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Bash(supabase:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • supabase.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Supabase Cost Tuning loads about 2k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 107 tokens; SKILL.md has 840 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 840 words, ~1,980 tokens.

Download SKILL.mdSave it as .claude/skills/supabase-cost-tuning/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
supabase-cost-tuning
description
Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization. Use when analyzing Supabase billing, reducing costs, right-sizing compute, or implementing usage tracking and budget alerts. Trigger with phrases like "supabase cost", "supabase billing", "reduce supabase costs", "supabase pricing", "supabase expensive", "supabase budget".
allowed-tools
Read, Write, Edit, Grep, Bash(supabase:*)
compatibility
Designed for Claude Code
version
1.54.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, supabase, cost-optimization

Supabase Cost Tuning

Overview

Reduce Supabase spend by auditing usage against plan limits, eliminating database and storage waste, and right-sizing compute resources. The three biggest levers: database optimization (vacuum, index cleanup, archival), storage lifecycle management (compress before upload, orphan cleanup), and connection pooling to reduce compute add-on requirements.

Work the three steps below in order — audit first to find where the money goes, then optimize the biggest offenders, then right-size compute. Each step keeps a representative snippet inline; the full query and script sets live in references/ so this file stays scannable.

Prerequisites

  • Supabase project with Dashboard access (Settings > Billing)
  • @supabase/supabase-js installed: npm install @supabase/supabase-js
  • Service role key for admin operations (storage audit, cleanup scripts)
  • SQL editor access (Dashboard > SQL Editor or psql connection)

Pricing Reference

ResourceFree TierPro ($25/mo)Team ($599/mo)
Database500 MB8 GB included, $0.125/GB extra8 GB included
Storage1 GB100 GB included, $0.021/GB extra100 GB included
Bandwidth5 GB250 GB included, $0.09/GB extra250 GB included
Edge Functions500K invocations2M invocations, $2/million extra2M invocations
Realtime200 concurrent500 concurrent500 concurrent
Auth MAU50,000100,000100,000

Compute add-ons (Pro and above):

InstancevCPUsRAMPrice
Micro21 GBIncluded with Pro
Small22 GB$25/mo
Medium24 GB$50/mo
Large48 GB$100/mo
XL816 GB$200/mo
2XL1632 GB$400/mo

Decision framework: Read replicas ($25/mo each) beat scaling up when reads dominate and geographic distribution is needed. Connection pooling (Supavisor, free) reduces compute pressure from idle connections.

Instructions

Step 1: Audit current usage and identify cost drivers

Find where the database budget is going before changing anything. Run the audit queries in the SQL Editor to surface the biggest tables, unused indexes, dead-tuple bloat, and connection count. Start with total size:

sql
select pg_size_pretty(pg_database_size(current_database())) as total_db_size;

Then audit storage per bucket with a service-role client, and read current spend under Dashboard > Settings > Billing. See full audit queries and storage script for the complete SQL set (table sizes, zero-scan indexes, dead-tuple ratio, connection count) and the per-bucket usage script.

Step 2: Optimize database, storage, and bandwidth

Attack the biggest offenders from Step 1. Archive old rows before deleting, then VACUUM ANALYZE to reclaim space and refresh planner stats:

sql
vacuum (verbose, analyze) public.events;

For storage, compress images client-side before upload and schedule an orphan-cleanup job. For bandwidth, replace select('*') with explicit column lists, use head: true count queries for totals, and paginate with .range(). See full optimization code for the archival + VACUUM SQL, the compress/clean-orphans scripts, and the bandwidth-reduction patterns.

Step 3: Right-size compute and reduce Edge Function costs

Prefer pooling and code fixes over a compute upgrade. Route direct pg connections (migrations, ORMs) through the Supavisor pooler URL instead of scaling the instance:

typescript
// Direct endpoint: db.xxx.supabase.co on port 5432
// Pooled endpoint: db.xxx.supabase.co on port 6543

Cut Edge Function cost by keeping imports lightweight (dynamic-import heavy libraries only on the paths that need them) and caching expensive results across warm invocations. Add a lightweight usage-tracking table plus a daily materialized-view summary for spend visibility. See full compute and Edge Function code for the pooling config, cold-start patterns, and usage-monitoring schema (Step 3 section).

Show full SKILL.md (331 more words)Show less

Output

After completing all three steps, the project has:

  • Database size audit with table-level breakdown and dead tuple analysis
  • Unused indexes identified and dropped to reclaim storage
  • Old data archived and vacuumed to free database space
  • Storage orphans cleaned and upload compression implemented
  • Bandwidth reduced through column selection and pagination
  • Connection pooling configured to avoid unnecessary compute upgrades
  • Edge Function cold starts minimized with dynamic imports and caching
  • Usage monitoring table and daily summary view for spend visibility

Error Handling

IssueCauseSolution
Database approaching 500 MB (Free) or 8 GB (Pro)Data growth without archivalArchive old records, VACUUM, drop unused indexes
Storage costs climbing monthlyOrphaned uploads accumulatingSchedule cleanup job for files not linked to records
Unexpected bandwidth spikeselect('*') on large tablesUse specific column lists; add .range() pagination
Edge Function billing spikeRetry loops or heavy importsAdd circuit breaker with max 3 retries; dynamic imports
Connection limit errorsToo many direct connectionsSwitch to pooler URL (port 6543); reduce client pool size
Spend cap reachedUsage exceeded Pro included resourcesEnable spend cap in Dashboard > Settings > Billing to prevent overage
VACUUM not reclaiming spaceLong-running transactions holding locksCheck pg_stat_activity for idle-in-transaction; terminate stale sessions

Examples

Quick cost check — read database size and bucket count with a service-role client to see how close a growing project sits to its plan limits.

Monthly cost estimation — feed measured usage (DB GB, storage GB, bandwidth GB, Edge Function invocations, MAU) into a Pro-tier overage calculator that prints a line-item breakdown and total.

See full example scripts for the runnable quick-check and the estimateMonthlyCost calculator with a worked $31.05/mo case.

Resources

Next Steps

For architecture patterns, see supabase-reference-architecture. For performance tuning beyond cost, see supabase-performance-tuning.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/.curated/supabase-cost-tuning of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/audit-queries.md
  • references/cost-estimation.md
  • references/cost-reduction-strategies.md
  • references/errors.md
  • references/examples.md
  • references/optimization.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Supabase Cost Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Supabase Cost Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Supabase Cost Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: PassMIT
Postgresmagnus919/agent-skills115—~4kAutomated safety check: PassMIT
Hybrid Cloud Outboxesgetsentry/sentry46k—~4.8kAutomated safety check: PassCustom licence
Sea Orm 2FlyinPancake/yoink112—~2.9kAutomated safety check: PassApache-2.0
Redis Clusteringredis/agent-skills1661 repos~1kAutomated safety check: PassMIT
DB AdminEliasOulkadi/shokunin114—~2kAutomated safety check: NotesMIT

Similar skills

  • Postgres

    magnus919/agent-skills

    Operate PostgreSQL instances safely: configuration review, index and query-plan analysis, vacuum and bloat management, WAL archiving and point-in-time recovery, replication and failover, extensions…

    115 GitHub stars~4k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Hybrid Cloud Outboxes

    getsentry/sentry

    Official

    Guide for creating and maintaining outbox-based eventually consistent operations in Sentry.

    46k GitHub stars~4.8k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Sea Orm 2

    FlyinPancake/yoink

    Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

    112 GitHub stars~2.9k tokensUpdated 6 days ago
    DatabasesAuto-check passed
  • Redis Clustering

    redis/agent-skills

    Official

    Redis Cluster and replication guidance covering hash tags for multi-key operations, avoiding CROSSSLOT errors, and reading from replicas to scale read-heavy workloads.

    166 GitHub starsUsed in 1 repo~1k tokens
    DatabasesAuto-check passed
  • DB Admin

    EliasOulkadi/shokunin

    PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

    114 GitHub stars~2k tokensUpdated 6 days ago
    DatabasesAuto-check: notes
  • Redis Connections

    redis/agent-skills

    Official

    Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket…

    166 GitHub starsUsed in 1 repo~1.3k tokens
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Supabase Cost Tuning

What does Supabase Cost Tuning do?

Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization. Supabase Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Supabase costs through plan selection, database tuning, storage cleanup, connection pooling, and Edge Function optimization.

When should I use Supabase Cost Tuning?

Supabase Cost Tuning fits situations like: analyzing Supabase billing; right-sizing compute; implementing usage tracking and budget alerts; with phrases like supabase cost.

How do I install Supabase Cost Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-cost-tuning -a claude-code`. Or copy the skill folder (skills/.curated/supabase-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/supabase-cost-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Supabase Cost Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-cost-tuning -a codex`. Or copy the skill folder (skills/.curated/supabase-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/supabase-cost-tuning in your project. Codex loads it when a task matches its description.

Can I use Supabase Cost Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-cost-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/supabase-cost-tuning, .gemini/skills/supabase-cost-tuning, .github/skills/supabase-cost-tuning and .opencode/skills/supabase-cost-tuning in your project.

What does Supabase Cost Tuning need to run?

Going by SKILL.md and its folder, Supabase Cost Tuning needs the command-line tools its instructions call (npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Bash(supabase:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Supabase Cost Tuning access the network?

SKILL.md names 1 domain. As links in the text: supabase.com. This is read from the text; nothing was executed.

Is Supabase Cost Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Supabase Cost Tuning use?

Supabase Cost Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Supabase Cost Tuning use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Supabase Cost Tuning?

Skills that share tags, products or a category with Supabase Cost Tuning: Postgres (magnus919/agent-skills, 115 stars), Hybrid Cloud Outboxes (getsentry/sentry, 46k stars), Sea Orm 2 (FlyinPancake/yoink, 112 stars) and Redis Clustering (redis/agent-skills, 166 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Supabase Cost Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.