The data standard that makes your AI coding agent better at data work.
AI agents write data code that runs without errors. That doesn't mean the numbers are right. TrueQuery holds the agent to your team's definitions, checks its work with plain code, and tells you exactly what it checked and what it didn't.
One tool for every coding agent: Claude Code and Muse Code today, with the full skill; Cursor, VS Code with GitHub Copilot, Codex and Antigravity through MCP, in early access; the full skill there next. The checker runs anywhere: any terminal, any CI, any agent. Install for your agent → · Read the docs →
New:
truequery verify --query
runs the agent's query read-only and checks the result: a join that
counts rows twice, duplicate or empty results, all-NULL columns, a
filter value no row holds, a column that's never filled, and
(with --metric) the number your metrics/ defines. The agent fixes
what it finds, up to three tries. verify --reconcile compares two
queries or tables.pip install "truequery[postgres]". A role
check on every connect refuses a role that can write; init --from-db drafts contracts from the catalog.
Databases →truequery mcp gives
Claude Code, Cursor, VS Code with GitHub Copilot, Codex and Antigravity
eight read-only tools: the checker, the receipt, your data and database
checks. Set it up →Someone at an online shop asks their agent: "how much money did we make last month?" Same agent (Claude Code), same model, same data, two real runs:
| Without TrueQuery | With TrueQuery |
|---|---|
| "March 2025 revenue was $9,452.79, from 21 orders." | "The most recent full month in the data is March 2025: $8,862.88 in revenue from 20 orders." |
| Wrong. It caught the deleted accounts, but the warehouse cuts days in Los Angeles time while the shop counts days in UTC, so orders landed in the wrong month. The answer gives no hint of it. | Right, matching the answer key written before either run. It also warned that the shop's own revenue report is about $3,000 too high, and why. |
Both answers read well, and the agent without TrueQuery even caught one trap. It missed the one hidden in the build script. Here's how TrueQuery got it right.
1. It learned the shop's definitions first. When the project was set up,
/truequery init read the code and the data, then asked a few questions:
what counts as revenue, which accounts are tests, how money is stored, which
date an order belongs to. It wrote the answers into DATA.md, including a
trap it found on the way (excerpt, trimmed):
- **Business date**: order day = `ordered_at` truncated to the **UTC** day.
1. **Timezone**: `build_marts.py` sets `TimeZone='America/Los_Angeles'` [...]
872 of 2,571 orders (34%) land on the wrong day.
2. It follows those definitions on every request, whoever asks and however vaguely. Nobody is asked the same question twice. If a request contradicts a definition (say, averaging a column that's stored in cents), it says so before writing anything, follows the definition unless you confirm otherwise, and records the decision.
3. It checks the SQL with plain code as it's written. The time-zone trap was caught by the definitions. The checker catches a different kind of mistake: SQL that runs without errors and still returns the wrong answer. It looks for 41 kinds of it (21 in SQL, 4 in dbt and orchestration, 7 in pandas code, 9 that read your contracts), offline and with no AI involved, while the agent works:
-- Customers who never ordered
SELECT id FROM customers
WHERE id NOT IN (SELECT customer_id FROM orders);
samples/bad_orders.sql:13:7 [error] sql/not-in-nullable-subquery — a NULL in the subquery makes NOT IN return zero rows
fix: rewrite as NOT EXISTS, or add WHERE col IS NOT NULL
One order with no customer, and the query returns no one, even though some customers never ordered.
4. It ends with a receipt. Every task says what was checked, what was found and, just as plainly, what wasn't checked. On the full sample file:
TrueQuery receipt
Checked 1 SQL file · contracts for 0 of 3 tables
Found 5 errors · 2 warnings
Not checked your data: no contract points at a local data file or a database table, so none was read (BigQuery and Snowflake: not yet)
No contract customers, orders, staging_orders
In an answer for a person, it says the same thing in plain words. From the revenue answer above:
These are from my own queries against
warehouse.duckdb. The TrueQuery checker only inspects code, so it didn't check these figures.
Ask in your own words; TrueQuery picks up the task. A few examples:
Verify the plugin end to end on Windows
https://github.com/Analytically-ai/truequery/issues/12
Labels: help wanted
Verify the Codex hook live
https://github.com/Analytically-ai/truequery/issues/9
Labels: good first issue, help wanted
Preview testers: tell us what it got wrong
https://github.com/Analytically-ai/truequery/issues/8
Labels: 없음
Please read our Code of Conduct. Be kind, assume good faith, and keep every space you'd want to ask a question in welcoming.
git clone https://github.com/Analytically-ai/truequery.git && cd truequery
uv venv && uv pip install -e "plugin/engine[test]"
.venv/bin/python -m pytest
next. That's where work lands.
Branch from next too: git checkout -b my-fix origin/next.main holds released code only. The plugin marketplace and this
README read main, so users never get unreleased work. main moves only
at a release, when next is merged into it.main by mistake? No need to redo anything: we'll
change its base to next.next..claude-plugin/ the marketplace manifest (points Claude Code at plugin/)
plugin/ the installable plugin: the only folder users get
skills/truequery/ the skill: SKILL.md, flow.md, commands/, generated references
hooks/, scripts/ hook config and the shim that runs the matching checker
engine/ the checker (Python package)
tests/ the test suite
tools/ generators for the registry and the skill references
samples/, examples/ demo SQL and the demo shop
docs/ guides
.github/ CI: tests on Linux, macOS and Windows on every pull request
and every push to main or next
sql/accidental-cross-join).standard/, run
python tools/generate_registry.py and python tools/generate_skill.py.
CI fails if the generated files are stale.Releases follow RELEASING.md.