Claude Code + Rig
The easiest way to query your warehouse data in Claude Code
Claude Code is Anthropic's agentic coding tool that runs in the terminal and IDE and connects to external tools and data over MCP.
What Rig gives Claude Code
Once connected, Claude Code can reason over your governed data through Rig:
- Warehouse tables and views
- Metric definitions
- Join paths
- dbt lineage
- Role-based access
- Sandbox-validated SQL
How Claude Code connects to Rig
Add Rig as an MCP server in Claude Code. It can then query your warehouse with governed SQL while you build, so dashboards, scripts and analyses are grounded in real, validated data rather than made-up columns.
Vibe-code dashboards on real warehouse data
With Rig connected, Claude Code writes app and dashboard code against your actual schema and metric definitions. It pulls correct joins and real numbers as it builds, so the chart you get reflects the warehouse rather than placeholder data.
- Build a retention dashboard from our warehouse data
- Add a revenue-by-region chart using the official metric
- Wire this component to the live orders table
Investigate data straight from the terminal
Claude Code can answer ad-hoc data questions inline while you work, generating validated SQL through Rig. You stay in the terminal instead of switching to a SQL client to check a number.
- How many active accounts do we have right now?
- Show the schema and a sample of the events table
- Find the join path from users to subscriptions
Keep generated SQL safe and correct
Every query Claude Code runs through Rig is sandbox-validated and read-only, so an exploratory question never mutates production or runs an unbounded scan. Answers use your agreed metric definitions.
- Validate and run this query against the warehouse
- Recompute that with the official churn definition
- Limit the result and re-run it
Turn analysis into a committed workflow
Because Rig governs the data path, analyses you build in Claude Code can be promoted into repeatable workflows. The same context that answers a question can power a scheduled report or a downstream action.
- Turn this analysis into a scheduled weekly report
- Write a script that flags at-risk accounts nightly
- Document the metrics this dashboard uses
Frequently asked questions
- How do I connect Claude Code to my warehouse?
- Add Rig as an MCP server in Claude Code. Rig builds the context layer over your warehouse, and Claude Code can then query it with governed SQL.
- Can Claude Code build dashboards on live data?
- Yes. With Rig connected, Claude Code writes code against your real schema and metric definitions and pulls validated numbers as it builds.
- Is the data access read-only?
- Yes. Rig connects read-only and sandbox-validates each query, so generated SQL cannot mutate production data.
- Which warehouses are supported?
- Snowflake, BigQuery, Redshift, Postgres and DuckDB/MotherDuck, plus SaaS sources synced through Rig Ingest.
Related integrations
Connect your warehouse to Claude Code
Rig builds a governed context layer over your data so every team, and every AI tool, asks questions and gets answers they can trust.