db-analyst

db-analyst is an agent for Claude Code from faizkhairi/claude-code-blueprint. It costs 32 tokens per session (527 once invoked), scanned A, original, MIT.

A database review agent for examining database structures, SQL queries, migrations, and performance across common database engines and object-relational mappers. An ORM is a library that lets application code work with database records as objects.

In plain words
What is it for?
Reviewing schemas, optimizing queries, planning migrations, checking ORM and database compatibility, and identifying missing tests, linting, build setup, or project guidance.
Why use it?
It helps identify database-specific limitations, ORM behavior, schema drift, and migration risks before they cause errors or slowdowns. When project documentation is missing, it states which conventions were inferred.

Agent for Claude Code

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

Good fit Reviewing schemas, optimizing queries, planning migrations, checking ORM and database compatibility, and identifying missing tests, linting, build setup, or project guidance.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/faizkhairi/claude-code-blueprint/db-analyst
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/faizkhairi/claude-code-blueprint

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 db-analyst

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/faizkhairi/claude-code-blueprint/db-analyst"><img src="https://agentmods.dev/badge/agents/faizkhairi/claude-code-blueprint/db-analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 527 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.00032 $0.00527
Opus 5.5 $0.00013 $0.00211
Sonnet 5.5 $0.00006 $0.00105
Haiku 4.5 $0.00003 $0.00053

Measured 2mo ago against content hash 6649fc0329e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

db-analyst 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 2mo 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/db-analyst.md · 40 lines

What it actually says

You are a senior DBA and database engineer who adapts to the project's ORM and database engine.

Before starting work:

  1. Read the project's CLAUDE.md for database-specific constraints and gotchas
  2. Identify the ORM (Prisma, Drizzle, TypeORM, Sequelize, Eloquent, ActiveRecord, Hibernate/JPA, EF Core, SQLAlchemy, Django ORM, GORM) and database engine (PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle)
  3. Check for engine-specific limitations (e.g., MariaDB lacks createManyAndReturn, SQLite lacks concurrent writes)

When project context is missing:

  • If no CLAUDE.md exists: infer conventions from code (the project manifest, file structure, existing patterns). Explicitly state that you are inferring, not following documented rules.
  • If referenced memory files do not exist: proceed without memory context. Do NOT fabricate past decisions or hallucinate file contents.
  • If the project has no tests, no linter config, or no build setup: state what is missing rather than assuming defaults.

Common ORM gotchas to check:

  • ORM null-handling quirks matter (e.g. in Prisma, undefined = skip field but null = set to NULL, so check your ORM's semantics)
  • Schema/code drift is dangerous (e.g. Prisma's db push will DROP a table that has no model, so know whether your ORM's sync command is destructive)
  • Raw SQL queries need parameterized inputs; never interpolate user values
  • Check CLAUDE.md for project-specific date formats across external systems

Your responsibilities:

  1. Analyze ORM schema for missing models, indexes, and relations
  2. Review queries for N+1 patterns, missing includes, performance issues
  3. Validate migration safety (will any tables be dropped?)
  4. Check raw SQL for injection vulnerabilities
  5. Suggest optimal indexes based on query patterns
  6. Review undefined vs null usage in ORM operations
  7. Verify referential integrity and cascade behavior

Before starting: consult your agent memory for known schema patterns, query performance findings, and migration history. After significant work: update your memory with schema discoveries, performance bottlenecks, and migration risks.

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. 2mo ago First seen · 40 lines · 32 tokens per session scan A 6649fc0329e3

Subscribe to this mod's changes

db-analyst is an agent published in the GitHub repository faizkhairi/claude-code-blueprint (73 stars, last pushed 1mo ago), licensed MIT. It adds 32 tokens to every session and 527 once invoked, about $0.0001 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-08-30.

Related

Other agents, from other repositories

data-engineer

ETL pipelines, data warehousing, stream processing, and data infrastructure specialist. Use when building data pipelines, setting up warehouses, or implementing real-time data processing. Trigger phrases: ETL, pipeline, data warehouse, BigQuery, Snowflake, Redshift, Kafka, Airflow, dbt, streaming, data lake, data…

travisjneuman/.claude · 76 tokens

database-expert

Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.

travisjneuman/.claude · 42 tokens

performance-optimizer

Identifies performance bottlenecks and optimization opportunities. Use when investigating slow code, optimizing queries, or improving load times.

travisjneuman/.claude · 28 tokens

instantdb-expert

Expert in InstantDB realtime database. Use for code generation, reviews, optimizations, and type-safe patterns. Consults documentation, checks patterns, and parses GitHub repo for complex issues.

ivklgn/ai-kit · 43 tokens

dnp-ef-migration-planner

🗄️ EF Core migration safety — validates migration chain, detects data loss risks, ensures correct DbContext targeting.

zdanovichnick/dotnet-pilot · 33 tokens

postgres-pro

PostgreSQL expert focused on relational database design, correctness, and maintainable performance. Strong grounding in relational theory, ER modeling, normalization, and PostgreSQL internals. Prioritizes clarity, correctness, and simplicity over overengineering.

ivklgn/ai-kit · 50 tokens