The flag was called enable_checkout_v2. It had been on for 100 percent of traffic since March. Nobody remembered who owned it. When a junior engineer deleted it during a cleanup sprint, the payment service started throwing 500s within ninety seconds, and the on-call had no idea why—because the code path it guarded hadn't been touched in eight months, but a downstream retry loop still read it through a stale config cache that only refreshed on deploy.
That's the thing about feature flags. They're sold as the safest way to ship software: flip a switch, roll back instantly, decouple deploy from release. What they actually do is turn your codebase into a field of buried ordnance, each flag a pressure plate wired to a code path nobody has walked in months. The blast radius is invisible until someone steps on it.
The cleanup that wasn't
Flag debt is the quiet cousin of technical debt, and it's worse, because at least everyone agrees the old code is bad. A dormant flag looks harmless. It's one boolean. It costs nothing. So it stays, and stays, and the flag count climbs—LaunchDarkly customers routinely report thousands of active flags, and a meaningful fraction are "permanent" toggles that were supposed to be temporary. Each one is a fork in the logic that only some of your tests exercise, and none of your tests exercise the combination.
The combinatorial problem is the real one. With ten independent boolean flags you have 1,024 possible configurations. With thirty you have a billion. Your CI runs maybe a dozen. The rest are live in production, or will be the moment someone flips a switch during an incident at 3 a.m., which is exactly when people flip switches.
Flags as an excuse
Here's the sharper problem, and it's organizational, not technical. Feature flags let teams avoid the hard conversation about whether a feature is done. Ship it dark, ship it to 5 percent, ship it to internal users, ship it to everyone—and then never turn the flag off, because turning it off means admitting the migration is finished and the old path can be deleted, and deleting the old path means someone has to own the decision. So the flag stays. It becomes a permanent hedge against a rollback that will never be clean anyway, because by the time you need it, the flag's guard clauses have drifted three refactors behind the code they're supposed to protect.
I've watched teams use flags to ship a rewrite and keep the old system running "just in case" for over a year. Both paths got bug fixes. Neither got the full attention. The flag didn't reduce risk; it distributed it across every future engineer who had to reason about which branch was live.
What actually works
The teams that avoid this treat flags like explosives with a shelf life. Every flag gets an owner, an expiry date, and a ticket that fires automatically when the date passes. The flag is deleted the week the rollout hits 100 percent—not "eventually," not "after the next release," that week. The cleanup is scheduled work, not a chore for whoever has spare time, because nobody ever has spare time.
The other move is boring and effective: flags for release, not for configuration. A flag that gates a rollout for two weeks is a tool. A flag that gates a customer tier, a region, or a pricing experiment is a config system wearing a flag's clothes, and it should be built as one—with tests, with documentation, with the assumption that it lives forever. Conflating the two is how you end up with a "temporary" toggle that's load-bearing five years later.
None of this is exotic. It's the same discipline we supposedly learned about branches and migrations and every other deferred decision. The flag just makes deferral feel free, which is the most expensive thing software can do.
The engineer who deleted enable_checkout_v2 wasn't reckless. They were doing what the system rewarded: cleaning up dead code. The system punished them for it, which means the system was wrong. A flag you can't safely delete is not a safety mechanism. It's a liability with a friendly name, and the bill comes due the moment someone forgets where you buried it.
Generated by Reportify AI — Automate your team's status reports, standups, and weekly updates. Try free →