Agent skill

Neon Postgres Egress Optimizer

by sickn33 in sickn33/agentic-awesome-skills

Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

Apache-2.0Auto-check passedDatabases

Install Neon Postgres Egress Optimizer

skills CLI
$ npx skills add sickn33/agentic-awesome-skills --skill neon-postgres-egress-optimizer -a claude-code

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

GitHub CLI
$ gh skill install sickn33/agentic-awesome-skills neon-postgres-egress-optimizer --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/sickn33/agentic-awesome-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/neon-postgres-egress-optimizer .claude/skills/neon-postgres-egress-optimizer && 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
neon-postgres-egress-optimizer
GitHub stars
47k
Used in
1 other repo
Token cost
~2.5k tokens
SKILL.md length
1,082 words
Files
1
Skills in repo
1,493
Repo updated
First seen
Licence
Apache-2.0

At a glance

Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

  • Works in 4 steps: Diagnose → Analyze codebase → Fix → …
  • Databases work in your project
  • SKILL.md covers When to Use, Step 1: Diagnose, Step 2: Analyze codebase and Step 3: Fix, plus 4 more sections
  • Calls npm

What it does

Neon Postgres Egress Optimizer is an agent skill from sickn33/agentic-awesome-skills. Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases. It works with PostgreSQL and Neon. The repository describes itself as: AAS Core is the local, agent-first control plane for complete catalog discovery, agent-owned selection, stack validation, and planning, backed by 2,400+ agentic skills. Includes… The licence is Apache-2.0.

When your agent uses it

  • Databases work in your project

Example prompts

  • “/neon-postgres-egress-optimizer”

Requirements

  • Node.js

Workflow steps

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

  1. Diagnose
  2. Analyze codebase
  3. Fix
  4. Verify

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    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):

    • neon.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.

Context cost

Neon Postgres Egress Optimizer loads about 2.5k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 1,082 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

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 sickn33/agentic-awesome-skills at commit 680176d, republished under its Apache-2.0 licence (© sickn33). 1,082 words, ~2,485 tokens.

