Skip to content
Latchkey

What Is Build Avoidance?

Build avoidance is a strategy where a build system detects that a target's inputs have not changed and reuses a previously produced output rather than rebuilding it. It relies on accurate input hashing so reuse is always correct. Done well, it turns large pipelines into mostly cache hits.

Why it matters

Most CI runs only touch a small part of a codebase, yet naive pipelines rebuild everything. Build avoidance cuts wall-clock time and runner cost by doing only the work a change actually requires. On metered managed runners, fewer rebuilt targets translates directly into fewer billed minutes.

What it depends on

  • Precise input hashing for every target
  • A cache that survives between runs
  • Deterministic builds so reuse stays correct

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →