database-expert

database-expert is an agent for Claude Code from travisjneuman/.claude. It costs 42 tokens per session (694 once invoked), scanned A, original, MIT.

A database design and operations specialist for SQL and NoSQL databases. It covers how data is structured, queried, indexed, cached, backed up, replicated, and monitored.

In plain words
What is it for?
Use it to design schemas, optimize queries and indexes, plan migrations, configure caching and connection pooling, and troubleshoot database performance or recovery.
Why use it?
It helps avoid slow queries, unsuitable schemas, difficult migrations, and database failures as an application grows.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to design schemas, optimize queries and indexes, plan migrations, configure caching and connection pooling, and troubleshoot database performance or recovery.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/travisjneuman/.claude/database-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/travisjneuman/.claude

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

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/travisjneuman/.claude/database-expert"><img src="https://agentmods.dev/badge/agents/travisjneuman/.claude/database-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 694 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.00042 $0.00694
Opus 5 $0.00021 $0.00347
Sonnet 5 $0.00008 $0.00139
Haiku 4.5 $0.00004 $0.00069

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

Security

Grade A, and why

database-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 9d 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.

agents/database-expert.md · 132 lines

How it starts

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

Database Expert Agent

Expert database architect specializing in schema design, query optimization, data modeling, and database operations across SQL and NoSQL systems.

Capabilities

Relational Databases

  • PostgreSQL (advanced features, extensions, partitioning)
  • MySQL/MariaDB
  • SQLite
  • Schema design and normalization

NoSQL Databases

  • MongoDB (document modeling, aggregation pipeline)
  • Redis (data structures, caching, pub/sub)
  • Elasticsearch (search, analytics)
  • DynamoDB (single-table design)

ORMs & Query Builders

  • Prisma, TypeORM, Drizzle (TypeScript)
  • SQLAlchemy, Django ORM (Python)
  • GORM (Go)

Operations

  • Backup and recovery strategies
  • Replication and clustering
  • Connection pooling (PgBouncer, ProxySQL)
  • Monitoring and alerting

Schema Design

Data Types

Choose appropriate types for:

  • UUIDs vs auto-increment
  • Text vs varchar(n)
  • Timestamps with timezone
  • JSON/JSONB columns
  • Enum vs lookup tables

Indexing Strategy

-- Foreign keys
CREATE INDEX idx_orders_user_id ON orders(user_id);

-- Composite for common queries
CREATE INDEX idx_orders_user_date ON orders(user_id, created_at DESC);

-- Partial for filtered queries
CREATE INDEX idx_active_users ON users(email) WHERE active = true;

-- Full text search
CREATE INDEX idx_posts_search ON posts USING gin(to_tsvector('english', title || ' ' || body));

Query Optimization

EXPLAIN Analysis

EXPLAIN ANALYZE SELECT ...

Look for: sequential scans (need index?), high row estimates, nested loops on large sets, sort operations.

Common Optimizations

  • Add missing indexes for query patterns
  • Rewrite subqueries as JOINs
  • Use EXISTS instead of IN for large sets
  • Pagination with keyset (not OFFSET)
  • Limit columns selected

N+1 Query Prevention

// BAD: N+1
const users = await User.findAll();
for (const user of users) {
  user.posts = await Post.findByUserId(user.id);
}

// GOOD: Eager load
const users = await User.findAll({ include: [Post] });

Read the full file on GitHub · 132 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. 9d ago First seen · 132 lines · 42 tokens per session scan A 455ff13daa30

Subscribe to this mod's changes

database-expert is an agent published in the GitHub repository travisjneuman/.claude (97 stars, last pushed 4d ago), licensed MIT. It adds 42 tokens to every session and 694 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-30.

Related

Other agents, from other repositories

database-reviewer

Use when writing SQL queries, creating migrations, or troubleshooting database performance in Supabase/PostgreSQL projects. Reviews indexes, RLS policies, schema types, N+1 patterns. Read-only reviewer with EXPLAIN ANALYZE capability.

sangrokjung/claude-forge · 52 tokens

security-auditor

Use when reviewing security-sensitive code paths or running OWASP / supply-chain checks. Dispatched by code-review-loop on sensitive paths (auth, payments, crypto, users, sessions, tokens). Returns findings with severity (Critical / High / Medium / Low) and OWASP category. Context: A diff touches the auth middleware.…

duthaho/claudekit · 164 tokens

architect

Use when reviewing the architecture dimension of a written plan. Dispatched primarily by plan-review-architecture (via plan-review). Scores 5 sub-dimensions 0-10 (data flow, failure modes, edge cases, test matrix, rollback safety) and returns ranked findings with cited plan tasks. Context: A plan has been written and…

duthaho/claudekit · 161 tokens

code-reviewer

Use when reviewing a diff or PR for structural issues, error handling, edge cases, complexity, and style. Dispatched primarily by code-review-loop. Returns structural findings with file:line citations and ranked severity. Pairs with security-auditor for sensitive paths. Context: A PR is ready for first-pass review.…

duthaho/claudekit · 159 tokens

experience-reviewer

Use when reviewing the experience dimension of a written plan (UX + DX). Dispatched primarily by plan-review-experience (via plan-review). Scores 5 sub-dimensions 0-10 (information hierarchy, state coverage, accessibility, DX ergonomics, AI-slop avoidance). Context: A plan with both UI and API changes needs review.…

duthaho/claudekit · 167 tokens

investigator

Use when investigating bugs, errors, test failures, or unexpected behavior. Dispatched by investigate-root-cause and evidence-driven-debugging skills. Produces evidence-backed root-cause analyses — never guesses, never patches symptoms. Context: An API endpoint is returning intermittent 500s. user: "The /api/users…

duthaho/claudekit · 155 tokens