prisma-connection-pool-exhaustion

prisma-connection-pool-exhaustion is a skill for Claude Code, Codex from magic3007/dotfiles. It costs 100 tokens per session (1,160 once invoked), scanned A, a copy of prisma-connection-pool-exhaustion, MIT.

A troubleshooting skill for Prisma database connection pools running in serverless environments such as Vercel, AWS Lambda, or Netlify. Prisma is a tool that lets an application connect to databases such as PostgreSQL or MySQL.

In plain words
What is it for?
Use it to investigate Prisma P2024 errors and database connection exhaustion in production, and to evaluate connection-pooling options such as PgBouncer or Prisma Accelerate.
Why use it?
It addresses failures where many short-lived serverless processes open too many database connections, causing timeout errors or database connection-limit errors even when local development works.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to investigate Prisma P2024 errors and database connection exhaustion in production, and to evaluate connection-pooling options such as PgBouncer or Prisma Accelerate.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/magic3007/dotfiles/prisma-connection-pool-exhaustion
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add magic3007/dotfiles --skill prisma-connection-pool-exhaustion
Clone the repo
git clone --depth 1 https://github.com/magic3007/dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prisma-connection-pool-exhaustion

README.md
[![agentmods](https://agentmods.dev/badge/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion/github.svg)](https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion)
Your own site
<a href="https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prisma-connection-pool-exhaustion

Your own site · 80×15
<a href="https://agentmods.dev/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/prisma-connection-pool-exhaustion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,160 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00100 $0.01160
Opus 5 $0.00050 $0.00580
Sonnet 5 $0.00020 $0.00232
Haiku 4.5 $0.00010 $0.00116

Measured 10d ago against content hash 5d9610dfbbf1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

prisma-connection-pool-exhaustion scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to prisma-connection-pool-exhaustion — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

claude/skills/claudeception/examples/prisma-connection-pool-exhaustion/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prisma Connection Pool Exhaustion in Serverless

Problem

Serverless functions create a new Prisma client instance on each cold start. Each instance opens multiple database connections (default: 5 per instance). With many concurrent requests, this quickly exhausts the database's connection limit (often 20-100 for managed databases).

Context / Trigger Conditions

This skill applies when you see:

  • P2024: Timed out fetching a new connection from the connection pool
  • PostgreSQL: FATAL: too many connections for role "username"
  • MySQL: Too many connections
  • Works fine locally with npm run dev but fails in production
  • Errors appear during traffic spikes, then resolve
  • Database dashboard shows connections at or near limit

Environment indicators:

  • Deploying to Vercel, AWS Lambda, Netlify Functions, or similar
  • Using Prisma with PostgreSQL, MySQL, or another connection-based database
  • Database is managed (PlanetScale, Supabase, Neon, RDS, etc.)

Solution

Step 1: Use Connection Pooling Service

The recommended solution is to use a connection pooler like PgBouncer or Prisma Accelerate, which sits between your serverless functions and the database.

For Supabase:

# .env
# Use the pooled connection string (port 6543, not 5432)
DATABASE_URL="postgresql://user:[email protected]:6543/postgres?pgbouncer=true"

For Neon:

# .env  
DATABASE_URL="postgresql://user:[email protected]/dbname?sslmode=require"
# Neon has built-in pooling

For Prisma Accelerate:

npx prisma generate --accelerate

Step 2: Configure Prisma Connection Limits

In your schema.prisma:

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
  // Limit connections per Prisma instance
  relationMode = "prisma"
}

In your connection URL or Prisma client:

// lib/prisma.ts
import { PrismaClient } from '@prisma/client'

const globalForPrisma = global as unknown as { prisma: PrismaClient }

export const prisma = globalForPrisma.prisma || new PrismaClient({
  datasources: {
    db: {
      url: process.env.DATABASE_URL + '?connection_limit=1'
    }
  }
})

if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 162 lines · 100 tokens per session scan A 5d9610dfbbf1

Subscribe to this mod's changes

prisma-connection-pool-exhaustion is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 2d ago), licensed MIT. It adds 100 tokens to every session and 1,160 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to prisma-connection-pool-exhaustion, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

diagnose-ci

Investigate failing REMOTE CI runs on GitHub Actions: find the failed run, pull the failed-step logs with gh, identify the root cause (compile error, test failure, lint, missing secret, timeout), and recommend a fix. Read-only: it does not commit, push, or edit. Use when CI is red, a GitHub Actions run failed, or the…

urmzd/dotfiles · 130 tokens

triage-dotfiles-env

Playbook of known failure modes in this dotfiles stack: pipx "bad interpreter" after Python rebuilds, gpg commit-signing failures, direnv/nix shellHook running bash instead of zsh, Powerlevel10k instant-prompt warnings, and Neovim plugin errors from removed Lua APIs. Use when a shell startup error, git signing…

urmzd/dotfiles · 138 tokens

fix-and-retry

Diagnose a failing CI run, apply the code fix, commit it, push, and watch the re-run until it passes or fails -- the full fix-and-retry loop in one shot. Use after a pipeline fails and the user says "fix it and retry", "fix the CI and push", or "make CI green". Do NOT use for a read-only investigation that stops at a…

urmzd/dotfiles · 106 tokens

diagnose-runtime

Triage LOCAL runtime failures on your own machine: crashes and errors, hangs and deadlocks, slowness and high CPU/memory, and hardware/serial/USB issues. Method: reproduce, isolate (bisect, log, strace/dtruss, sample), form a hypothesis, verify the fix holds. Read-mostly: it inspects processes and logs, it does not…

urmzd/dotfiles · 171 tokens

use-next-devtools

Reference for using the NextJS Dev Tools via the nextjs-agent. Use to debug or observe Next.js framework internals.

ooloth/dotfiles · 30 tokens

orchestrate-agents

Orchestrate multiple agent CLIs (Claude, Codex, Antigravity) via tmux with a shared fleet store, dispatching one guardian subagent per pane. Survey-first: inspects and adopts existing tmux sessions, windows, and agent panes before creating anything new. Use when running a multi-agent session, dispatching parallel…

urmzd/dotfiles · 83 tokens