## TL;DR

dbt retry replays the previous run from the artifacts in target/, and there is no previous run there. Run dbt build (or run/test) once first in the same directory, then dbt retry will pick up the failed nodes. Do not clean target/ between the two commands.

## Error

```text
dbt retry: no runs to retry in target directory
```

## Steps

1. Check target/ for run_results.json. If it is missing or from a different invocation, that is the problem.
   Expected: run_results.json absent, or its timestamps do not match your last run.

2. Run your full command first: dbt build --select ... (whatever you intended), and let it fail on the nodes you want to retry.
   Expected: target/run_results.json now records the failed nodes.

3. Without cleaning or changing directories, run dbt retry.
   Expected: dbt retry lists the failed nodes from run_results.json and re-runs them.

4. If you must retry in CI across jobs, persist target/ as a CI artifact between the run job and the retry job.
   Expected: The retry job finds run_results.json and resumes correctly.

## When to use

- dbt retry says no runs to retry
- you ran dbt clean before dbt retry (clean deletes the artifacts retry needs)
- CI runs retry as a separate step without passing target/ along

## When not to use

- you want to retry only some nodes (use --select on the original command instead)
- nothing has run yet (there is nothing to retry, run first)
- the previous run succeeded (retry only re-runs failures; success means nothing to do)

## Tool compatibility

- dbt-core 1.0+; dbt retry reads target/run_results.json
- dbt clean wipes target/, never run it between run and retry
- dbt Cloud: retries are handled by the job's own retry settings, not this command

## Variant phrasings

### no runs to retry after changing directories
target/ is relative to the project dir. Retry from the same directory where the run wrote its artifacts.

### retry runs everything instead of just failures
Your run_results.json may be from an older run. Check its generated_at timestamp; stale artifacts retry stale failures.

## Why it happens

dbt retry is stateful: it does not remember your last command, it reads the last run_results.json. Anything that removes or replaces target/ (clean, fresh checkout, separate CI job) breaks the chain. The fix is keeping the artifacts, not a flag.

## Edge cases

- dbt retry re-runs failed nodes and their downstream dependents; it is not a single-node rerun.
- If the failure was a warehouse outage, confirm the warehouse is back before retrying or you will just fail again.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_HLaWoFVAf2AvVR7aqTzreA
