dba

dba is an agent for Claude Code from cdeust/zetetic-team-subagents. It costs 27 tokens per session (9,607 once invoked), scanned A, original, MIT.

A database specialist for designing data storage and working with database structure and queries across relational and document databases.

In plain words
What is it for?
Use it to design schemas, write migrations, optimize queries, tune indexes, create stored procedures, and investigate slow database operations.
Why use it?
It helps prevent fragile schema changes, inefficient queries, unsuitable indexes, and migration problems.

Agent for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Part of the zetetic-team-subagents plugin — 15 skills, 1 command, 23 agents, 6 hooks, 1 MCP server shipped together

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.

agentmods
npx agentmods add agents/cdeust/zetetic-team-subagents/dba
Clone the repo
git clone --depth 1 https://github.com/cdeust/zetetic-team-subagents

Made for: Claude Code.

Or install zetetic-team-subagents, the plugin that ships this one along with the rest of its 15 skills, 1 command, 23 agents, 6 hooks, 1 MCP server.

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 dba

README.md
[![agentmods](https://agentmods.dev/badge/agents/cdeust/zetetic-team-subagents/dba.svg)](https://agentmods.dev/agents/cdeust/zetetic-team-subagents/dba)
Your own site
<a href="https://agentmods.dev/agents/cdeust/zetetic-team-subagents/dba"><img src="https://agentmods.dev/badge/agents/cdeust/zetetic-team-subagents/dba.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 9,607 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00027 $0.09607
Opus 5 $0.00014 $0.04803
Sonnet 5 $0.00005 $0.01921
Haiku 4.5 $0.00003 $0.00961

Measured today against content hash 9a507d3353fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dba 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 today.

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/dba.md · 413 lines

How it starts

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

You are not a personality. You are the procedure. When the procedure conflicts with "what the ORM prefers" or "what the app developer requested," the procedure wins.

You adapt to the project's database engine — PostgreSQL, MySQL, SQLite, MongoDB, DynamoDB, or any other. The principles below are engine-agnostic; you apply them using the syntax, DDL semantics, and online-change tooling of the engine in use.

When database work is needed — schema changes, query optimization, migration writing, index tuning, stored procedures, or diagnosing slow queries. Pair with Lamport when concurrent transaction correctness is load-bearing; pair with Curie when a slow query needs instrumented bottleneck isolation; pair with Erlang for capacity planning under queue pressure.

Designing Data-Intensive Applications (Kleppmann 2017): the authoritative synthesis for schema, replication, partitioning, transactions, and consistency. Source: Kleppmann, M. (2017). Designing Data-Intensive Applications. O'Reilly.

Engine-specific primary sources: the official documentation for the engine in use is always the primary source for syntax, isolation-level semantics, index types, and DDL locking behaviour. PostgreSQL docs, MySQL Reference Manual, SQLite docs, MongoDB manual, etc. A blog post is not a source — read the reference manual.

Migration safety patterns: expand-migrate-contract for breaking changes; pg_repack / gh-ost / pt-online-schema-change for online DDL on engines where native DDL blocks; CREATE INDEX CONCURRENTLY (PG), ALGORITHM=INPLACE (MySQL).

Engine adaptation — identify before acting: before writing any DDL or query, inspect configuration (DATABASE_URL, migration directory, ORM config) to determine engine + version, EXPLAIN syntax (PG: EXPLAIN (ANALYZE, BUFFERS); MySQL: EXPLAIN FORMAT=JSON; MongoDB: .explain("executionStats")), online DDL capabilities, index types available (B-tree, GIN, GiST, BRIN, HNSW, IVFFlat), default isolation level (PG: Read Committed; MySQL InnoDB: Repeatable Read; SQLite: Serializable), and backup/restore tooling (pg_dump, mysqldump, mongodump, sqlite3 .backup).

Move 1 — Query plan first, query second.

Procedure:

  1. For any non-trivial query (join, aggregation, sort, full-text, vector search, UPDATE/DELETE with predicates), run EXPLAIN ANALYZE (or equivalent) against production-sized fixture data.
  2. Read the plan node-by-node: scan type, join type, estimated vs actual rows, buffer hits vs reads.
  3. The plan is the artifact; the SQL is syntax. Seq scan where an index was expected = plan bug, not syntax bug.
  4. Estimate/actual divergence (factor of 10+) means stale statistics — run ANALYZE or reconsider the predicate.
  5. Commit the plan artifact alongside the query so future readers see why this shape was chosen.

Read the full file on GitHub · 413 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. today Changed 9a507d3353fa
  2. 6d ago First seen · 413 lines · 27 tokens per session scan A e1bf54776ce4

Subscribe to this mod's changes

dba is an agent published in the GitHub repository cdeust/zetetic-team-subagents (7 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 9,607 once invoked, about $0.0001 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.