9 out of 12 public dbt repos we audited have "phantom columns" in their docs

TL;DR: Most CI linters (dbt-checkpoint, dbt-project-evaluator) check if a column has a description, but almost nothing checks if the column in your YAML actually exists in your data warehouse. We scanned public production dbt projects and found that 9 out of 12 had significant doc-to-warehouse drift.

The Bug That Got Me Thinking

Found this in a public dbt repo recently:

A model called fact_customer_survey had a UNION.

  • Branch 1 (line 30): NULL as dissatisfacation_category (notice the extra 'a')
  • Branch 2 (line 51): dissatisfaction_category (spelled correctly)

Because SQL takes union output column names from the first branch, the warehouse materialized DISSATISFACATION_CATEGORY.

Here's the kicker: The project’s YAML docs declared dissatisfaction_category (spelled correctly).

  • The SQL ran fine daily.
  • The documentation was "correct."
  • The code was wrong.
  • Any dashboard or analyst trusting the docs was querying a column that didn't exist.

How Bad Is This in the Wild?

Every time you run dbt docs generate, you produce two files:

  1. manifest.json (what you claim exists in YAML)
  2. catalog.json (what the warehouse actually returns)

We compared declared columns vs. cataloged columns across verified production repos. Out of 12 active organizational projects:

  • 9 out of 12 had phantom columns (documented in YAML, completely missing in the warehouse).
    • Cal-ITP (BigQuery): 106 phantom columns
    • Allvue Systems (Snowflake): 112 phantom columns + 323 data type mismatches (mostly declared string sitting on warehouse NUMBER)
    • Cook County Assessor (Athena): 11 phantom columns
  • The "Ghost Repo" problem: 23 docs sites published a complete, polished YAML docs UI where catalog.json was an empty stub—meaning the warehouse was literally never introspected. One documented 1,280 models this way.

Where Does the Drift Come From?

When we audited the findings against actual model SQL:

  1. Renames / Deletions: Column was renamed or dropped in SQL, but the YAML entry was never cleaned up.
  2. Commented-out code: One project had a 20 KB cleaning projection inside a /* ... */ block. The live warehouse table had 173 raw Airbyte column names (WEEK STARTING 01/19/2025 - RESOURCES...), while the YAML proudly documented the clean columns someone intended to build.
  3. Syntax accidents: Trailing commas in YAML names (e.g., - name: feed_type,).

Why This Is Becoming a Bigger Problem

When human analysts read dbt docs, they can spot a typo or realize a column was renamed.

But with dbt MCP servers and Text-to-SQL AI agents using dbt docs and manifests as ground truth context, a phantom column is an immediate failure. The agent attempts to query columns that aren't there or hallucinates transformations based on dead YAML.

A Few Questions for the Sub:

  1. Does anyone here actively diff manifest.json against catalog.json in their CI/CD pipelines?
  2. How do you prevent documentation rot when engineers refactor/comment out SQL transformations?
  3. If you are already feeding dbt metadata to LLMs/AI agents, how are you validating that the schema you hand the agent actually matches production?
reddit.com
u/kthuiaa — 1 day ago

Data context in md files?

I have been using a context layer along with Claude Code for some RevOps projects (sales comp, sales360, etc.).. and I just realized that most of my context stored is not Query, but Definition and Note.

As recently I have been thinking about the differences between having a proper context layer vs storing all these information in md files in the repo, I wonder if anyone has experiences storing all these in md files? Does it actually work for your AI? Would it struggle to find the right piece of context from the sea of md files?

https://preview.redd.it/aoilj9xjcyjh1.png?width=1036&format=png&auto=webp&s=4b180011e9f704af804f36fff690689aa4127a78

reddit.com
u/kthuiaa — 3 days ago

Difference between context layer products and MD files/repo?

So there are more and more "context layer" products in the market now, have you had experience with any of them? What do you think are the meaningful differences between a proper context layer and simply relying on MD files/git repo?

Keen to hear what people in this sub think!

reddit.com
u/kthuiaa — 9 days ago

I turned our Databricks cost audit into an open-source skill for Claude Code and Codex

Our Databricks spend jumped recently, so I used the CLI and system tables to trace it back to specific warehouses, Apps, Jobs, and service principals.

After stopping unused Apps and reducing compute, our daily cost dropped noticeably.

I cleaned up the process and published it here:

https://github.com/kylehuirevvision/databricks-cost-optimizer

It starts read-only, estimates Databricks list-price spend, maps costs to workloads and identities, and explains the expected impact before any optimization is applied.

It works with both Claude Code and Codex. No SaaS or signup, and it’s MIT licensed.

It’s still early, so I’d appreciate feedback, particularly on cross-cloud compatibility or useful cost patterns I’ve missed.

u/kthuiaa — 13 days ago
▲ 3 r/VibeCodeCamp+1 crossposts

What happens after MVP vibe coded?

When someone non-technical on your team builds a prototype with AI (Lovable, v0 etc.), what actually happens next? Does engineering take it over, rebuild it, or does it just die? Trying to work out if the "handoff" problem is real or just my bubble. War stories welcome.

reddit.com
u/kthuiaa — 14 days ago
▲ 1 r/ContextEngineering+1 crossposts

I built a free tool to solve the problem of data context

If you have ever used AI for data projects, you certainly know the pain of re-explaining your data to your AI every session.

Wrong table, wrong join, refunds counted in revenue, an active customer defined three different ways, etc. The same mistakes, session after session, because nothing remembers the correction you already made.

So I built ClariLayer to solve this, simply connect ClariLayer MCP to to Claude Code, Codex, or any AI you use. It bootstraps your real working context from your project, and continuously adds more and more context there, everything being managed, without you even noticing that you are using ClariLayer as your AI is the one who relies on it, you just feel your AI becoming smarter and smarter.

It's completely free, look forward to hearing feedback!
https://clarilayer.com/

u/kthuiaa — 2 months ago

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!

u/kthuiaa — 2 months ago