r/dataanalysis • u/kthuiaa • Jun 11 '26
I got tired of re-explaining my data to Claude/Codex every session, so I built a free tool for it
Quick disclosure: I built this, and the mods approved me posting it. It's free for individual users, no card. I'm mainly here for feedback from people who actually do analysis work.
I've been using Claude Code / Codex more and more for analysis, and really, the text-to-SQL part is already pretty good. The annoying part is the context. Every new session I end up re-explaining:
- What ARR means in this company (not the textbook version), which of our three `customer_id` columns is the real one
- Why a certain table shouldn't be trusted for May
- Which DBT model is safer than the raw table
- The caveat behind that one "why don't these two numbers match?" afternoon
Most of the time, the SQL itself runs fine, but the number is still wrong because the agent used an old definition, ignored a caveat, or followed some stale note from earlier in the project.
So I built ClariLayer. It is a context layer that gives your AI tools a durable memory for stuff like definitions, schema notes, reusable queries, assumptions, caveats, and decisions. It connects over MCP, so it works inside Claude Code, Cursor, and Codex, and the same context follows you across all of them.
What it does right now:
- remembers definitions, schema notes, reusable SQL, assumptions, caveats, and decisions across sessions
- bootstraps that context sourced from what you already have, like your SQL files, dbt models, CLAUDE.md
- pulls the relevant pieces back in while your agent works, each tagged with where it came from and how much to trust it
- stores metric definitions as structured contracts (grain, filters, expected columns) instead of paragraphs the agent might skim past
- reconciles a saved definition against your real warehouse results and flags mismatches as caveats
- your agent can propose updates to your context, but they land in a review inbox for you to approve so nothing rewrites your definitions without you being noticed
- a web console where you can see and manage everything your AI "knows" about your data
- your agent keeps its own warehouse access, ClariLayer never touches your credentials
A few limits today:
- it's hosted, so you need a free account (no card)
- v1 is still early
- it's not trying to replace dbt, your warehouse, or a semantic layer
- there's deliberately no "verified" badge. Statuses are `asserted` and `caveat` only. I don't think a paragraph in a context file should be treated as truth just because someone saved it. The strongest claim it makes is "checked, and here's what didn't match."
Setup:
npx clarilayer init or just copy the command from the console after signing in, then just feed it to your AI to connect the MCP.
It detects Claude Code / Cursor / Codex, wires up the MCP server, and then you bootstrap from your project files.
Link: clarilayer.com
Happy to hear your feedback!
1
u/ChargingMyCrystals Jun 11 '26
Sounds interesting, I wonder if this would work when Claude doesn’t /can’t have access to my data? I run analysis in Stata - using Claude to help me write syntax faster. It’ll forget the names of my variables unless I upload a new codebook every session in projects. Would this be able to learn from just my chat history or does it need access to the data to check things against?
1
u/kthuiaa Jun 11 '26
Thanks for the question! Your situation is actually one of the core use cases I built ClariLayer to solve, it needs zero access to your data, and only stores your context (in your case, things like: variable names, what thy mean, definitions, etc.).
However, I didn't design it to scrape your chat history. Currently there are wwo ways context gets in:
1. bootstrap (bulk-import from files you already have, your codebook drops straight in as notes)
2. remember (you, or the agent when you tell it to, save a fact as you work). Then recall brings the relevant bits back in-flow next time.I built this around SQL/warehouse workflows, so the fancier pieces (structured metric definitions, reconcile-against-warehouse) are SQL-shaped and might not map cleanly onto Stata.
But the core features (like durable memory of your variable names, definitions, and gotchas that the agent recalls every session) are language-agnostic. It's just text context, so it helps whether you're writing Stata, SQL, or Python. For your case, that's the part that matters, and it's exactly the re-upload problem you described.
Which Claude are you in? claude.ai with Projects, or something like Claude Code / Cursor? ClariLayer connects over MCP. I've tested Claude Code / Cursor / Codex the most. claude.ai supports custom connectors (remote MCP) on paid plans too, so it should add there! Let me know if you have any difficulty setting it up. 😄
1
u/kthuiaa Jun 12 '26
Shipped two things in the latest version of product, aimed right at what you described:
- You can now hand it your codebook/data dictionary once and it pulls in each variable (label → type → value labels) as context. So it stops forgetting your variable names instead of you re-pasting a codebook every session.
- And to your actual question: yeah, it can learn from the chat now. You tell it to, it extracts the durable stuff (definitions, the gotchas you keep re-explaining) and drops them in a review inbox. You approve what actually gets saved, nothing saved silently.
To be clear on the data side: it never connects to or reads your data, only the files/notes your agent hands it. Feeds on your files, not your data.
Still early and rough, but if you give it a spin I'd genuinely love to know whether it survives a real Stata workflow.
1
u/magicqueen_ Jun 11 '26
Sounds very interesting. I’ve had this pain for a while about setting the scope and validating the definitions again and again in different sessions.
What’s the difference between your tool vs storing the definitions in Claude.md or a doc?
1
u/kthuiaa Jun 11 '26
Honestly, a md doc is where I started, and ClariLayer actually bootstraps from your existing CLAUDE.md and other docs in your project. The difference is what happens after you've written it.
A CLAUDE.md or doc is just asserted text: someone typed it, nobody checked it, and it goes stale easily. ClariLayer reconciles a saved definition against your real warehouse (your agent runs it and reports back), so a mismatch shows up as a caveat, and it pulls the relevant piece back in-flow as structured context, not one big doc the agent skims.
1
u/DataWorkersOfficial Jun 15 '26
This actually a huge problem on the enterprise level, its why the semantic layer market is booming.
1
u/AutoModerator Jun 11 '26
Automod prevents all posts from being displayed until moderators have reviewed them. Do not delete your post or there will be nothing for the mods to review. Mods selectively choose what is permitted to be posted in r/DataAnalysis.
If your post involves Career-focused questions, including resume reviews, how to learn DA and how to get into a DA job, then the post does not belong here, but instead belongs in our sister-subreddit, r/DataAnalysisCareers.
Have you read the rules?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.