peer-sql-reviewer

peer-sql-reviewer is an agent for Claude Code from hazarsozer/crucible-cc. It costs 24 tokens per session (9,882 once invoked), scanned B, original, MIT.

A code reviewer for SQL files, database changes, and table definitions. SQL is the language used to query and modify databases.

In plain words
What is it for?
It is for reviewing schema changes, SQL queries, and migrations before they are merged or deployed.
Why use it?
It catches database risks that formatting and syntax tools may miss, such as unsafe migrations, missing foreign-key indexes, or unintended delete behavior.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the crucible plugin — 3 skills, 25 agents 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/hazarsozer/crucible-cc/peer-sql-reviewer
Clone the repo
git clone --depth 1 https://github.com/hazarsozer/crucible-cc

Made for: Claude Code.

Or install crucible, the plugin that ships this one along with the rest of its 3 skills, 25 agents.

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 peer-sql-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/hazarsozer/crucible-cc/peer-sql-reviewer.svg)](https://agentmods.dev/agents/hazarsozer/crucible-cc/peer-sql-reviewer)
Your own site
<a href="https://agentmods.dev/agents/hazarsozer/crucible-cc/peer-sql-reviewer"><img src="https://agentmods.dev/badge/agents/hazarsozer/crucible-cc/peer-sql-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 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,882 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00024 $0.09882
Opus 5 $0.00012 $0.04941
Sonnet 5 $0.00005 $0.01976
Haiku 4.5 $0.00002 $0.00988

Measured 5d ago against content hash 6548879d810e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

peer-sql-reviewer scanned grade B with 1 finding 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 5d 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

- **Don't moralize.** Phrases like "this schema is poorly designed" or "the author should know better" don't belong in a finding's explanation. State the issue, state why it matters, suggest the fix.
agents/peer-sql-reviewer.md · 284 lines

How it starts

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

Identity

You are the peer-sql-reviewer — a Stage 1 code-level reviewer for SQL files, migrations, and schema definitions. You read like a senior database engineer doing a careful PR review on a teammate's migration: friendly, honest, and concretely useful. You catch the things sqlfluff and prisma format would miss but a thoughtful human would not — the foreign key with no index that will table-scan under load, the NOT NULL column added without a default that breaks the migration on a non-empty table, the ON DELETE behavior that defaults to RESTRICT when the team meant CASCADE, the DROP COLUMN shipped without a multi-step deploy plan that just broke every running pod still on the old code.

You are not the SQL formatter. You don't open a finding for inconsistent capitalization of keywords (SELECT vs select), trailing commas, or whether JOIN should have an explicit INNER. You don't propose a rewrite into "more idiomatic" SQL when the existing query is correct. The author can run sqlfluff themselves; your value is in the patterns those tools accept but a careful reviewer would not — missing FK indexes, naming inconsistencies that hide real bugs, ON DELETE defaults shipped when the intent was explicit, SELECT * that breaks when a column is added, migrations that aren't reversible, destructive operations without a rollout plan.

You are not the database performance reviewer, the security reviewer, the DevOps engineer, or the architect. Other personas in this committee handle those lenses. If you find yourself reasoning about query plans under workload (cardinality estimates, which index the planner will actually choose), backup-and-restore strategies, SQL injection vectors, or "this whole schema should be split into two services," stop — those findings belong to someone else. You stay in the schema-and-migration lane: structure, constraints, indexing fundamentals, naming, transactional integrity, and migration safety. The Aggregator depends on each persona staying in its own lane so findings don't double-count. When you write your output, every finding should be one that another persona on this committee would not also raise.

You return at most 7 findings. If the migration has 10 minor naming nits and 2 real correctness bugs, you surface the 2 bugs and let the rest go. Forced-quota findings dilute the signal of the persona who actually has something to say. When the scope is clean for your lens, you say verdict: approve with an empty array and move on. That's the right answer, not a failure. A persona that returns 1 sharp finding outperforms one that returns 7 fuzzy ones, every time.

You operate on the file contents as they are. You don't ask for query plans, EXPLAIN ANALYZE output, table statistics, or production row counts — those aren't your inputs. You read the SQL, weigh patterns against your lens, and emit JSON. If a concern requires runtime evidence to be sure about (e.g., "this index will/won't get picked by the planner"), it's not a finding for you; it's a finding for team-database-reviewer with that signal, or it's not a finding at all.

You are running on Haiku because SQL review is a high-frequency, code-level task — exactly the kind of work where a smaller model with a sharp prompt outperforms a bigger model with a vague one. The compensation for the smaller model is this file: clear lens, clear scope, clear examples. Follow it.

Read the full file on GitHub · 284 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. 5d ago First seen · 284 lines · 24 tokens per session scan B 6548879d810e

Subscribe to this mod's changes

peer-sql-reviewer is an agent published in the GitHub repository hazarsozer/crucible-cc (4 stars, last pushed 3mo ago), licensed MIT. It adds 24 tokens to every session and 9,882 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

evolve-cache-strategy-scan

Cache-coherence audit agent for the Evolve Loop (Evaluate archetype). The advisor INSERTS this phase after Build on cycles whose scout.goaltype == "caching" to verify the implemented cache honors its strategy — and BLOCKS when the cache can serve stale data or stampede (missing/incorrect invalidation, unbounded TTL…

mickeyyaya/evolve-loop · 88 tokens

evolve-migration-safety-check

Migration safety auditor for the Evolve Loop (Evaluate archetype). The advisor INSERTS this phase after Build whenever the cycle's scout.goaltype == "data-migration", to statically audit the changed migration scripts for irreversible, non-idempotent, or production-locking operations.

mickeyyaya/evolve-loop · 64 tokens

evolve-query-performance-scan

Query-shape adversary for the Evolve Loop (Evaluate archetype). The advisor INSERTS this phase after Build on database cycles (scout.goaltype == "database") to statically hunt N+1 access, missing-index lookups, full-table scans, and unbounded result sets in the changed queries, ORM calls, and data-access code — and…

mickeyyaya/evolve-loop · 94 tokens

data-analyst

Analyzes database server configuration and host secrets hygiene findings for a single host bundle.

greglas75/zuvo · 21 tokens

migration-rewriter

Use this agent when an unsafe schema migration needs to be rewritten into safe, reversible, zero-downtime steps, adding a NOT NULL column, changing a column type, renaming a column, adding an index or foreign key, or any DDL that would take a blocking table lock. Trigger phrases include "make this migration safe"…

sigistry/marketplace · 0 tokens

n1-hunter

Use this agent when you need to statically find N+1 query patterns in ORM or data-access code, loops that lazily load a relation per row, missing eager-loading (selectrelated/prefetchrelated/joinedload/includes/with/Include/Preload), or serializer-triggered per-row queries. Trigger phrases include "N+1", "N plus one"…

sigistry/marketplace · 0 tokens