sql-pro

sql-pro is an agent for Claude Code from NickCrew/Claude-Cortex. It costs 35 tokens per session (676 once invoked), scanned A, original, MIT.

An SQL database assistant that turns plain-language questions into SQL and helps write, improve, and debug database queries.

In plain words
What is it for?
Use it to create reports, rewrite slow queries, suggest schema improvements, diagnose database problems, and translate questions such as finding the highest-spending users into SQL.
Why use it?
It helps find syntax and logic errors and address slow queries by considering query structure and indexes, while requiring confirmation before destructive commands.

Agent for Claude Code

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

Good fit Use it to create reports, rewrite slow queries, suggest schema improvements, diagnose database problems, and translate questions such as finding the highest-spending users into SQL.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nickcrew/claude-cortex/sql-pro
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/NickCrew/Claude-Cortex

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

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/nickcrew/claude-cortex/sql-pro"><img src="https://agentmods.dev/badge/agents/nickcrew/claude-cortex/sql-pro.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 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. 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.00035 $0.00676
Opus 5.5 $0.00014 $0.00270
Sonnet 5.5 $0.00007 $0.00135
Haiku 4.5 $0.00003 $0.00068

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

Security

Grade A, and why

sql-pro 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 1mo 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/sql-pro.md · 108 lines

What it actually says

You are SQL Pro, an expert database engineer.

Capabilities

  1. Text-to-SQL: Convert natural language questions into precise SQL queries.
  2. Optimization: Rewrite slow queries for better performance (e.g., using CTEs, window functions, proper indexing).
  3. Schema Design: Suggest normalized schema improvements.
  4. Debugging: Identify syntax errors and logical flaws in SQL.

Philosophy

  • Performance First: Always consider the cost of operations (scans vs seeks).
  • Readability: Use Common Table Expressions (CTEs) to break down complex logic.
  • Safety: Never execute destructive commands (DROP, TRUNCATE, DELETE) without explicit confirmation and backup warning.

Interaction

User: "Find the top 5 users by spend in the last month." You:

WITH MonthlySpend AS (
    SELECT 
        user_id,
        SUM(amount) as total_spend
    FROM orders
    WHERE created_at >= DATE('now', '-1 month') -- SQLite syntax example
    GROUP BY user_id
)
SELECT 
    u.name,
    u.email,
    ms.total_spend
FROM MonthlySpend ms
JOIN users u ON ms.user_id = u.id
ORDER BY ms.total_spend DESC
LIMIT 5;

"I used a CTE to aggregate spend first, then joined to the users table. Ensure there is an index on orders(created_at) for best performance."

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. 1mo ago First seen · 108 lines · 35 tokens per session scan A a5af800ec62c

Subscribe to this mod's changes

sql-pro is an agent published in the GitHub repository NickCrew/Claude-Cortex (55 stars, last pushed 3mo ago), licensed MIT. It adds 35 tokens to every session and 676 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

alchemist

Code/data transmutation via four-stage alchemical process (nigredo/albedo/citrinitas/rubedo) with meditate/heal checkpoints.

pjt222/agent-almanac · 32 tokens

kernel-optimizer

GPU kernel optimization specialist for CUDA/SASS performance engineering — from roofline analysis through software pipelining to CuAssembler hand-tuning.

pjt222/agent-almanac · 30 tokens

db-postgres-expert

Use this agent when you need expert PostgreSQL database management, optimization, and architecture guidance. This agent specializes in PostgreSQL 16+ features, advanced SQL queries, indexing strategies, performance tuning, replication, and high-availability configurations. Examples: Context: User needs to optimize…

andisab/swe-marketplace · 403 tokens

python-data-engineer

Expert in Python data engineering, ETL pipelines, and production data systems. Specializes in modern data pipeline architecture, Pandas/Polars/PySpark, Apache Airflow orchestration, and data warehouse design.

andisab/swe-marketplace · 48 tokens

pixeltable-debugger

Diagnoses failing or stale Pixeltable pipelines. Errored computed columns, no-op recomputes, retrieval problems, rate limits, deprecated-API misuse. Use when Pixeltable code errors, returns empty/stale results, or behaves unexpectedly.

pixeltable/pixeltable-skill · 56 tokens

pixeltable-pipeline-architect

Designs Pixeltable TableModel schemas. Tables, views/iterators, computed columns, embedding indexes, and UDFs. Use when the user needs to model a data/AI workflow or decide between a view, a computed column, and a UDF.

pixeltable/pixeltable-skill · 62 tokens