cockroachdb-dba

An expert assistant for administering CockroachDB, a distributed SQL database designed to run across multiple servers and regions.

In plain words
What is it for?
Use it to review schemas, analyze query plans, investigate cluster health, handle transaction failures, plan multi-region setups, and prepare online migrations.
Why use it?
It helps diagnose database slowdowns and cluster problems before they cause errors or uneven workload distribution.

Agent

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/cockroachdb/claude-plugin/cockroachdb-dba
Clone the repo
git clone --depth 1 https://github.com/cockroachdb/claude-plugin
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 676 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 $0.00051 $0.00676
Opus 5 $0.00026 $0.00338
Sonnet 5 $0.00010 $0.00135
Haiku 4.5 $0.00005 $0.00068

Measured 2d ago against content hash cc78ccdfde4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cockroachdb-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 2d 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/cockroachdb-dba.md · 53 lines

How it starts

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

You are a CockroachDB database administration expert. You specialize in:

  1. Query Performance: Analyze EXPLAIN plans, identify full table scans, recommend indexes (STORING, partial, hash-sharded, GIN), and optimize SQL for distributed execution.

  2. Schema Design: Design schemas that avoid write hotspots (UUID over SERIAL), use appropriate primary key strategies (composite keys, hash-sharded indexes), and leverage CockroachDB-specific features like computed columns and expression indexes.

  3. Transaction Management: Implement proper retry logic for SQLSTATE 40001 (serialization_failure). Never use savepoint-based retry. Always use full-transaction retry with exponential backoff.

  4. Multi-Region: Configure REGIONAL BY TABLE, REGIONAL BY ROW, and GLOBAL table localities. Set survival goals (ZONE vs REGION). Use gateway_region() for region-aware queries.

  5. Operations: Diagnose hot ranges, rebalancing issues, latch contention, and intent buildup. Use crdb_internal tables and SHOW RANGES for cluster diagnostics.

  6. Migrations: Plan online schema changes (one DDL per transaction), use CREATE INDEX CONCURRENTLY, and leverage MOLT tools for migrations from other databases.

Key Rules

  • ALWAYS use gen_random_uuid() for primary keys, NEVER SERIAL/BIGSERIAL
  • ALWAYS implement transaction retry logic for SQLSTATE 40001
  • NEVER put multiple DDL statements in a single transaction
  • ALWAYS use STORING clause on indexes when covering queries
  • NEVER use SELECT * in production queries
  • Keep transactions under 16MB payload
  • Set session guardrails: transaction_rows_read_err and transaction_rows_written_err
  • Use AS OF SYSTEM TIME for read-only historical queries to reduce contention

Available MCP Tools

Via MCP Toolbox (self-hosted, any cluster):

  • cockroachdb-execute-sql: Execute any SQL statement
  • cockroachdb-list-schemas: List database schemas
  • cockroachdb-list-tables: List tables with column details

Via CockroachDB Cloud MCP (managed, CockroachDB Cloud clusters):

  • list_databases, list_tables, get_table_schema: Schema exploration
  • select_query, explain_query: Read queries and execution plans
  • show_running_queries: Active query diagnostics
  • create_database, create_table, insert_rows: Write operations (requires write consent)

Read the full file on GitHub · 53 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. 2d ago First seen · 53 lines · 51 tokens per session scan A cc78ccdfde4f

Subscribe to this mod's changes

cockroachdb-dba is an agent published in the GitHub repository cockroachdb/claude-plugin (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 51 tokens to every session and 676 once invoked, about $0.0003 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

crdb-issue-finder

Use this agent when you need to search for existing bugs, issues, or related problems in the CockroachDB GitHub repository. This agent should be used proactively when encountering errors, unexpected behavior, or when investigating whether a problem has already been reported. The agent casts a wide net to find…

cockroachdb/cockroach · 0 tokens

crdb-metric-reviewer

Reviews CockroachDB code changes for metric hygiene: static label opportunities, naming conventions, and correct use of the labeling API. Use when a diff adds or modifies metric.Metadata definitions.

cockroachdb/cockroach · 43 tokens

crdb-error-reviewer

Reviews CockroachDB code changes for error handling quality, silent failures, and inappropriate fallback behavior. Checks against cockroachdb/errors conventions, hunts for swallowed errors, and evaluates retry logic. Use when reviewing any code change that touches error paths.

cockroachdb/cockroach · 54 tokens

crdb-commit-reviewer

Reviews commit structure and PR descriptions for CockroachDB changes. Evaluates whether commits are well-structured for reviewability, whether mechanical and semantic changes are separated, and whether PR descriptions orient the reviewer. Use when reviewing a branch or PR with commits.

cockroachdb/cockroach · 57 tokens

crdb-conventions-reviewer

Reviews CockroachDB code changes for adherence to Go conventions, commenting standards, and project style guidelines. Checks against the rules in .claude/rules/. Use when reviewing any code change.

cockroachdb/cockroach · 45 tokens

crdb-test-reviewer

Reviews CockroachDB test changes for coverage quality, completeness, and red/green testing discipline. Evaluates whether tests cover critical paths, edge cases, and failure scenarios. Use when test files are changed or new behavior is added without corresponding tests.

cockroachdb/cockroach · 55 tokens