Data & Analytics Subagents for Claude Code

Put Claude Code to work on SQL, dbt and analysis without letting it drop a schema or delete every row.

Data & Analytics Subagents for Claude Code product illustration

What it is

Ten Claude Code subagents for analysts, analytics engineers and data teams, plus a SQL guard hook. The hook stops Claude from running DROP SCHEMA, DELETE FROM orders with no WHERE, or dbt build --full-refresh against production without asking. Reviewers are read-only; the writers only touch documentation.

SubagentUse it forTools
sql-reviewercorrectness before a query runs or merges: grain, join fan-out, NULL traps, date boundaries, unsafe writesread-only + Bash
query-optimizerslow or expensive queries: EXPLAIN plans, partition pruning, fan-out joins, index suggestionsread-only + Bash
dbt-model-reviewerdbt PRs: layering, keys and tests, incremental logic, downstream impact, costread-only + Bash
data-quality-investigator"the numbers look wrong": bisects the pipeline to where the data went badread-only + Bash
metric-definerprecise KPI definitions with reference SQL; finds conflicting definitions across dashboards and modelswrites metric docs
dashboard-reviewermisleading charts, inconsistent metrics, missing filters and context, slow tilesread-only + Bash
experiment-analystA/B tests: sample ratio mismatch, intervals, peeking, multiple comparisons, guardrails, sample sizeread-only + Bash
data-dictionary-writertable and column docs or dbt YAML descriptions from schema and profiles; flags likely personal datawrites docs
notebook-reviewerJupyter and scripts: hidden state, leakage, silent dropna/merge traps, unsupported conclusionsread-only + Bash
pipeline-debuggerfailed Airflow/Dagster/Prefect/dbt/sync runs: root cause, blast radius, safe re-run planread-only + Bash

No overlap with our general Claude Code Subagents Pack or the DevOps & SRE Subagents.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 8 tests OK on Python 3.13 and 3.10.

Real terminal output from Data & Analytics Subagents for Claude Code: demo and passing tests

Install

  • As a plugin (agents + SQL guard): claude --plugin-dir ./data-analytics-subagents to try it, or add the folder to a plugin marketplace. Agents appear as data-analytics-subagents:sql-reviewer.
  • Agents only: python3 tools/install_agents.py ~/code/analytics (project) or python3 tools/install_agents.py --user --only sql-reviewer,experiment-analyst.

Then: "Use the sql-reviewer subagent on models/marts/revenue.sql" or "@data-quality-investigator weekly active users dropped 18% on Monday".

SQL guard hook

A PreToolUse hook on Bash (hooks/sql_guard.py). It reads SQL passed to psql -c/-f, mysql -e, sqlite3, duckdb -c/-f, bq query, snowsql -q/-f, clickhouse-client --query, sqlcmd -Q/-i, trino --execute/-f and cockroach sql -e, including several statements in one string, && chains and bash -c. Comments and string literals are ignored.

  • deny: DROP DATABASE, DROP SCHEMA, DELETE or UPDATE with no WHERE (or WHERE 1=1 / WHERE true).
  • ask: DROP TABLE/VIEW, TRUNCATE, ALTER, GRANT/REVOKE, DELETE/UPDATE with a WHERE, MERGE, INSERT OVERWRITE, CREATE OR REPLACE TABLE, dbt run|build|seed|snapshot --full-refresh, dbt against a prod/production/prd target, dbt run-operation.
  • bq query --dry_run and plain SELECTs pass through.

Settings: SQL_GUARD=off or SQL_GUARD=deny, or .claude/sql-guard.json: {"mode": "ask", "prod_targets": ["prod", "live"]}. Claude Code ignores hooks inside plugin agent files, so the guard is a plugin-level hook that applies while the plugin is enabled.

Tools

  • tools/sql_risk.py FILE.sql: static check that classifies each statement (block / confirm / write / read) and flags = NULL, NOT IN (SELECT ...), comma joins and SELECT *. Exit 1 if a block-level statement is found, so it works as a pre-commit or CI check on migration and cleanup scripts. The sql-reviewer uses it.
  • tools/lint_agents.py and tools/install_agents.py: check and install the agent files.

./demo.sh runs the linter, sql_risk.py on examples/cleanup.sql (10 statements: 3 block, 4 confirm, 4 lint findings) and the guard. ./run_tests.sh runs the tests.

Honest limits

  • The guard checks SQL it can see in the command line or in a -f file. SQL built inside a Python script, or sent through an MCP database tool, isn't seen. Keep database users least-privilege, and give Claude a read-only role.
  • Review aids, not a substitute for code review or data governance.

Format and license

Zip, 30 KB, v1.0, 22 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by Anthropic or dbt Labs.

FAQ

Will Claude change my data?
The reviewers are read-only, and the SQL guard asks or blocks before destructive statements sent through database CLIs.
Which warehouses?
Postgres, MySQL, SQLite, DuckDB, BigQuery, Snowflake, ClickHouse, SQL Server, Trino and CockroachDB CLIs, plus dbt.
Does it work without the plugin?
Yes, install the agents into .claude/agents with the included installer.
How do I get the files?
Right after payment, Stripe’s confirmation page shows your download link.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get Data & Analytics Subagents for Claude Code

10 Claude Code subagents for data teams: SQL and dbt review, query tuning, data quality, metrics, A/B tests. SQL guard blocks DROP and unfiltered DELETE. $19.

Save with a bundle

Pairs well with

Download$29

Docs Search MCP Server

MCP server for your own docs: Markdown, MDX, RST, HTML and llms.txt, searched by section with citations. Read-only, offline, no API keys. Claude, Cursor.

View Docs Search MCP Server
Download$19

Claude Code Safety Hooks

Tested Claude Code hooks as a plugin: block rm -rf and force-push to main, protect .env and lockfiles, catch API keys in files, audit log. $19 once.

View Claude Code Safety Hooks
DownloadFree

Claude Code Hooks Starter (Free)

Free Claude Code hooks examples: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification and Stop, plus a local tester that checks your hook's output.

View Claude Code Hooks Starter (Free)

Related