using-dbt-state

Configure and troubleshoot dbt State server-backed node reuse across dbt Core and Fusion.

699|61|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill using-dbt-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-dbt-state
Source: https://github.com/dbt-labs/dbt-agent-skills/tree/main/skills/dbt/skills/using-dbt-state
Command: npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill using-dbt-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It resolves confusion around dbt State, the server-backed reuse mechanism that skips, clones, or rebuilds dbt nodes, and explains why models rebuild unexpectedly or fail to reuse existing objects.

Core Features & Use Cases

  • Reuse decision guidance: Explains how dbt State chooses between skip, clone, and build for each selected node based on semantic hashes and data freshness.
  • Configuration reference: Documents configs like lag_tolerance, evaluate_volatile_sql, pre_clone, and execute_hooks_on_any_reuse for tuning reuse behavior.
  • Troubleshooting: Diagnoses unexpected rebuilds caused by volatile SQL, non-deterministic Jinja, or build-relevant config changes, and clarifies DATT-based billing.
  • Use Case: A developer notices a model with current_timestamp() rebuilding every run; use this Skill to determine whether evaluate_volatile_sql or a Jinja-rendered value is invalidating the semantic hash.

Quick Start

Ask the agent why my dbt model keeps rebuilding despite no code changes and how to configure lag_tolerance for my dev environment.

Frequently Asked Questions about using-dbt-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does dbt State decide whether to skip, clone, or rebuild a model?

dbt State parses SQL into a syntax tree and compares semantic hashes, then checks upstream data freshness against lag_tolerance. It skips if the target object is unchanged and fresh, clones from another schema if a matching object exists, and builds only when no valid reuse is possible.

What is the difference between dbt State and the state:modified selector?

The state:modified selector hashes file contents against a manifest you maintain and rebuilds all descendants. dbt State manages state on a server, compares semantic SQL hashes, considers data freshness, and rebuilds only descendants that actually depend on the change.

Does dbt State work with dbt Core or only Fusion?

dbt State works in dbt Core, the dbt platform, and Fusion across dev, CI, and production. dbt Core 1.7-1.11 requires pip install dbt-state, while Core 1.12, v2.0, and Fusion include it built in.

Why does my model with current_timestamp() keep rebuilding?

By default volatile functions are hashed by name, not runtime value, so they should not trigger rebuilds. Rebuilds usually mean evaluate_volatile_sql is enabled or a Jinja value like run_started_at changes the compiled SQL each run.

How is dbt State billed and what is a DATT?

dbt State is metered in DATTs, daily active target tables, where each model, seed, snapshot, and distinct test counts as a target table. A target table becomes a DATT when at least one skip, clone, or test reuse occurs on it in a day; views are never billed.

Why did my post-hooks not run on a reused model?

Pre and post-hooks do not run when a node is reused by default. Set execute_hooks_on_any_reuse to true in the state config so hooks execute even when the node is skipped or cloned.