Download SKILL.mdSave it as .claude/skills/neon-postgres-egress-optimizer/SKILL.md (or your agent's skills folder).
name
neon-postgres-egress-optimizer
description
Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.
risk
critical
source
https://github.com/neondatabase/agent-skills/tree/main/skills/neon-postgres-egress-optimizer
source_repo
neondatabase/agent-skills
source_type
official
date_added
2026-07-01
license
Apache-2.0
license_source
https://github.com/neondatabase/agent-skills/blob/main/LICENSE

Postgres Egress Optimizer

When to Use

Use this skill when you need 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...

Guide the user through diagnosing and fixing application-side query patterns that cause excessive data transfer (egress) from their Postgres database. Most high egress bills come from the application fetching more data than it uses.

Step 1: Diagnose

Identify which queries transfer the most data. The primary tool is the pg_stat_statements extension.

Check if pg_stat_statements is available
sql
SELECT 1 FROM pg_stat_statements LIMIT 1;

If this errors, the extension needs to be created:

sql
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

On Neon, it is available by default but may need this CREATE EXTENSION step.

Handle empty stats

Stats are cleared when a Neon compute scales to zero and restarts. If the stats are empty or the compute recently woke up:

  1. Reset the stats to start a clean measurement window: SELECT pg_stat_statements_reset();
  2. Let the application run under representative traffic for at least an hour.
  3. Return and run the diagnostic queries below.

If the user has stats from a production database, use those. If they have no access to production stats, proceed to Step 2 and analyze the codebase directly — code-level patterns are often sufficient to identify the worst offenders.

Diagnostic queries

Run these to identify the top egress contributors. Focus on queries that return many rows, return wide rows (JSONB, TEXT, BYTEA columns), or are called very frequently.

Queries returning the most total rows:

sql
SELECT query, calls, rows AS total_rows, rows / calls AS avg_rows_per_call
FROM pg_stat_statements
WHERE calls > 0
ORDER BY rows DESC
LIMIT 10;

Queries returning the most rows per execution (poorly scoped SELECTs, missing pagination):

sql
SELECT query, calls, rows AS total_rows, rows / calls AS avg_rows_per_call
FROM pg_stat_statements
WHERE calls > 0
ORDER BY avg_rows_per_call DESC
LIMIT 10;

Most frequently called queries (candidates for caching):

sql
SELECT query, calls, rows AS total_rows, rows / calls AS avg_rows_per_call
FROM pg_stat_statements
WHERE calls > 0
ORDER BY calls DESC
LIMIT 10;

Longest running queries (not a direct egress measure, but helps identify problem queries during a spike):

sql
SELECT query, calls, rows AS total_rows,
  round(total_exec_time::numeric, 2) AS total_exec_time_ms
FROM pg_stat_statements
WHERE calls > 0
ORDER BY total_exec_time DESC
LIMIT 10;
Interpret the results

Rank findings by estimated egress impact:

  • High row count + wide rows = biggest egress. A query returning 1,000 rows where each row includes a 50KB JSONB column transfers ~50MB per call.
  • Extreme call frequency on even small queries adds up. A query called 50,000 times/day returning 10 rows each = 500,000 rows/day.
  • Cross-reference with the schema to identify which columns are wide. Look for JSONB, TEXT, BYTEA, and large VARCHAR columns.

Step 2: Analyze codebase

For each query identified in Step 1, or for each database query in the codebase if no stats are available, check:

  • Does it select only the columns the response needs?
  • Does it return a bounded number of rows (LIMIT/pagination)?
  • Is it called frequently enough to benefit from caching?
  • Does it fetch raw data that gets aggregated in application code?
  • Does it use a JOIN that duplicates parent data across child rows?

Step 3: Fix

Apply the appropriate fix for each problem found. Below are the most common egress anti-patterns and how to fix them.

Unused columns (SELECT *)

Problem: The query fetches all columns but the application only uses a few. Large columns (JSONB blobs, TEXT fields) get transferred over the wire and discarded.

Before:

sql
SELECT * FROM products;

After:

sql
SELECT id, name, price, image_urls FROM products;
Missing pagination

Problem: A list endpoint returns all rows with no LIMIT. This is an unbounded egress risk — every new row in the table increases data transfer on every request. Flag this regardless of current table size.

This is easy to miss because the application may work fine with small datasets. But at scale, an unpaginated endpoint returning 10,000 rows with even moderate column widths can transfer hundreds of megabytes per day.

Before:

sql
SELECT id, name, price FROM products;

After:

sql
SELECT id, name, price FROM products
ORDER BY id
LIMIT 50 OFFSET 0;

When adding pagination, check whether the consuming client already supports paginated responses. If not, pick sensible defaults and document the pagination parameters in the API.

High-frequency queries on static data

Problem: A query is called thousands of times per day but returns data that rarely changes. Every call transfers the same rows from the database. This pattern is only visible from pg_stat_statements — the code itself looks normal.

Look for queries with extremely high call counts relative to other queries. Common examples: configuration tables, category lists, feature flags, user role definitions.

Fix: Add a caching layer between the application and the database so it avoids hitting the database on every request.

Show full SKILL.md (397 more words)Show less
Application-side aggregation

Problem: The application fetches all rows from a table and then computes aggregates (averages, counts, sums, groupings) in application code. The full dataset transfers over the wire even though the result is a small summary.

Fix: Push the aggregation into SQL.

Before: The application fetches entire tables and aggregates in code with loops or .reduce().

After:

sql
SELECT p.category_id,
       AVG(r.rating) AS avg_rating,
       COUNT(r.id) AS review_count
FROM reviews r
INNER JOIN products p ON r.product_id = p.id
GROUP BY p.category_id;
JOIN duplication

Problem: A JOIN between a wide parent table and a child table duplicates all parent columns across every child row. If a product has 200 reviews and the product row includes a 50KB JSONB column, the join sends that 50KB × 200 = ~10MB for a single request.

This is distinct from the SELECT * problem. Even if you select only needed columns, a JOIN still repeats the parent data for every child row. The fix is structural: avoid the join entirely.

Before:

sql
SELECT * FROM products
LEFT JOIN reviews ON reviews.product_id = products.id
WHERE products.id = 1;

After (two separate queries):

sql
SELECT id, name, price, description, image_urls FROM products WHERE id = 1;
SELECT id, user_name, rating, body FROM reviews WHERE product_id = 1;

Two queries instead of one JOIN. The product data is fetched once. The reviews are fetched once. No duplication.

Step 4: Verify

After applying fixes:

  1. Run existing tests to confirm nothing broke.
  2. Check the responses — make sure the API still returns the same data shape. Column selection and pagination changes can break clients that depend on specific fields or full result sets.
  3. Measure the improvement — if pg_stat_statements data is available, reset it (SELECT pg_stat_statements_reset();), let traffic run, then re-run the diagnostic queries to compare before and after.

Neon Infrastructure as Code (neon.ts)

The fixes above cut egress (data transferred out of Postgres). The other big non-prod cost lever is compute, and you can codify it durably in neon.ts — Neon's infrastructure-as-code file (see the neon skill for the full reference) — so dev, preview, and CI branches stay cheap by default instead of relying on per-branch flags:

bash
npm i @neon/config
typescript
// neon.ts
import { defineConfig } from "@neon/config/v1";

export default defineConfig({
  branch: (branch) => {
    if (branch.exists || branch.isDefault) return {}; // don't touch prod
    return {
      ttl: "7d", // ephemeral branches auto-expire instead of accruing storage
      postgres: {
        computeSettings: {
          autoscalingLimitMinCu: 0.25, // scale to zero when idle
          autoscalingLimitMaxCu: 1, // cap autoscaling on throwaway branches
          suspendTimeout: "5m",
        },
      },
    };
  },
});
bash
neon config apply   # apply to the current branch (neon deploy is an alias)

This is complementary, not a substitute: query-pattern fixes are what actually reduce egress charges, while these settings keep non-production compute and storage from quietly inflating the same bill. Because neon checkout applies the policy when it creates a branch, new dev/preview branches inherit the cheap profile automatically.

Further reading

Limitations

  • Use this skill only when the task clearly matches its upstream product or API scope.
  • Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
  • Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.

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

Files

Just SKILL.md in skills/neon-postgres-egress-optimizer of sickn33/agentic-awesome-skills.

Open the folder on GitHubat commit 680176d

Used in 1 other repository

We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in sickn33/agentic-awesome-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Neon Postgres Egress Optimizer 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.

Neon Postgres Egress Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Neon Postgres Egress Optimizer this skillsickn33/agentic-awesome-skills47k1 repos~2.5kAutomated safety check: PassApache-2.0
Neon Postgressmontlouis/bible-strong1711 repos~2.3kAutomated safety check: NotesGPL-3.0
Neon Postgresusenotra/notra256—~4.1kAutomated safety check: NotesAGPL-3.0
Neon Postgresneondatabase/agent-skills100—~4.1kAutomated safety check: NotesApache-2.0
Neon Postgresdavila7/claude-code-templates32k4 repos~396Automated safety check: PassMIT
Neon Postgres Egress Optimizerneondatabase/agent-skills100—~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Neon Postgres

    smontlouis/bible-strong

    Guides and best practices for working with Lakebase Postgres, the database behind Neon.

    171 GitHub starsUsed in 1 repo~2.3k tokens
    DatabasesAuto-check: notes
  • Neon Postgres

    usenotra/notra

    Guides and best practices for working with Lakebase Postgres, the database behind Neon.

    256 GitHub stars~4.1k tokensUpdated today
    DatabasesAuto-check: notes
  • Neon Postgres

    neondatabase/agent-skills

    Official

    Guides and best practices for working with Lakebase Postgres on Neon: connections, pooled vs direct, schema migrations, branching, autoscaling, scale-to-zero, instant restore, read replicas, IP…

    100 GitHub stars~4.1k tokensUpdated today
    DatabasesAuto-check: notes
  • Neon Postgres

    davila7/claude-code-templates

    Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration Use when: neon database, serverless postgres, database branching, neon postgres, postgres…

    32k GitHub starsUsed in 4 repos~396 tokens
    DatabasesAuto-check passed
  • Neon Postgres Egress Optimizer

    neondatabase/agent-skills

    Official

    Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

    100 GitHub stars~2.6k tokensUpdated today
    DatabasesAuto-check passed
  • Neon Postgres

    aiskillstore/marketplace

    Guides and best practices for working with Neon Serverless Postgres.

    430 GitHub starsUsed in 4 repos~4.2k tokens
    DatabasesAuto-check: notes

More from sickn33/agentic-awesome-skills

All 1,493 skills in this repo
  • Liuguang Banlan UI

    sickn33/agentic-awesome-skills

    Implements an interface in one of two named color modes, iridescent white or colorful black, from a parameterized starter that reports measured color intensity.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • User Thoughts Memory

    sickn33/agentic-awesome-skills

    Saves a user's project decisions, rules and preferences into a project-local mdbase so later sessions and other agents can recover the intent.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Using LWC Memory and Graphs

    sickn33/agentic-awesome-skills

    Keeps project decisions, research and verified results available across coding-agent sessions through LWC memory, a document Wiki graph and a CodeGraph code index.

    47k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Find Complementary Founders

    sickn33/agentic-awesome-skills

    Guides an agent through assessing its own owner for cofounder fit, publishing an approved profile, and ranking complementary profiles other agents published for their owners.

    47k GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check passed
  • Whatsapp Cloud API

    sickn33/agentic-awesome-skills

    Integracao com WhatsApp Business Cloud API (Meta). An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~4.5k tokens
    Auto-check passed
  • Cline Pilot

    sickn33/agentic-awesome-skills

    Acts as a proxy for the Cline CLI, dispatching coding tasks one at a time, monitoring runs by hard evidence, relaying decisions to you and learning per-project preferences.

    47k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Works with

Categories

Questions about Neon Postgres Egress Optimizer

What does Neon Postgres Egress Optimizer do?

Diagnose and fix excessive Postgres egress (network data transfer) in a codebase. Neon Postgres Egress Optimizer is an agent skill from sickn33/agentic-awesome-skills. Diagnose and fix excessive Postgres egress (network data transfer) in a codebase.

When should I use Neon Postgres Egress Optimizer?

Neon Postgres Egress Optimizer fits situations like: databases work in your project.

How do I install Neon Postgres Egress Optimizer in Claude Code?

Run `npx skills add sickn33/agentic-awesome-skills --skill neon-postgres-egress-optimizer -a claude-code`. Or copy the skill folder (skills/neon-postgres-egress-optimizer in sickn33/agentic-awesome-skills) into .claude/skills/neon-postgres-egress-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Neon Postgres Egress Optimizer in Codex?

Run `npx skills add sickn33/agentic-awesome-skills --skill neon-postgres-egress-optimizer -a codex`. Or copy the skill folder (skills/neon-postgres-egress-optimizer in sickn33/agentic-awesome-skills) into .agents/skills/neon-postgres-egress-optimizer in your project. Codex loads it when a task matches its description.

Can I use Neon Postgres Egress Optimizer 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 sickn33/agentic-awesome-skills --skill neon-postgres-egress-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/neon-postgres-egress-optimizer, .gemini/skills/neon-postgres-egress-optimizer, .github/skills/neon-postgres-egress-optimizer and .opencode/skills/neon-postgres-egress-optimizer in your project.

What does Neon Postgres Egress Optimizer need to run?

Going by SKILL.md and its folder, Neon Postgres Egress Optimizer needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Neon Postgres Egress Optimizer access the network?

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

Is Neon Postgres Egress Optimizer 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 Neon Postgres Egress Optimizer use?

Neon Postgres Egress Optimizer is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Neon Postgres Egress Optimizer use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Neon Postgres Egress Optimizer?

Skills that share tags, products or a category with Neon Postgres Egress Optimizer: Neon Postgres (smontlouis/bible-strong, 171 stars), Neon Postgres (usenotra/notra, 256 stars), Neon Postgres (neondatabase/agent-skills, 100 stars) and Neon Postgres (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Neon Postgres Egress Optimizer?

sickn33 (a GitHub user) maintains it in sickn33/agentic-awesome-skills, which has 47,379 GitHub stars. The repository holds 1,493 skills in this directory. The repository was last updated on October 9, 2026.

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