Prompt
feature flag cleanup after launch
Latest observation
Oct 13, 2026
OpenAI APIWeb search: off
After launch, feature flags should be cleaned up deliberately so they don’t accumulate into “flag debt.” A good cleanup process looks like this:
1. Confirm the flag is fully rolled out
- Verify the feature is enabled for all intended users/segments.
- Check metrics, logs, and support feedback for any issues.
- Make sure there’s no active rollback plan still depending on the flag.
2. Remove dead code paths
- Delete the old branch controlled by the flag.
- Keep the codebase on the “new” path only.
- If the flag was used in multiple services, clean each one up.
3. Remove the flag definition
- Delete it from your feature flag service/config.
- Remove any environment variables, config entries, or database records tied to it.
- If the flag is shared across clients, update them too.
4. Clean up tests
- Remove tests that only existed for the old path.
- Update unit/integration tests to reflect the permanent behavior.
- Add tests for the final behavior if needed.
5. Remove observability tied to the flag
- Delete temporary metrics, dashboards, alerts, and logs created for the rollout.
- Keep only monitoring that is still useful long-term.
6. Update documentation
- Remove mentions of the flag from docs, runbooks, release notes, and design docs.
- Record the launch completion if your team tracks flag lifecycles.
7. Make cleanup part of the workflow
- Assign an owner and expiry date when a flag is created.
- Track flags in a registry or ticketing system.
- Schedule cleanup in the same sprint or shortly after launch.
Good practice
Use a naming convention and metadata like:
- owner
- created date
- intended removal date
- related ticket
- rollout status
If you want, I can also provide:
- a feature flag cleanup checklist
- a Jira ticket template
- or a code review policy to prevent stale flags.