debugging-dbt-errors

debugging-dbt-errors is a skill for Claude Code from AltimateAI/data-engineering-skills. It costs 112 tokens per session (1,050 once invoked), scanned A, original, MIT.

A troubleshooting guide for dbt, a tool that builds data models with SQL. It helps investigate compilation errors, database errors, failed tests, and incorrect model results.

In plain words
What is it for?
Use it when a dbt model is broken, failing, produces unexpected data, or needs debugging. It covers checking upstream models, previewing results, and running dbt build after a fix.
Why use it?
It replaces guesswork with a repeatable process: read the full error, inspect the data and compiled SQL, then rebuild and verify the output.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dbt-skills plugin — 7 skills shipped together

Good fit Use it when a dbt model is broken, failing, produces unexpected data, or needs debugging. It covers checking upstream models, previewing results, and running dbt build after a fix.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/altimateai/data-engineering-skills/debugging-dbt-errors
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AltimateAI/data-engineering-skills --skill debugging-dbt-errors
Clone the repo
git clone --depth 1 https://github.com/AltimateAI/data-engineering-skills

Made for: Claude Code.

Or install dbt-skills, the plugin that ships this one along with the rest of its 7 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debugging-dbt-errors

README.md
[![agentmods](https://agentmods.dev/badge/skills/altimateai/data-engineering-skills/debugging-dbt-errors/github.svg)](https://agentmods.dev/skills/altimateai/data-engineering-skills/debugging-dbt-errors)
Your own site
<a href="https://agentmods.dev/skills/altimateai/data-engineering-skills/debugging-dbt-errors"><img src="https://agentmods.dev/badge/skills/altimateai/data-engineering-skills/debugging-dbt-errors/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debugging-dbt-errors

Your own site · 80×15
<a href="https://agentmods.dev/skills/altimateai/data-engineering-skills/debugging-dbt-errors"><img src="https://agentmods.dev/badge/skills/altimateai/data-engineering-skills/debugging-dbt-errors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00112 $0.01050
Opus 5.5 $0.00045 $0.00420
Sonnet 5.5 $0.00022 $0.00210
Haiku 4.5 $0.00011 $0.00105

Measured 1mo ago against content hash 3a32473f71da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debugging-dbt-errors scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/dbt/debugging-dbt-errors/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

dbt Troubleshooting

Read the full error. Check upstream first. ALWAYS run dbt build after fixing.

Critical Rules

  1. ALWAYS run dbt build after fixing - compile is NOT enough to verify the fix
  2. If fix fails 3+ times, stop and reassess your entire approach
  3. Verify data after build - build passing doesn't mean output is correct

Workflow

1. Get the Full Error

dbt compile --select <model_name>
# or
dbt build --select <model_name>

Read the COMPLETE error message. Note the file, line number, and specific error.

2. Inspect Actual Data (For Data Issues)

Before fixing "wrong output" or "incorrect results", query the actual data:

# Preview current output
dbt show --select <model_name> --limit 20

# Check specific values with inline query
dbt show --inline "select * from {{ ref('model_name') }} where <condition>" --limit 10

# Compare with expected - look for patterns
dbt show --inline "select column, count(*) from {{ ref('model_name') }} group by 1 order by 2 desc" --limit 10

Understand what's wrong before attempting to fix it.

3. Read Compiled SQL

cat target/compiled/<project>/<path>/<model_name>.sql

See the actual SQL that will run.

4. Analyze Error Type

Error Type Look For
Compilation Error Jinja syntax, missing refs, YAML issues
Database Error Column not found, type mismatch, SQL syntax
Dependency Error Missing model, circular reference

5. Check Upstream Models

# Find what this model references
grep -E "ref\(|source\(" models/<path>/<model_name>.sql

# Read upstream model to verify columns
cat models/<path>/<upstream_model>.sql

Many errors come from upstream changes, not the current model.

6. Apply Fix

Common fixes:

Error Fix
Column not found Check upstream model's output columns
Ambiguous column Add table alias: table.column
Type mismatch Add explicit CAST()
Division by zero Use NULLIF(divisor, 0)
Jinja error Check matching {{ }} and {% %}

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 154 lines · 112 tokens per session scan A 3a32473f71da

Subscribe to this mod's changes

debugging-dbt-errors is a skill published in the GitHub repository AltimateAI/data-engineering-skills (129 stars, last pushed 5d ago), licensed MIT. It adds 112 tokens to every session and 1,050 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

datahub-verified-remediation

Use this skill when a source schema change has broken, or is about to break, a downstream transformation and the user wants a fix they can merge — not a summary. Triggers on: "a column was renamed, fix the dbt model", "this field is gone downstream", "schema drift", "our model still selects the old column", "generate…

Marc-Dvci/praxis-datahub · 140 tokens

spark-engineer

Use when writing Spark jobs, debugging performance issues, or configuring cluster settings for Apache Spark applications, distributed data processing pipelines, or big data workloads. Invoke to write DataFrame transformations, optimize Spark SQL queries, implement RDD pipelines, tune shuffle operations, configure…

Jeffallan/claude-skills · 75 tokens

prompt-debugging

Figure out why a prompt isn't working and fix it — diagnose the actual failure (ambiguity, missing context, wrong format, conflicting instructions) instead of randomly rewording. Use when asked why isn't my prompt working, the AI keeps ignoring my instructions, my prompt gives inconsistent results, or how do I fix…

mohitagw15856/pm-claude-skills · 131 tokens

rag-architecture-review

Review an existing Retrieval-Augmented Generation system and find why it underperforms. Use when asked to review or audit a RAG pipeline, diagnose wrong/ungrounded answers from a 'chat with your docs' feature, or improve an already-built knowledge assistant. Produces a staged review — ingestion, chunking, retrieval…

mohitagw15856/pm-claude-skills · 89 tokens

prompt-optimizer

Diagnose and rewrite an underperforming LLM prompt so it produces reliable, well-structured output. Use when asked to improve a prompt, fix a prompt that gives inconsistent or wrong results, reduce hallucination/refusals, or make output follow a format. Produces a rewritten prompt with a diagnosis of what was failing…

mohitagw15856/pm-claude-skills · 86 tokens

rudder-profiles-debug

Diagnoses RudderStack Profiles compile failures, run failures, and output-quality problems. Use when pb compile fails, pb run fails, identity stitching looks wrong, output quality regresses, or Profiles errors need structured recovery.

rudderlabs/rudder-agent-skills · 50 tokens