Feature flags are debt, so pay it down
How to keep a flag system from turning into a thousand-branch maze, with ownership, expiry and cleanup tooling.

A flag is a branch in your code that runs in production. Every one you leave behind multiplies the states your software can be in. Five flags give 32 combinations. Twenty give a million, and nobody tests them.
Two kinds of flag
Short lived flags guard a release or an experiment. They should live for days or weeks. Long lived flags control permissions, kill switches and operational settings. They are fine to keep, but they need a different name and a different owner.
The rules that keep a flag system healthy
- Every flag has an owner and an expiry date at creation.
- A flag at 100% for two weeks gets a cleanup ticket automatically.
- Temporary flags use a naming prefix, so you can search for them.
- Code that reads a dead flag fails CI, so removal is forced.
Cleanup is cheaper than it looks
Removing a flag means deleting the losing branch and the check around the winner. A good cleanup is a ten line pull request. A bad one happens a year later, when the author has left and nobody remembers which branch was the safe one.
// Before
if (kerf.flag("new-checkout", user)) {
return <NewCheckout />;
}
return <OldCheckout />;
// After cleanup
return <NewCheckout />;Track the number that matters
Count flags older than 30 days that are fully on or fully off. That is your debt. Put it on a dashboard next to deploy frequency, and review it in the same meeting.
We don't have a flag problem. We have a deletion problem.
Kerf engineering
Teams that treat flags as temporary by default stay fast. Teams that treat them as free end up afraid to touch their own code.
Keep reading

Guardrails, not gates
Why the best experimentation programs automate safety checks instead of adding approval steps.

The winner's curse in A/B testing
Why the lift you measured is usually larger than the lift you will get, and how to plan for it.

An AI wrote our experiment readout, and we shipped it
What we learned building AI readouts: what the model is good at, where it needs hard limits, and how we check it.