sql-review

sql-review is an agent for Claude Code from bdfinst/agentic-dev-team. It costs 29 tokens per session (1,579 once invoked), scanned A, original, MIT.

A focused reviewer for SQL, the language used to read and change database data. It looks for query and migration patterns that can become incorrect or unsafe when schemas or data change.

In plain words
What is it for?
Use it during code review when a change contains SQL, especially to inspect queries, inserts, indexes, and schema migrations.
Why use it?
It catches positional inserts, predicates that prevent indexes from being used, and migrations that can fail or destroy data.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dev-team plugin — 102 skills, 56 agents, 4 hooks shipped together

Good fit Use it during code review when a change contains SQL, especially to inspect queries, inserts, indexes, and schema migrations.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add bdfinst/agentic-dev-team
Claude Code
/plugin install dev-team

Made for: Claude Code.

Or install dev-team, the plugin that ships this one along with the rest of its 102 skills, 56 agents, 4 hooks.

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 sql-review

README.md
[![agentmods](https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/sql-review/github.svg)](https://agentmods.dev/agents/bdfinst/agentic-dev-team/sql-review)
Your own site
<a href="https://agentmods.dev/agents/bdfinst/agentic-dev-team/sql-review"><img src="https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/sql-review/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 sql-review

Your own site · 80×15
<a href="https://agentmods.dev/agents/bdfinst/agentic-dev-team/sql-review"><img src="https://agentmods.dev/badge/agents/bdfinst/agentic-dev-team/sql-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,579 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.00029 $0.01579
Opus 5.5 $0.00012 $0.00632
Sonnet 5.5 $0.00006 $0.00316
Haiku 4.5 $0.00003 $0.00158

Measured 16d ago against content hash f26e4d0c34f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-review 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 16d 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.

plugins/dev-team/agents/sql-review.md · 128 lines

How it starts

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

Implemented by: ${CLAUDE_PLUGIN_ROOT}/scripts/sql_anti_patterns.py

SQL Review

Scope: on-demand Cites: [adversarial-review-protocol]

/code-review Step 3 dispatches this agent only when the detector gate reports SQL present in the changeset. select_lenses.py never selects it: the Scope: on-demand declaration above keeps it out of the per-diff roster, and the detector gate decides dispatch instead.

Output JSON: per ${CLAUDE_PLUGIN_ROOT}/knowledge/review-agent-output-contract.md (Whole-file load: short, canonical schema).

Status: pass=no SQL anti-patterns, warn=brittle SQL that works today, fail=SQL that is wrong or destroys data Severity: the catalog severity of the rule, unchanged: error=wrong or destructive today, warning=brittle under ordinary change, suggestion=works, safer form exists Confidence: high=detector hit confirmed in context; medium=judgment rule with clear evidence; none=requires human judgment

Context needs: full-file

Skip

Return {"status": "skip", "issues": [], "summary": "No SQL in target"} when the target has no .sql file and no SQL-shaped string literal.

Input

The caller passes the detector hits for the target files. Each hit has file, line, rule, dialect, origin, severity, message, fix, and text. The caller also passes errors (files the detector could not read) and skipped_fragments (concatenated or interpolated literals the detector did not scan). Open the file with Read and judge each hit in context.

Detect

The catalog is the only source of rules: ${CLAUDE_PLUGIN_ROOT}/knowledge/sql-anti-patterns/ (Whole-file load: read README.md first, then the family files that match the hits and the target SQL). Each rule has an id, family, dialect, owner, severity, and a bad/good example.

  • Script-owned rules. Confirm or dismiss each detector hit. Dismiss a hit when the statement is not what the rule describes. Name the reason in summary for each dismissed hit. Keep the rule's message and suggestedFix from the hit. Do not report a rule the detector did not hit unless the catalog marks it agent-owned.
  • sql.schema.select-star triage. The detector hits every SELECT *. Keep a hit when the caller reads the rows by position (row index, tuple unpacking, positional binding) or the star defines a view. Dismiss a hit when the consumer reads named columns only, and name that consumer in summary. When the consumer is not visible, keep the hit.
  • Agent-owned rules. Find these yourself. They need judgment that a tokenizer cannot give. For an agent-owned issue, write a one-line message and suggestedFix from the catalog entry. The current ones:
    • sql.ddl.type-narrowing: read the CREATE TABLE or earlier migration for the column, and report only a change to a narrower type. Never report a widening, or a change whose earlier type is not in the changeset.
    • sql.correctness.distinct-masks-join: a DISTINCT over a join that repeats rows.
    • sql.index.implicit-conversion: a character column compared to a number. Report it only when the column type is in the changeset.
  • Triage sql.correctness.not-in-subquery. The detector cannot see nullability. Find the CREATE TABLE for the subquery column in the changeset. Keep the hit when the column is nullable (for example t_id int NULL) or its definition is not in the changeset. Dismiss it when the column is NOT NULL, and name the reason in summary.
  • Dialect. Each hit's dialect is the rule's tag. Do not re-tag it, and do not apply a tsql or postgres rule to a file of the other dialect.
  • Triage sql.ddl.index-not-concurrent. Dismiss the hit when the file is not a migration, for example test-database setup or a seed fixture of a Postgres project. Report it in a migration file. Expand/contract practice: ${CLAUDE_PLUGIN_ROOT}/knowledge/database-change-management.md (Whole-file load: read only when a DDL hit needs the practice).
  • Unreadable files. For each entry in errors, name the file in summary. Never add an issue for it: every issue needs a catalog rule id.
  • Skipped fragments. For each entry in skipped_fragments, name the file and count in summary. Never add an issue for it. Report pass when no catalog rule applies to the SQL the detector scanned.

Read the full file on GitHub · 128 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. 16d ago Changed f26e4d0c34f8
  2. 25d ago First seen · 128 lines · 29 tokens per session scan A e35f200f8ba4

Subscribe to this mod's changes

sql-review is an agent published in the GitHub repository bdfinst/agentic-dev-team (312 stars, last pushed today), licensed MIT. It adds 29 tokens to every session and 1,579 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-11-07.

Related

sql-review compared with agents from other repositories

sql-review next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sql-reviewbdfinst/agentic-dev-teamAgent312todayMITA29Claude Code
review-triagerprisma/ormAgent48ktodayApache-2.0A0Claude Code
review-implementerprisma/ormAgent48ktodayApache-2.0A44Claude Code
core-data-auditorCharlesWiltgen/AxiomAgent1.3ktodayMITA28Claude Code
data-engineertestdouble/hanAgent363todayMITA216Claude Code
nw-data-engineer-reviewernWave-ai/nWaveAgent63713d agoMITA29Claude Code
ring:backend-tsLerianStudio/ringAgent2181mo agoApache-2.0A43Claude Code, Cursor