postgres-expert

postgres-expert is an agent for Claude Code from GoogilyBoogily/googilyboogily-claude-power-tools. It costs 38 tokens per session (1,766 once invoked), scanned A, original, MIT.

An agent for improving PostgreSQL databases, including queries, indexes, JSONB data, partitions, replication, connections, and automatic cleanup. PostgreSQL is a relational database that supports structured tables and advanced data types.

In plain words
What is it for?
Use it for PostgreSQL query tuning, JSONB operations, advanced indexing, partitioning, replication, connection management, or autovacuum settings.
Why use it?
PostgreSQL performance and maintenance problems often depend on database-specific settings and features.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the database-agents plugin — 4 agents shipped together

Good fit Use it for PostgreSQL query tuning, JSONB operations, advanced indexing, partitioning, replication, connection management, or autovacuum settings.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert
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.

Clone the repo
git clone --depth 1 https://github.com/GoogilyBoogily/googilyboogily-claude-power-tools

Made for: Claude Code.

Or install database-agents, the plugin that ships this one along with the rest of its 4 agents.

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert/github.svg)](https://agentmods.dev/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert)
Your own site
<a href="https://agentmods.dev/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert"><img src="https://agentmods.dev/badge/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert/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-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert"><img src="https://agentmods.dev/badge/agents/googilyboogily/googilyboogily-claude-power-tools/postgres-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,766 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.00038 $0.01766
Opus 5 $0.00019 $0.00883
Sonnet 5 $0.00008 $0.00353
Haiku 4.5 $0.00004 $0.00177

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

Security

Grade A, and why

postgres-expert 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 11d 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.

plugins/database-agents/agents/postgres-expert.md · 190 lines

How it starts

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

PostgreSQL Expert

You are a PostgreSQL specialist. You handle query optimization, JSONB operations, advanced indexing, partitioning, replication, connection management, and autovacuum tuning.

Step 0: Route or Stay

Before proceeding, check if a different agent is better suited:

  • General database issues (schema design, cross-platform SQL) → database-expert
  • System-wide performance (OS tuning, multi-service perf) → performance-engineer
  • Database query optimization (slow query analysis, index recommendations) → optimizer

If the problem is PostgreSQL-specific, continue.

STOP Conditions

Do NOT proceed if:

  • The issue is generic SQL not specific to PostgreSQL — route to database-expert
  • The task is about MongoDB — route to mongodb-expert
  • You have delivered a working solution and validated it — stop and summarize

Step 1: Environment Detection

SELECT version();
SHOW shared_buffers; SHOW effective_cache_size; SHOW work_mem;
SHOW maintenance_work_mem; SHOW max_connections; SHOW wal_level;
SELECT * FROM pg_extension;
SELECT state, count(*) FROM pg_stat_activity GROUP BY state;

Step 2: Problem Categories

EXPLAIN ANALYZE Interpretation

Always use EXPLAIN (ANALYZE, BUFFERS, VERBOSE). Key things to look for:

Plan node Red flag Action
Seq Scan on large table rows= high, no filter Add B-tree index on filter columns
Nested Loop Inner side has high loops= Consider Hash Join via composite index
Sort Sort Method: external merge Increase work_mem or add index matching ORDER BY
Bitmap Heap Scan Recheck Cond with many lossy blocks Index is too broad; narrow with composite or partial index
Hash Join Batches: N where N > 1 Increase work_mem

JSONB Operations & Indexing

-- GIN with jsonb_path_ops: smaller, faster for containment (@>)
CREATE INDEX idx_jsonb_path ON api USING GIN (jdoc jsonb_path_ops);

-- Expression index for specific key lookups
CREATE INDEX idx_jsonb_company ON api USING BTREE ((jdoc ->> 'company'));

-- GIN with default jsonb_ops: supports @>, ?, ?|, ?& operators
CREATE INDEX idx_jsonb_default ON api USING GIN (jdoc);

Read the full file on GitHub · 190 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. 11d ago First seen · 190 lines · 38 tokens per session scan A 3cdef6f99909

Subscribe to this mod's changes

postgres-expert is an agent published in the GitHub repository GoogilyBoogily/googilyboogily-claude-power-tools (2 stars, last pushed 4mo ago), licensed MIT. It adds 38 tokens to every session and 1,766 once invoked, about $0.0002 per session on Opus 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-08-31.

Related

Other agents, from other repositories

PostgreSQL Database Administrator

Work with PostgreSQL databases using the PostgreSQL extension.

github/awesome-copilot · 17 tokens

supabase-substrate-explorer

Specialist research agent for discovering creative, non-obvious applications of the Supabase SUBSTRATE dimension (Postgres Database, Storage object store, pgvector) to Thoughtbox's reasoning-persistence surfaces. Use proactively when exploring how substrate-layer primitives could become new "organs" for Thoughtbox…

Kastalien-Research/thoughtbox · 117 tokens

database-reviewer

PostgreSQL specialist for query performance, schema design, security/RLS, and migration safety. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance.

sjarmak/coding-agent-workflows · 43 tokens

supabase-rag-implementer

Materializa RAG em Supabase em 3 layers - migration vector(N)+HNSW, RPC matchdocuments security invoker com RLS por tenant, Edge Function embedding server-side. Use ao implementar RAG.

luanpdd/kit-mcp · 52 tokens

supabase-roles-implementer

Gera SQL de Postgres Roles em Supabase (CREATE ROLE + GRANT matrix + BYPASSRLS) para system access — service accounts, BI, cron jobs. Recebe spec via Task(). Nao substitui RLS + Custom Claims.

luanpdd/kit-mcp · 59 tokens

multi-tenant-isolation-auditor

Produz ISOLATION-AUDIT.md scored P0/P1/P2 com gaps de isolamento cross-tenant Supabase B2B — tabelas sem RLS, helpers VOLATILE, JOINs cross-tenant. Use antes de release ou periodicamente. (pesado).

luanpdd/kit-mcp · 67 tokens