Stale flag management
Stale flag management helps you maintain a clean codebase by identifying feature flags that Amplitude fully rolled out or rolled back for a set period.
How flags and experiments become stale
A feature flag or experiment becomes stale when it meets one of these conditions:
- Rolled out: Amplitude rolled out the flag or experiment to 100% of users for more than 30 days.
- Rolled back: The flag or experiment is inactive or set to 0% rollout for more than 30 days.
After a flag or experiment becomes stale, you can remove the flag from your codebase and archive it in Amplitude.
Viewing stale flags and experiments
Stale status badge
In the list of your flags or experiments, a status badge appears next to each stale flag. Hover over the stale badge to view when the flag became stale and update the stale date if needed.
Filtering in the table view
In the Feature Flags or Experiments list, the stale status appears as a secondary status badge next to the primary status. Select Stale to filter the table to show only stale flags.
Working with stale flags
Hover over the Stale badge on a flag to open a pop-up that shows when the flag became stale and its rollout status. From the pop-up, you can archive the flag or unmark the flag as stale.
Default stale date
By default, Amplitude marks a flag or experiment stale 30 days after the last update. For example, if you set a flag's rollout to 100% on March 1 and make no other updates, Amplitude marks the flag stale on March 31. If you deselect the stale value, Amplitude treats the flag as permanent and doesn't mark the flag stale again.
Updating stale dates
If you change the rollout after you set a stale date, you can update the stale date. For example:
- On January 3, you roll out a flag to 100% and set the stale date to February 3.
- On January 5, you add a segment with 0% rollout to the flag.
- When you save, Amplitude prompts you to update the stale date.
Notifications
You can receive notifications when flags or experiments become stale. If you own a flag or experiment, Amplitude sends you a daily message listing any flag or experiment that became stale in the previous 24 hours.
You can receive notifications through:
- Email.
- Slack.
Configure notification preferences in your organization settings.
Bulk archiving stale flags and experiments
After a flag or experiment becomes stale, remove it from your list:
- Remove the flag from your codebase: Remove the feature flag code from your application. If you deployed the flag across multiple services or codebases, remove it from each location.
- Archive the flag or experiment in Amplitude: Archive the flag or experiment in Amplitude to remove it from your active flags list.
To remove a stale item from Amplitude
- Select the flag or experiment you want to remove.
- Click Archive.
Handling multiple variants
If a flag or experiment has multiple variants and one variant has a 100% rollout, keep that variant in your application and remove the others. This step keeps the winning variant active.
Using Amplitude AI or MCP to manage stale flags
You can use Amplitude AI or Amplitude MCP to highlight stale flags and either update the stale date or archive the flag. In the agent window, ask Amplitude to generate a list of your stale flags. After Amplitude returns the list, continue the conversation to archive or modify your stale flags.
Was this helpful?