The Feature Flag Graveyard Nobody's Cleaning Up
Every feature flag starts with a clear purpose: roll this out gradually, kill this switch if something breaks. Most of them outlive that purpose by months, sitting in the codebase permanently on, permanently off, or forgotten, adding a branch to test and a bit of cognitive load to every engineer who has to remember what it does.
Nobody decides to build a flag graveyard. It happens one un-deleted flag at a time.
Vendors Covered in this Article
Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.
Why flags accumulate faster than anyone notices
Adding a flag takes minutes and feels low risk. Removing one takes longer, since it means confirming nothing still depends on the old code path, updating tests, and actually deleting the dead branch, not just flipping the flag's default. That asymmetry means flags pile up steadily unless removal is treated as a required step of the rollout, not an optional cleanup task someone gets to eventually.
Sort flags by what they're actually for
A temporary rollout flag, meant to exist for weeks while a feature ramps up, is a different thing from a permanent configuration switch, meant to exist indefinitely, and both are different from an emergency kill switch, meant to exist forever but never be flipped. Treating all three the same, as if every flag should eventually get deleted, or as if none of them need review, is how permanent switches get mistakenly cleaned up and temporary ones linger for a year.
The flag that's technically off but still evaluated everywhere
A flag defaulted to off still costs something: the check runs on every request, the dead code path still needs to compile and pass type checking, and every engineer reading that function still has to hold both branches in their head even though one of them never executes anymore. A flag that's been off for six months with no plan to turn it back on isn't providing optionality, it's just debt wearing a flag's clothing.
Tie cleanup to your deploy cadence, not a separate project
Teams in the fastest, on-demand deploy cluster tend to treat flag removal as a normal, low-stakes part of shipping, since a bad removal is trivial to fix with another quick deploy1. Teams stuck deploying once a month or less treat every change, including flag cleanup, as higher stakes, which makes removal feel riskier than it is and pushes it further down the priority list. If your team deploys frequently, use that: make flag removal a routine, boring part of the workflow, not a special project. And if your team doesn't deploy frequently yet, batch flag removals into a low-risk, well-tested release rather than mixing them into a change that's already carrying real feature risk.
Common mistake: nobody owns flag deletion
The engineer who added a flag during a feature launch has usually moved on to the next project by the time it's safe to remove. Without an explicit owner for the removal step, a flag can sit fully rolled out and forgotten indefinitely, since nobody feels responsible for closing the loop. Assign the removal, with a rough target date, at the same time the flag is created, not as an afterthought once someone notices it's stale.
A quick audit to run this quarter
Pull every flag currently at one hundred percent on or zero percent off for more than sixty days: those are your strongest deletion candidates, since a flag stuck at either extreme that long usually isn't providing real optionality anymore. For each one, confirm nothing depends on flipping it back, then delete the flag and the dead branch together, not just the flag definition. A tool like ClickUp can hold the list and the assigned owner so the audit produces action instead of another list nobody works from.
Work through each stale flag in this order:
- Find flags that have sat fully on or fully off for more than sixty days, since they no longer provide real optionality.
- Confirm nothing still depends on being able to flip the flag back to its old state.
- Delete the flag and its dead code branch together, not just the flag definition, and update the related tests.
- Assign an explicit owner for each removal so it doesn't wait on an engineer who has moved on.
A worked example: what a graveyard actually costs an engineer
Say a service has accumulated eighteen flags over two years, eleven of them stuck fully on or fully off for more than six months. A new engineer reading that service's core function has to mentally resolve every one of those branches to understand what the code actually does today, even though eleven of the eighteen outcomes are already settled. Deleting just those eleven doesn't remove any functionality: it removes eleven unnecessary decisions from every future reader's job, which is most of what flag cleanup is actually buying you.
What Good Looks Like
Good feature flag hygiene means flags sorted by type, an assigned owner and rough removal date set at creation time, and a recurring audit that catches anything stuck at a fixed state for too long.
Building The Capability (5-Stage Skill Ladder)
How to Get Started
Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.
Frequently Asked Questions
How long should a rollout flag live before it gets removed?
Once a feature is fully rolled out and stable, the flag should come out within a few weeks, not months. If it's still there past that window with no active reason, it's usually just been forgotten rather than deliberately kept, and it's worth treating as a deletion candidate.
Should every flag eventually get deleted?
No. Permanent configuration switches and genuine emergency kill switches are meant to exist indefinitely. The cleanup problem is specifically about temporary rollout flags that outlived their purpose, not about eliminating flags as a category.
What's the easiest way to find stale flags?
Pull every flag that's been stuck at fully on or fully off for more than a couple of months. That single filter usually surfaces the strongest deletion candidates faster than trying to review every flag in the system for context each time.
Sources
Where we quote a benchmark, we show its source. Other figures in this guide are estimates or general guidance, so check them against your own numbers.
- Deployment frequency by DORA performance cluster (max days between deploys). DORA Accelerate State of DevOps 2024 (Google Cloud), cluster table via Octopus Deploy analysis, 2024.
Related Guides
The Feature Flag Cleanup Habit Most Teams Never Build
Why feature flags pile up unused for years, and a simple habit that keeps your flag count from becoming its own source of bugs.
A Checklist for Cleaning Up Feature Flags Before They Become Their Own Codebase
A checklist for finding and safely removing stale feature flags, and the pitfalls that turn a routine cleanup into a production incident.
The Feature Flags Nobody Remembers Turning On
A checklist for keeping feature flags clean in a RAG pipeline, where flags controlling embedding models, rerankers, and prompts multiply fast.
Stale Feature Flags Are Technical Debt With a Kill Switch
A feature flag left in code after launch is a branch nobody tests and a rollback path nobody trusts. Here is a checklist for keeping flags from piling up.
A Checklist for Cleaning Up Feature Flags Before They Rot
The common ways feature flags turn into permanent technical debt, and a checklist for cleaning them up before they become a security risk.
Cleaning Up Feature Flags Before They Clean Up You
A checklist for keeping feature flags from piling up into technical debt, including who should own cleanup and what to check before deleting an old flag.