| name | supabase-incident-runbook |
| description | Execute Supabase incident response: dashboard health checks, connection pool status, pg_stat_activity queries, RLS debugging, Edge Function logs, storage health, and escalation. Use when responding to Supabase outages, investigating production errors, debugging connection issues, or preparing evidence for Supabase support escalation. Trigger with "supabase incident", "supabase outage", "supabase down", "supabase on-call", "supabase emergency", "supabase broken", or "supabase connection issues". |
| allowed-tools | Read, Grep, Bash(npx supabase:*), Bash(supabase:*), Bash(curl:*), Bash(psql:*) |
| version | 1.53.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","supabase","incident-response","debugging","operations","runbook"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Supabase Incident Runbook
Overview
A structured response for Supabase-backed application failures. Work three
layers in order: triage platform vs. application, run pg_stat_activity
database diagnostics, then debug RLS, Edge Functions, and storage — ending with
an evidence bundle for support escalation.
When to use: Production errors involving Supabase, degraded API response times, connection pool exhaustion, silent data filtering from RLS, Edge Function cold start failures, or storage upload/download errors.
Each step below gives the workflow plus a first command. The complete
copy-paste blocks for every step live in
references/diagnostics.md.
Prerequisites
- Supabase project with dashboard access at supabase.com/dashboard
@supabase/supabase-js v2+ installed in your project
- Supabase CLI installed for Edge Function log access
- Direct database connection string (for
psql diagnostics)
- Access to status.supabase.com for platform health
Instructions
Step 1: Triage — Platform vs. Application
Determine whether the issue is a Supabase platform incident or an application-level bug. Check the official status page first, then verify SDK client connectivity. Use Read to inspect the app's Supabase env config and Grep to scan application logs for HTTP error codes (401=auth, 429=rate limit, 500=server).
curl -sf https://status.supabase.com/api/v2/status.json | jq '.status'
If the status page is green, run the SDK healthCheck() (a select 1 against a
small _health_check table) to measure latency and confirm connectivity. A
green platform plus a failing health check points at your queries, RLS, or Edge
Functions — the SDK block, incident-check query, and full decision tree are in
references/diagnostics.md.
Step 2: Database Diagnostics with pg_stat_activity
Connect directly via psql (or the Supabase SQL Editor) to inspect connections, find stuck queries, and detect leaks.
state, () connections,
((epoch age(now(), state_change))):: max_idle_seconds
pg_stat_activity
datname current_database()
state connections ;