Neon Postgres Egress Optimizer Skill for Claude Code: What It Does and How to Install It
Makes your assistant find the queries that send too much data out of Postgres and fix them in your code.
- Installs
- 33.9K
- on skills.sh
- Stars
- 108
- on GitHub
- Updated
- Oct 2026
- last repo commit
SKILL.md works four steps in order: diagnose which queries move the most data, analyze the code behind them, fix the anti-patterns, then verify. The diagnose step runs queries against pg_stat_statements.
It loads when you mention a high database bill, egress or data transfer, or when you review query patterns for cost. It needs a database connection and the Neon CLI, and it points to the parent neon skill first.
Good for
- Developers whose Neon bill shows high data transfer
- Teams reviewing query patterns for overfetching
- Anyone replacing SELECT * and unbounded queries
Install neon-postgres-egress-optimizer
Claude Code
- 1
Copy this prompt.
Install the neon-postgres-egress-optimizer skill in Claude Code. Run this command: npx skills add neondatabase/agent-skills --skill neon --skill neon-postgres-egress-optimizer Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js, A Neon account.
Install the parent neon skill with this one: SKILL.md starts with 'Use the parent neon skill', and the commands here use the Neon CLI. The parent neon skill gives the CLI install (npm i -g neon, plus bun, pnpm or brew variants) and sign-in (neon login). The plugin route installs the neon-postgres plugin: 9 skill folders and the Neon MCP server (https://mcp.neon.tech/mcp), which asks you to sign in with Neon over OAuth on first use. The folder routes copy skills only. There is no Claude app upload route because the skill drives the Neon CLI.
Built from the package data we hold. Not yet tested by us.
What's in the skill
When it loads
Diagnose and fix excessive Postgres egress (network data transfer) in a codebase. Use when a user mentions high database bills, unexpected data transfer costs, network transfer charges, egress spikes, "why is my Neon bill so high", "database costs jumped", SELECT * optimization, query overfetching, reduce Neon costs, optimize database usage, or wants to reduce data sent from their database to their application. Also use when reviewing query patterns for cost efficiency, even if the user doesn't explicitly mention egress or data transfer.
Sections in SKILL.md
- Step 1: Diagnose
- Check if pg_stat_statements is available
- Handle empty stats
- Diagnostic queries
- Interpret the results
- Step 2: Analyze the Codebase
- Step 3: Fix
- Unused columns (SELECT \)
- Missing pagination
- High-frequency queries on static data
- Application-side aggregation
- JOIN duplication
- Step 4: Verify
- Neon Infrastructure as Code (neon.ts)
- Further Reading
Key facts
- Installs on skills.sh
- 33,937 (Nov 2, 2026)
- Last repo commit
- Oct 30, 2026
- Audits on skills.sh
- Gen Agent Trust Hub: pass, Socket: pass, Snyk: pass
- What it includes
- 1 file: SKILL.md (counted from the repo tree)
- Part of plugin
- neon-postgres (9 skill folders and the Neon MCP server)
What it includes
Reads pg_stat_statements for the queries that return the most rows.
It runs 4 diagnostic queries: most total rows, most rows per call, most frequent, and longest running.
Try: “Why is my Neon bill so high?”
Runs code ·
Step 1: DiagnoseCreates the extension if the check query errors.
SKILL.md says the extension is available by default on Neon but may still need this step.
Runs code ·
CREATE EXTENSION pg_stat_statementsClears the stats to start a clean measurement window.
SKILL.md says to let the app run for at least an hour afterwards.
Delete ·
SELECT pg_stat_statements_reset()Checks each query for column use, row limits, caching, aggregation and JOIN duplication.
Files ·
Step 2: Analyze the codebaseApplies fixes for 5 anti-patterns in your query code.
The patterns are unused columns (SELECT *), missing pagination, high-frequency queries on static data, application-side aggregation and JOIN duplication.
Write ·
Step 3: FixRuns your tests, checks response shapes and re-measures with pg_stat_statements.
Runs code ·
Step 4: VerifySets branch TTL and autoscaling limits for non-production branches.
Uses npm i @neon/config and neon config apply. SKILL.md says this is complementary to the query fixes.
Runs code ·
neon.ts compute settings
From the official docs
Permissions
Medium risk
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It runs SQL on your database
The diagnose step runs SELECT queries on pg_stat_statements, can run CREATE EXTENSION IF NOT EXISTS, and runs pg_stat_statements_reset(). Try it on a branch first. github.com
It edits your query code
Fixes change column lists, add pagination and rewrite aggregation and JOINs. SKILL.md warns these can break clients that depend on specific fields or full result sets, so run your tests. github.com
Resetting stats clears evidence
pg_stat_statements_reset() throws away the numbers you may want from a bad day. Save the diagnostic output first. github.com
Technical details
| Turning on read-only | No read-only mode is documented for this skill. |
|---|---|
| Talks to | Your Neon database. Neon API through the CLI |
| Sign-in and keys | Uses your database connection and Neon CLI sign-in. SKILL.md does not say where these are stored. |
| Scopes |
|
Questions
What does the neon-postgres-egress-optimizer skill do?
It helps your assistant find why a Postgres database sends too much data to your app, then fix the queries. It uses pg_stat_statements to find the worst queries, checks your code, applies fixes and verifies the result.
How do I install it?
Use the install box at the top of this page. It installs the parent neon skill with this one, because SKILL.md starts by pointing to the neon skill. You also need the Neon CLI and a Neon account.
Is it the official Neon skill?
Yes. It is in Neon's own agent-skills repo, and the repo's marketplace file calls its plugins official Neon plugins for Claude Code.
Does it work in the Claude app?
The install box has no Claude app upload route, because the skill drives the Neon CLI on your machine.
What is egress?
It is network data transfer out of your database. SKILL.md says most high egress bills come from the application fetching more data than it uses.
Does it only work on Neon?
The skill is written for Neon and links to Neon cost pages. The diagnostic queries and code fixes are about Postgres query patterns, but SKILL.md frames the whole workflow around Neon.
Is it safe?
It runs SQL on your database and edits your query code. The stats reset clears pg_stat_statements. Our advice: run it against a branch and review the code diff.
Information
updated Nov 2, 2026
- Repository
- neondatabase/agent-skills
- Folder
skills/neon-postgres-egress-optimizer
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- neondatabase/agent-skills README · github.com
- neon marketplace.json · github.com
- neon plugin.json · github.com
- neon mcp.json · github.com
- neon SKILL.md (parent skill) · github.com
- neon-postgres-egress-optimizer SKILL.md · github.com