postgres-performance-tuning

postgres-performance-tuning is a skill for Claude Code from fmflurry/harness-manifesto. It costs 185 tokens per session (2,787 once invoked), scanned A, original, MIT.

A PostgreSQL performance-tuning guide for a PostgreSQL 16 database running in a Docker container. It covers memory settings, checkpoints, query statistics, slow-query investigation, and read-only query plans.

In plain words
What is it for?
It helps inspect PostgreSQL settings, investigate slow queries, use EXPLAIN on read queries, enable query statistics, and prepare possible tuning changes.
Why use it?
It helps diagnose database slowdowns while accounting for the container's memory limit. It keeps configuration changes under human control and encourages measuring before and after each change.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Good fit It helps inspect PostgreSQL settings, investigate slow queries, use EXPLAIN on read queries, enable query statistics, and prepare possible tuning changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmflurry/harness-manifesto/postgres-performance-tuning
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 fmflurry/harness-manifesto --skill postgres-performance-tuning
Clone the repo
git clone --depth 1 https://github.com/fmflurry/harness-manifesto

Made for: Claude Code.

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 postgres-performance-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmflurry/harness-manifesto/postgres-performance-tuning/github.svg)](https://agentmods.dev/skills/fmflurry/harness-manifesto/postgres-performance-tuning)
Your own site
<a href="https://agentmods.dev/skills/fmflurry/harness-manifesto/postgres-performance-tuning"><img src="https://agentmods.dev/badge/skills/fmflurry/harness-manifesto/postgres-performance-tuning/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 postgres-performance-tuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmflurry/harness-manifesto/postgres-performance-tuning"><img src="https://agentmods.dev/badge/skills/fmflurry/harness-manifesto/postgres-performance-tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 185 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,787 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 original No closer match found 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.00185 $0.02787
Opus 5.5 $0.00074 $0.01115
Sonnet 5.5 $0.00037 $0.00557
Haiku 4.5 $0.00018 $0.00279

Measured 15d ago against content hash 62663f345f41, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-performance-tuning 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 15d 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

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/postgres-performance-tuning/SKILL.md · 193 lines

How it starts

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

PostgreSQL Performance Tuning

Target version: postgres:16-alpine — this repository's gc-platform-postgres container: mem_limit: 1g, mem_reservation: 512m, no command: override (stock settings: shared_buffers=128MB, max_connections=100), no shared_preload_libraries.

Contract: diagnostics are read-only (pg_settings, pg_stat_*, EXPLAIN on SELECTs only). Every config change below is emitted ONLY as a ⚠️ HUMAN CONFIRMATION REQUIRED block — if postgres-dba is installed, that agent never applies settings; otherwise database-reviewer or the main agent does not either. Values marked ⚠️ are established heuristics, not guarantees: measure before and after every change, one parameter at a time.

Connection:

docker exec gc-platform-postgres psql -U gcplatform -d gcplatform -c "<query>"

1. Memory sizing vs the 1g mem_limit

Current settings (verify live):

SELECT name, setting, unit FROM pg_settings
WHERE name IN ('shared_buffers','effective_cache_size','work_mem','maintenance_work_mem',
               'max_connections','huge_pages');

⚠️ Heuristic sizing for a dedicated 1g container:

Parameter Stock Suggested Rationale
shared_buffers 128MB ≈ 256MB Classic ⚠️ 25%-of-RAM heuristic; the container also needs room for per-backend memory, WAL buffers, and the OS page cache
effective_cache_size 4GB (!) ≈ 512–768MB Planner hint for "how much caching exists total" (shared_buffers + OS cache). Stock 4GB is a lie on a 1g container and biases the planner toward index scans it shouldn't trust
work_mem 4MB keep 4–8MB Allocated PER sort/hash node PER connection. Worst case ≈ max_connections × nodes-per-query × work_mem: 100 × 4 nodes × 8MB = 3.2GB ≫ 1g. Raising it globally is how containers OOM; raise per-session for known big sorts instead
maintenance_work_mem 64MB 128–256MB Used by VACUUM/CREATE INDEX; few concurrent users, safe to raise

Read the full file on GitHub · 193 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. 15d ago First seen · 193 lines · 185 tokens per session scan A 62663f345f41

Subscribe to this mod's changes

postgres-performance-tuning is a skill published in the GitHub repository fmflurry/harness-manifesto (173 stars, last pushed 11d ago), licensed MIT. It adds 185 tokens to every session and 2,787 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-15.

Related

postgres-performance-tuning compared with skills from other repositories

postgres-performance-tuning next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgres-performance-tuningfmflurry/harness-manifestoSkill17311d agoMITA185Claude Code
alloydb-basicsgoogle/skillsSkill25ktodayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43k6d agoMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
dsqlawslabs/agent-pluginsSkill953todayApache-2.0A247Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill4965d agoApache-2.0A63Claude Code, Codex
postgresdbericrisco/rsc-harnessSkill6824d agoMITA91Claude Code, Codex