A 30-Minute Audit for Feature Flags Nobody Remembers
A feature flag that outlives the feature it was built to gate is not a neutral leftover. It's a branch of code that still runs, still gets evaluated on every relevant request, and still represents a decision someone has to remember exists. This is a short, repeatable way to find the flags actually worth cleaning up, instead of trying to review every flag in the system at once.
The time box matters as much as the checklist itself: thirty minutes forces you to work from data instead of trying to recall the history of every flag from memory, which is exactly the trap that makes flag cleanup stall out before it starts.
Minute 0 to 8: pull every flag and its last-changed date
List every flag currently defined in your flagging system, along with when its value or configuration was last changed. A flag whose value hasn't changed in months, especially one fully rolled out to every user or fully rolled back to none, is a strong candidate for removal: the decision it represents has already been made and isn't actively being reconsidered. This first pass usually takes less time than people expect, since most flagging systems can sort and filter by last-modified date directly, without any extra tooling.
Minute 8 to 16: which flags gate something security-relevant?
Separate out any flag controlling access to a feature, an API surface, or a permission level, since a stale flag in this category isn't just clutter, it's a potential access control gap. A flag meant to gate a beta feature to a specific test account that was never removed after launch can leave that access path open indefinitely, long after anyone remembers it exists. Treat this category with a shorter review cycle than ordinary rollout flags, since the cost of leaving one stale is meaningfully higher.
Security-relevant flags deserve a slightly different review question: not whether the feature is finished, but who could still reach it. For example, a flag that limits a beta API to a test account should be checked against the current access list, and if the beta has launched, the flag and the special access path should be removed together. Give this category a named reviewer and a shorter cycle than ordinary rollout flags. A common mistake is removing the flag but leaving the permission it once granted, so confirm both are gone.
Minute 16 to 22: which flags have no clear owner?
For each flag, check whether there's a name attached, whoever created it or currently owns the feature it gates. A flag with no identifiable owner is one nobody will proactively clean up, because removal always carries some small risk and nobody wants to be the one who breaks something they don't fully understand. Ownerless flags are your highest-priority cleanup candidates precisely because they'll otherwise sit untouched indefinitely, quietly outliving every engineer who could have explained why they were added in the first place.
Minute 22 to 30: remove the easy ones now, schedule the rest
Flags fully rolled out or rolled back with a clear owner are usually safe to remove immediately: delete the flag and the now-dead code branch it was guarding. For flags that are more complicated to remove, tied to code that's harder to untangle, schedule the work with an owner and a date rather than letting the finding sit in a backlog where it will compete against every other unscheduled task indefinitely.
Sort each flag into one of these outcomes:
- Fully rolled out or rolled back with a clear owner: delete the flag and the dead code branch it guarded, now.
- Tied to code that is hard to untangle: schedule the removal with a named owner and a date.
- Behaving as permanent configuration, such as by customer tier or region: rename or re-tag it as configuration.
- No identifiable owner: treat it as the top cleanup candidate, since nobody will remove it unprompted.
Watch for flags that quietly became permanent configuration
Some flags stop being feature toggles and start functioning as permanent configuration switches, a way to vary behavior by customer tier or region indefinitely, which is a legitimate pattern but a different one from a rollout flag that should eventually be removed. Rename or re-tag these explicitly as configuration rather than leaving them mixed in with genuine rollout flags, so the next audit doesn't waste time re-evaluating a flag that was never meant to be temporary in the first place.
Make the audit a recurring calendar item, not a one-off cleanup
The first audit on a system that's never had one will find the most flags and take the longest; every audit after that gets shorter, because the backlog of neglected flags has already been cleared. Put the next audit on the calendar before you close out this one, with the same owner or a named successor, so the system doesn't drift back to needing a large one-time cleanup again a year from now, once everyone has once again stopped noticing the flags quietly piling up.
What Good Looks Like
Good feature flag hygiene means every active flag has an identifiable owner, flags gating anything security-relevant get reviewed with extra scrutiny, and flags fully rolled out or rolled back are removed promptly rather than left as permanent, silently-evaluated branches in the code.
Building The Capability (5-Stage Skill Ladder)
How to Get Started
Frequently Asked Questions
How many feature flags is too many?
There's no fixed number that's inherently too many; the problem isn't count, it's flags with no clear owner or purpose still active. A team with a hundred well-tracked, actively-used flags is in better shape than a team with twenty flags nobody can explain.
Is it safe to remove a flag that's fully rolled out?
Generally yes, once you confirm the flag is active for every relevant segment, not just the default one. Also check for any dependent flag or configuration that references it before deleting the code path, since flags occasionally get referenced outside the obvious flagging system.
How often should this audit run?
Monthly or quarterly works well for most teams, ideally timed so it doesn't compete directly with a release crunch. A short, frequent audit catches stale flags faster and with less accumulated risk than an infrequent, larger cleanup effort.
About the numbers
This guide doesn't quote a sourced benchmark. Figures in it are estimates or general guidance, so check them against your own numbers.
Related Guides
Rolling Out Agentic Workflows Without Breaking Production
A practical rollout checklist for shipping an AI agent to production, from a shadow-mode test run through the guardrails that catch it if it misbehaves.
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.
Build vs. Buy for Verifying Every Device That Connects In
What zero-trust device and identity verification actually requires, what a platform gives you over a homegrown check, and how to decide between them.
Cleaning Up Feature Flags After a Model Rollout
Why flags controlling model version routing tend to pile up after every rollout, and a routine for retiring them before they become their own liability.
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.
Why Your Agent Loop Feels Slow, and How to Fix It
A diagnostic guide to finding where latency actually comes from in an agentic system, and which fixes help each cause instead of masking it.