Query Guard — Data skill for Claude Code
Stops risky SQL and dbt commands in Bash and asks you before they run.
How to install Query Guard
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open geethasagarb/query-guard and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Query Guard does
Stops risky SQL and dbt commands in Bash and asks you before they run. A Claude Code mod.
Alternatives in Data
- Query Token Info — Search tokens and fetch metadata, real-time market data, and K-Line candlestick charts by keyword or contract 483 ★
- Database Query 337 ★
- Dbt Migration — Migrate SQL projects to dbt 276 ★
README
Query Guard
[](https://github.com/geethasagarb/query-guard/actions/workflows/test.yml)
Query Guard is a Claude Code mod. It stops risky database commands and asks you before they run.

Illustrated demo of Query Guard
I built this because one bad `DELETE` can wipe a table. I let Claude run database commands for me, and I wanted a pause before the ones I can't undo.
Why it exists
Coding agents run shell commands. Database clients are shell commands too. Claude can type `DELETE FROM customers` and forget the `WHERE`. It can also point `psql` at the wrong host. Either mistake can destroy data in a second. It has already happened: in [this reported incident](https://claudeissues.com/issue/13325-claude-opus-4-5-executed-destructive-sql-update-deleting-55-000-records-without), Claude ran an `UPDATE` through a Supabase MCP tool that cleared fields on about 55,000 rows, with no backup to restore from. That route is exactly what v0.2 aims to cover.
Claude Code already shows you each command before it runs. But a long command is easy to skim. After many approvals, you stop reading closely.
Query Guard reads each database command first. If the command looks destructive, Query Guard holds it. If it points at production, Query Guard holds it too. Then it shows you the target and the current row count. The command waits until you choose.
What it catches
Query Guard checks Bash commands that run `sqlite3`, `psql`, `mysql`, `snowsql`, the `databricks` CLI, or `dbt`.
| Rule | Example that Query Guard holds |
|---|---|
DROP TABLE, DROP DATABASE, DROP SCHEMA |
psql -c "DROP TABLE users" |
TRUNCATE |
snowsql -q "TRUNCATE TABLE orders" |
DELETE without WHERE |
sqlite3 demo.db "DELETE FROM customers" |
UPDATE without WHERE |
mysql -e "UPDATE users SET active = 0" |
Related Skills
Looselips Guard
Stops your coding agent publishing your data to the world — a PreToolUse egress guard for Claude Code and othe
Snowflake Safe Query Skill
Write and run read-only Snowflake queries against the Gaiia reporting database under a four-layer safety guard
Claude Guard Hook
A global Claude Code hook that intercepts sensitive data before it reaches the LLM — secrets, API keys, PII, a
Create Hook Dtd
Invoke create-hooks-dtd for a hook whose payload is data and whose guard is tripped before it ships
Jev Hook Guard
What a Claude Code hook must do before it sends text to an external judgment API: mask secrets and personal da
Query Tcga
Query TCGA/GDC for projects, mutations, or clinical data. Use when the user asks for TCGA cohorts, mutation co
Related Agents
Data Eng Reviewer
Data-engineering expert for the code-review panel. Spawned when the diff touches SQL, dbt models or schema .ym
Mod Builder
Creates and changes Claude Code mods — plugins of function hooks behind a pane, band, status line, slash comma
Secret Guard
MUST be used whenever the user asks to scan for secrets, API keys, credentials, or tokens before a commit or i