Skip to content

Keeping your flags tidy: names, owners and clean-up

Feature flags are easy to create and easy to forget. Old flags clutter code and confuse new teammates. A few habits keep them under control.

Name them so people can understand them

BetterWorse
new_checkout_flowflag1
enable_dark_modetest
max_upload_sizenewCheckoutFlow (inconsistent style)

Keep keys in lower case with underscores and describe what the flag does. Use a readable name and a description in the dashboard, too.

A flag has a life

  1. CreateBuild and test behind the flag in Development.
  2. StageEnable in Staging and test both on and off.
  3. ReleaseEnable in Production with a gradual rollout.
  4. Reach 100%Leave it there while you confirm all is well.
  5. RemoveDelete the flag from your code.
  6. Archive and deleteArchive it in the dashboard, then delete after a retention period.

Put it in the review

  • Ask for an owner and a planned removal date when a flag is created.
  • Include the clean-up in the same plan as the feature.
  • Review the list of flags at 100% regularly and remove the ones that are done.

The audit log records who changed what and when, which helps when you are not sure why a flag exists. See the user guide.