Learn Analytics Engineering

Learn Analytics Engineering

How to Validate Data Models w/ Claude Code

6 prompts I used to catch my mistakes and write a data model that aligns with the business every time

Jul 30, 2026
∙ Paid

There’s nothing more exciting in an analytics engineer’s work than planning and building a data model from scratch. It’s one of the best parts of our jobs because we get to see something go from a hypothesis to an easily measured insight.

Stakeholders start by asking us a question, and we put all the puzzle pieces together to give them the right answer. How rewarding is that!?

However, with the highs also come the lows. And by lows, I mean the validation phase.

After you’ve spent all this time building a data model with the correct grain, baking in the right dimensions, and solving data quality issues in the source data, you need to validate that what you did works as expected.

I always find data validation to be the hardest step because we don’t know what we don’t know. How do you know what to test? If I knew what to look out for from the start, I would’ve built my code around exactly that!

Luckily, AI can see things we may have missed. It can call out our blind spots and reassert our expectations.

This is why using Claude Code for validating your data models can be so powerful. You have an automated, robotic way of checking your assumptions and ensuring your code works as expected.

In this article, I’ll walk you through exactly how I work with Claude Code to validate my data models, making the process seamless and, dare I even say, enjoyable.

Learn Analytics Engineering is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

The problem

With building a data model from scratch comes lots of exploration of the source data. It also involves asking stakeholders a lot of questions about the business process you are modeling.

Even with this extensive research, there are things that slip through the cracks. Inevitably, there will be something you failed to explore or consider. This is why validating the source data and our data modeling logic as we work on it is so important.

You don’t want to lose hours progressing on a project that isn’t going in the right direction.

However, we can only test the pitfalls that we are aware of. For example, I’m currently building out a model that attributes purchases to certain locations on the application. Stakeholders want to know what locations are responsible for the highest conversion rates.

I know I want to attribute the most recent click on a given product before the purchase was made to the location that click occurred on. However, there’s a lot of different expectations of how this logic needs to work, and who wants to be the one to write all of the queries testing this?

Claude Code prompts

User's avatar

Continue reading this post for free, courtesy of Madison Mae.

Or purchase a paid subscription.
© 2026 Madison Mae · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture