How to Leverage Claude for Data Analysis
A deep dive into the 3 things you must have in your dbt project to do so
Last week, Claude Code planned and executed an entire data analysis case study for me, and I didn’t need to give it access to any of my data.
Our sales team has been looking for data on how well our product features correlate to different outcomes, such as revenue, return on ad spend (ROAS), and average order value. Their hypothesis stated that the greater the number of product reviews, the better the sales. I needed to provide the data to back this up.
I dumped all of my thoughts into Claude Code, asking it to summarize what I was looking for. I then used this to have it create me a step-by-step plan to perform this analysis using the models in my dbt project.
One by one, it provided me with a query that I ran in Snowflake, validating the results or giving it feedback on what didn’t work.
There were only a small number of things that went wrong, and when they did, they were easy fixes.
This goes to show the power of having a dbt project with foundational data models and well-documented code. Claude was able to problem-solve any issues by simply using the code that was already written.
In this article, I’ll walk you through the exact prompts I used to get an entire analytics case study in under an hour. I’ll also share the knitty-gritty details of why Claude was able to do this so well, including what makes a data model easy for AI to use and the most important types of documentation when using agents.


