The feature flag lifecycle, from draft to conclude
The feature flag lifecycle is the path a flag or experiment takes from a scaffolded draft to a decision recorded on its surface: draft, validate, build, ramp or hold, then conclude. Each stage has its own command and its own artifact, so you can tell where a flag stands by reading one file.
Most flags do not die at conclude. They die at ramp or hold, the stage where a flag reaches 100% and nobody runs the last command. Most codebases have at least one flag like new-checkout-v2: shipped to everyone, a dead branch behind it that nobody will delete, because nobody remembers whose decision it was.
This post walks the feature flag lifecycle stage by stage, with the command and the file each one touches, and names the point where most teams stop doing the work.
Key Takeaways
- The feature flag lifecycle has five stages: draft (
dif new), validate (dif validate), build (dif build), ramp or hold, and conclude (dif conclude).dif newpre-loads a draft with the surface’s last learnings, so a team does not re-run a test it already disproved.- The lifecycle’s weak point is ramp or hold. A flag can sit at
status: activeindefinitely, and one stuck at 100% with a dead branch behind it is the common failure mode.dif concludewrites a dated, one-line decision back to the flag’s surface and archives the file, so the lifecycle actually ends instead of fading out.- A flag and an experiment share the same five stages. The only difference is whether the weights hold at a split or ramp toward 100%.
What is the feature flag lifecycle?
The feature flag lifecycle is the sequence a flag file moves through from creation to closure: drafted with dif new, checked with dif validate, compiled into the runtime with dif build, then held at a split or ramped toward 100% until someone runs dif conclude. Every stage after draft either changes the file or reads it. Nothing about a flag’s state lives outside the file.
Each stage maps to one command and one artifact:
- Draft.
dif newwrites a new.mdfile withstatus: draftand nothing live. - Validate.
dif validatepasses or fails the file in the terminal or in CI. - Build.
dif buildcompiles active files intoclient.ts,audiences.ts, andcontext.json. - Ramp or hold. Editing the frontmatter and merging moves the weights.
- Conclude.
dif concludewrites the decision to the surface and archives the file.
Draft: dif new scaffolds the file
A flag’s first stage is a file that cannot ship anything yet. dif new writes it and pre-loads the draft with what the surface already knows:
$ dif new new-checkout --surface checkout
Wrote dif/experiments/active/new-checkout.md
Pre-loaded learnings from surface checkout:
- benefit-led CTA copy lifted completed_checkout 2.1% (concluded 2026-01-09)
- full-page redirect at checkout abandoned, no significant lift (concluded 2025-09-22)
The file itself starts broken on purpose:
---
id: new-checkout
status: draft
owner:
surface: checkout
variants:
- id: "off"
weight: 100
- id: "on"
weight: 0
metrics:
primary:
---
## Brief
## Hypothesis
owner and metrics.primary are empty, and every bucket maps to off. Nothing ships until someone fills in the brief, names an owner, and moves weight toward on. For a PM, the two pre-loaded learnings are the useful part: proof the team already tried a redirect at checkout and it did not move the metric, so this draft will not repeat it. For an engineer, the useful part is the skeleton itself, the shape dif validate checks next. The .md format documents every field.
Validate: dif validate catches the broken file before merge
A draft left half-filled fails the next stage, which is the point:
$ dif validate
Checking dif/experiments/active/new-checkout.md ... FAIL
owner is required
metrics.primary is required
Filling in owner: sam@acme.com and metrics.primary: completed_checkout and rerunning the check turns it green:
$ dif validate
Checking dif/experiments/active/new-checkout.md ... ok
dif validate also checks that variant weights sum to 100, that the referenced surface exists, and that no two active experiments collide on one surface. Run it in CI and a broken flag fails the pull request like a broken build, the subject of the guide to validating flags in CI.
Build: dif build compiles the runtime and context.json
A valid file still does nothing until it is compiled. dif build reads every active flag and writes the typed client the application imports:
$ dif build
Compiled dif/experiments/active/new-checkout.md
Wrote src/dif/client.ts
Wrote src/dif/audiences.ts
Wrote dif/context.json
The call site is one function:
if (dif("new-checkout") === "on") {
return <NewCheckout />;
}
return <LegacyCheckout />;
Only active files compile. A flag still marked status: draft is invisible to the build, and invisible to production, until someone flips it. The CLI reference covers the rest of the flags each command accepts.
Ramp or hold: the stage most flags get stuck in
Once a flag is active, it does one of two things. A flag ramps: new-checkout moves from 10% to 25% to 100% over a series of small, reviewed edits to the weight fields. An experiment holds: checkout-cta-copy sits at a fixed 50/50 split until the primary metric answers the hypothesis. Both are the same file format, the same dif validate pass, and the same dif build compile. The only difference is whether the next edit moves the split or holds it.
Ramping costs you the instant toggle. Widening the rollout is a commit and a deploy, so if your build takes ten minutes, your worst-case time to adjust is ten minutes.
The deploy cost is not what actually buries a flag. Nothing forces the next step once a ramp reaches 100%, so a flag with no open question left is free to just sit there. That is how new-checkout-v2 ends up live for three years with a dead branch behind it: every ramp was a deliberate, reviewed decision, and the one decision nobody made was to conclude it. Martin Fowler’s writing on feature toggles makes the same point about flags as inventory, kept low by removing them, not by adding a cap on how many you create.
Conclude: writing the decision back and archiving the file
The lifecycle’s last stage is the one that closes the loop a draft opened. dif conclude records a decision, writes one line to the surface, and moves the file out of the active directory:
$ dif conclude checkout-cta-copy --decision shipped
Updated dif/surfaces/checkout.md
+ 2026-01-09: checkout-cta-copy shipped, benefit-led copy, completed_checkout +2.1%
Archived dif/experiments/active/checkout-cta-copy.md
-> dif/experiments/concluded/checkout-cta-copy.md
That one line is what the next dif new on the checkout surface preloads into its draft, the same two learnings shown at the start of this post. Conclude does not delete the file; it archives it, so the decision and the reasoning behind it stay in git history, readable by git log long after the flag is gone from the code.
Conclude is also the one stage with no automatic trigger. Draft, validate, and build all happen because something else requires them: a new flag, a pull request, a deploy. Conclude happens because a person decides the question is answered and types the command. That is exactly why it is the stage teams skip, and why a flag sitting at status: active for months is worth a second look before it becomes the next new-checkout-v2.
FAQ
What is the feature flag lifecycle? It is the five-stage path a flag file takes from creation to closure: draft (dif new), validate (dif validate), build (dif build), ramp or hold, and conclude (dif conclude). Each stage changes or reads the same file, so the flag’s history is readable in one place.
How long should a feature flag live? As long as the question behind it is still open, and no longer. A release flag should conclude shortly after it reaches 100% and the rollout looks clean. An experiment should conclude once its primary metric has enough signal to answer the hypothesis. There is no universal number of days; there is an owner who should be answering that question on a cadence.
What happens if you never run dif conclude? The flag stays active indefinitely. It keeps compiling into the runtime, keeps showing up in dif validate, and keeps looking like something still in flight. Nothing breaks, which is the problem: a flag stuck at 100% with no decision recorded is exactly how a dead branch survives for years.
Is concluding a flag the same as deleting it? No. dif conclude archives the file (moves it out of dif/experiments/active/) and writes a dated decision to its surface. The file and its history stay in git, so “why did this exist and what did we decide” stays answerable without anyone having to remember it.
Do flags and experiments go through the same lifecycle? Yes. A flag and an experiment are the same file format and move through the same five stages. A flag is one you ramp toward 100%; an experiment is one you hold at a split until the metric answers the hypothesis. Either can become the other without touching application code.
Getting started
The feature flag lifecycle only works if every stage actually runs, including the last one. Draft, validate, and build happen almost automatically, because a pull request forces them. Ramp or hold is where the real decision gets made, and conclude is where that decision gets written down and the file gets archived instead of left to rot at 100%.
Install the CLI and scaffold a project:
npm install -g @dif.sh/cli
dif init
From there, dif new drafts a flag preloaded with what the surface already knows, and the feature flags page covers the rest of the workflow. If a flag in your repo has been sitting at status: active for longer than you can explain, that is the one to run dif conclude on first.