Skip to main content
subagent CX Codex

postgres-expert · 0xfurai — Claude Code subagent: what it does, how to install

postgres-expert helps design PostgreSQL schemas, optimize slow SQL queries, and configure indexes for balanced read and write performance.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/postgres-expert.md
Open on GitHub

What postgres-expert does

This subagent focuses on PostgreSQL database administration and query tuning. It evaluates execution plans to locate bottlenecks, recommends indexing strategies, and outlines partitioning for large datasets.

The guidance covers schema normalization, transaction isolation levels, and locking mechanisms. Outputs include optimized SQL statements with CTEs or window functions, configuration files adjusted for workloads, and backup plans like point-in-time recovery (PITR).

In its frontmatter metadata, the subagent pins the model to claude-sonnet-4-20250514, which determines how Claude Code executes its tasks.

What it helps with

  • Analyze execution plans to resolve slow query bottlenecks
  • Design normalized database schemas with strict integrity constraints
  • Select indexing strategies balanced for read and write loads
  • Configure partitioning and point-in-time recovery backup plans

Example prompts for the agent

  • Review this slow query execution plan and recommend missing indexes
  • Design a normalized database schema with foreign keys for an order system
  • Tune postgresql.conf settings for a write-heavy workload

How to install postgres-expert

Manually: put the files in place

.claude/agents/postgres-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about postgres-expert

How do I install postgres-expert in Claude Code?

Save the subagent definition file to .claude/agents/postgres-expert.md inside your repository.

What does postgres-expert do?

It diagnoses query bottlenecks, produces optimized SQL statements, designs schemas, and suggests PostgreSQL configuration adjustments.

Which model powers this subagent?

The subagent frontmatter defines claude-sonnet-4-20250514 as its runtime model.

Source text

postgres-expert.md · MIT
---
name: postgres-expert
description: Expert in PostgreSQL database management and optimization, handling complex SQL queries, indexing strategies, and ensuring high-performance database systems.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Mastery of advanced SQL queries, including CTEs and window functions
- Proficient in designing and Normalizing database schemas
- Expertise in indexing strategies to optimize query performance
- Deep understanding of PostgreSQL architecture and configuration
- Skilled in backup and restore processes for data safety
- Familiarity with PostgreSQL extensions to enhance functionality
- Command over transaction isolation levels and locking mechanisms
- Conducting performance tuning and query optimization
- Implementation of replication and clustering for high availability
- Ensuring data integrity through constraints and referential integrity

## Approach

- Analyze query execution plans to identify bottlenecks
- Normalize database schemas to minimize redundancy
- Apply indexing wisely by balancing read/write performance
- Configure PostgreSQL settings tailored to workload demands
- Utilize partitioning strategies for big data scenarios
- Leverage stored procedures and functions for repeated logic
- Conduct regular database health checks and maintenance
- Implement robust monitoring and alerting systems
- Utilize advanced backup strategies, such as PITR
- Stay updated with the latest PostgreSQL features and best practices

## Quality Checklist

- Queries are optimized for minimal execution time
- Indexes are appropriately used and maintained
- Schemas are normalized without loss of performance
- All database operations are ACID compliant
- Appropriate partitioning is used for large datasets
- Data redundancy is minimized and integrity is enforced
- Backup and recovery plans are tested and documented
- Extensions are appropriately used without performance degradation
- Monitoring tools are effectively deployed for real-time insights
- System configurations are optimized based on query patterns

## Output

- Performance-optimized SQL queries with detailed explanation
- Comprehensive schema design documentation
- Configuration files customized for specific workloads
- Detailed execution plan analyses with recommendations
- Backup and recovery strategy documentation
- Performance benchmarking results before and after optimizations
- Monitoring setup guidelines and alert configuration documentation
- Deployment strategies for high availability setups
- Documentation of custom functions and procedures
- Reports on periodic health checks and maintenance activities

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Data and databases →

postgres-expert by other authors comes first.

postgres-expert carlrannaberg postgres-expert tunes PostgreSQL queries, configures JSONB indexing, and debugs execution plans using EXPLAIN ANALYZE. Helpful when queries slow down application responses. CX Codex ★ 763repo stars postgres-tuning oakoss postgres-tuning — a skill for Claude Code, Codex, Cursor and other agents that provides PostgreSQL 17/18+ performance tuning guidance. Covers async I/O, query plan forensics, index strategy, autovacuum, pgvector, and connection pooling. CX Codex +1 136installs postgres-query civitai postgres-query runs PostgreSQL queries, inspects index usage, and analyzes execution plans using read-only connections by default. CX Codex +1 ★ 7,327repo stars neon-postgres neondatabase neon-postgres is a Claude Code skill for working with Neon databases, from connections and schemas to branches. It activates for existing database, SQL, inspection, and search tasks. CX Codex +1 315,000installs postgres-patterns affaan-m postgres-patterns is a Claude Code skill for PostgreSQL schema design and query tuning, covering indexes, data types, RLS policies, and slow-query diagnosis. CX Codex +1 7,200installs postgres-best-practices neondatabase postgres-best-practices is a Claude Code skill for PostgreSQL schema design, SQL, and query tuning. It activates for database setup, migrations, and troubleshooting slow queries. CX Codex +1 2,100installs design-postgres-tables tigerdata design-postgres-tables — a reference skill for PostgreSQL table design: data types, indexes, constraints, JSONB and partitioning. Useful when your agent writes or edits a schema. CX Codex +1 680installs

From the same set137

The whole set →
mongodb-expert mongodb-expert — a Claude subagent for MongoDB work: schema design, indexes, aggregation pipelines, replication, backups and migrations. CX Codex ★ 1,029repo stars rabbitmq-expert rabbitmq-expert is a Claude Code subagent focused on RabbitMQ architecture, queue tuning, and high-availability clustering. CX Codex ★ 1,029repo stars dynamodb-expert The dynamodb-expert subagent for Claude Code helps design DynamoDB schemas, choose keys and indexes, and review queries and capacity settings when designing or checking a database. CX Codex ★ 1,029repo stars grpc-expert grpc-expert — a Claude subagent for gRPC work: streaming, protobuf, channel setup, load balancing and tracing. Useful when calls fail with vague status codes. CX Codex ★ 1,029repo stars graphql-expert The graphql-expert subagent helps design GraphQL schemas, improve queries, and review API architecture. Use it when performance, introspection, or schema changes need attention. CX Codex ★ 1,029repo stars nodejs-expert nodejs-expert — a Claude subagent for server-side Node.js work: async patterns, streams, Express APIs, profiling. Tests, linting and a dependency audit are part of its brief. CX Codex ★ 1,029repo stars rails-expert rails-expert guides Claude Code through Ruby on Rails development with ActiveRecord optimizations, RSpec testing patterns, and architectural conventions. CX Codex ★ 1,029repo stars elasticsearch-expert The elasticsearch-expert subagent helps inspect Elasticsearch clusters, refine search queries, and plan indexing and recovery work. Use it when troubleshooting cluster health or tuning performance. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open