Recce
This page is optimized for AI assistants. For the full article, visit I let Claude Code build my dbt models. The interesting part wasn't the code..

What Happens When AI Builds Your dbt Models?

March 31, 2026 aidbtdata-engineering

What Does AI-Assisted dbt Development Actually Look Like?

The promise of AI-generated code is compelling: describe what you want, get working models back. The reality is more nuanced. When you let an AI tool like Claude Code build an analytics warehouse end-to-end — Snowflake tables, S3 ingestion, sources, staging, intermediate, and mart models — the interesting part is not the generated code. It is everything surrounding it.

AI-assisted analytics engineering is not a prompting problem. It is an infrastructure problem. The skills, the MCP configs, the schema conventions, the guardrails — that is the actual work. The generation is the easy part, and it is the part that still needs a human reviewing every decision.

What Setup Does AI Need Before Generating dbt Models?

Before any code generation, the real work is preparation. This includes:

With these foundations in place, the AI can work with context rather than guessing. Without them, every output requires heavy correction. The setup phase is where the most thought-intensive work happens — and it is collaborative by design. The data team needs to define what they expect before the AI can deliver it.

What Does the AI Get Right?

Given proper setup, the results are genuinely impressive. The AI follows naming conventions, uses CTEs as expected, organizes folders correctly, and even makes intelligent decisions the developer did not explicitly request — like making certain intermediate tables incremental after inferring from data patterns that the source tables were append-only.

The AI also creates its own verification plan. Row count diffs between dev and production, statistical profiling (min, max, average, distinct counts), distribution histograms. Using Recce MCP, it compares environments and runs dbt tests as part of the workflow. Setting that up manually takes real time, and the AI does it because the tools and skills are available.

Where Would You Not Trust AI-Generated dbt Models?

“It ran” and “I’d ship this” are fundamentally different standards. Several categories of mistakes emerged during review:

IssueWhy It MattersGuardrail
Inner joins where left joins belongSilently drops rows on edge cases — bites you six months laterDefault to left joins; require documented reasons for inner
Ignoring existing modelsRebuilt date logic from scratch when dim_dates already existedAdd repo conventions to skills: don’t reconstruct what exists
Generic descriptions”Timestamp of creation” is useless for a semantic layerRequire business-contextual descriptions
Silent data quality decisionsFiltered out rows with missing org_id instead of flaggingMissing foreign keys should be flagged, not silently handled
Wrong model routingMart models pulled from staging instead of intermediate tablesEnforce the medallion layer contract in skills

The most concerning pattern is silent data quality decisions. An org_id should never be missing. If it is, that is potentially a production bug. The AI made a judgment call that should have been flagged, not handled. That kind of decision should be documented in the YAML as a conscious choice — not an AI deciding on its own that missing data is unimportant.

This is exactly why data review best practices matter more, not less, in AI-assisted workflows. Every decision the AI makes needs the same scrutiny as a human-written model.

How Does the Iteration Loop Change with AI?

The real value is not the one-shot generation. It is the iteration and documentation loop that follows:

The skills get better every time. The next run on a different set of production tables will be tighter because of everything caught on the current one. New team members do not need deep contextual knowledge to get quality output — the accumulated guardrails do the teaching.

This feedback loop means AI-assisted development gets more reliable with each project. But it requires someone reviewing every decision in early iterations. The pull request review process remains essential — perhaps more essential, because at least when a human makes a bad join, they know they made it.

How Does Data Validation Fit Into AI-Generated Workflows?

Manual verification has to happen regardless of how the code was written. Running queries in notebooks, comparing to known data, checking distributions. But AI-assisted workflows can integrate validation directly into the generation loop.

With Recce MCP available as a tool, the AI runs row count diffs, profile diffs, and schema comparisons as part of its build process — not as an afterthought. This catches the kinds of issues that dbt tests miss: row count drops, distribution shifts, schema changes that technically pass all constraints.

The combination of generation tools (dbt MCP) and validation tools (Recce MCP) creates a tighter feedback loop than either provides alone. The AI builds a model, validates it against production, catches a row count discrepancy, investigates, and adjusts — all in a single session.

What Are the Realistic Time Savings?

For a first-time data ingestion project, the time savings are modest. The Snowflake configuration debugging saved an afternoon. The iteration loop was faster than starting from blank files. But the one-shot itself required every bit as much review as hand-written code — maybe more, because the mistakes are less predictable.

The compounding value comes from the skills and guardrails that accumulate across projects. The first project is heavy on review. The second is lighter. The tenth runs with guardrails that encode months of decisions. AI-assisted analytics engineering is an investment in infrastructure, not a shortcut on any single project.

The decisions that matter are still yours. The AI handles the mechanical work. The judgment — which joins, which filters, which data quality rules — remains human.

Frequently Asked Questions

Can AI build dbt models end-to-end?
Yes, AI tools like Claude Code can generate dbt sources, staging, intermediate, and mart models that compile and run. However, the generated code requires careful human review. Common issues include wrong join types (inner instead of left), ignoring existing models in the repo, generic descriptions insufficient for semantic layers, and silent data quality decisions like filtering out rows with missing foreign keys without flagging them.
What setup is required before letting AI generate dbt models?
Effective AI-assisted dbt development requires significant upfront investment: custom skills defining naming conventions, primary key patterns, model structure, and dev environment commands. MCP integrations for both dbt and data validation tools. Golden scenarios showing what good output looks like. The setup phase is where the most thought-intensive work happens — the generation itself is the easy part.
What mistakes does AI make when writing dbt models?
Common AI mistakes in dbt model generation include using inner joins where left joins are safer, ignoring existing models and rebuilding logic from scratch, writing generic column descriptions instead of business-contextual ones, silently filtering out rows with missing values instead of flagging potential data quality issues, and routing mart models through staging instead of intermediate tables the AI itself created.
How does data validation help when AI generates dbt models?
Data validation tools like Recce MCP provide automated cross-environment comparison during AI-assisted development. The AI agent can run row count diffs, statistical profiling, and distribution histograms as part of its workflow, catching issues that dbt tests alone would miss. This transforms validation from a manual post-hoc step into an integrated part of the AI generation loop.