How it works
To start a flag cleanup, you can either:- Go to the Flags list, click the three-dot overflow menu on any flag, and select Vega cleanup.

The three-dot overflow menu on a flag, with the Vega cleanup option.
- Or, click a flag in the Flags list, and then click Start cleanup in the Vega cleanup section of the sidebar.

The Vega cleanup section on a flag's detail page, with the Start cleanup link.

The Flag cleanup modal, showing staleness analysis and the Start cleanup button.
How Vega determines if a flag is safe to clean up
Vega follows this procedure to determine whether a flag is safe to remove:- Queries your critical environments: Vega identifies all environments marked as critical for your project.
- Checks flag evaluations: Vega checks the flag’s evaluations in these environments to confirm that the flag is “stale,” meaning it serves the same variation across all critical environments.
- Takes action:
- If the flag is stale, Vega proceeds with code cleanup and creates a pull request.
- If the flag is not stale, Vega still proceeds with code cleanup and creates a pull request. It lists the concern as a warning in the pull request description. You decide whether to merge the pull request.
Tracking cleanup status
You can view a flag’s cleanup status in the Vega cleanup section on the flag’s detail page sidebar:
The Vega cleanup section on a flag's detail page.

A completed Vega flag cleanup, showing the PR history and Vega's summary.
vega-pr-* tags.
If Vega has concerns about removing the flag, such as the flag still serving more than one variation across your critical environments, it opens the pull request and lists each concern as a warning in the pull request description. To learn more, read Cleanup warnings. If Vega cannot find the flag in your code repositories, it does not open a pull request.
Identify Vega pull requests
Vega uses the following conventions to identify the pull requests it creates. You can use these to find and monitor them in GitHub:- The pull request title begins with the
[LaunchDarkly]prefix by default. To change the prefix, update Pull request title prefix in the “Pull request details” section of your project’s Automations settings page. - The pull request includes the
launchdarkly-prlabel. Older pull requests have thevega-prlabel instead. - Cleanup pull requests also include the
flag-cleanuplabel, and their branch names begin withlaunchdarkly/flag-cleanup-. Older cleanup pull requests have branch names that begin withvega/flag-cleanup-.
launchdarkly-pr label with GitHub’s own notification tools. For example, GitHub’s Slack integration can notify a channel when pull requests are opened in a repository.
If Vega finds references to a flag in more than one repository, it opens a separate pull request in each repository. Each pull request description includes a link to the Vega conversation that created it, which means you can trace related pull requests back to the same cleanup.
Automated flag cleanup
In addition to starting cleanups manually, you can have Vega clean up flags on a recurring schedule. Automated flag cleanup runs once a day in each project where you turn it on, starting with the oldest flags that are ready for code removal. You turn it on in the project’s Automations settings. Automated flag cleanup requires the Release Autopilot add-on. To learn how to turn on, review, and turn off automated flag cleanup, read Auto-cleanup.Supported version control
Vega currently supports GitHub only for creating pull requests. To learn how to connect GitHub, read Connecting Vega to GitHub.Related resources
- Vega for general information about Vega, including eligibility and pricing.
- Customizing Vega with repository instructions to improve Vega’s cleanup results by adding a
CLAUDE.mdorAGENTS.mdfile to your repository. - Flag cleanup custom agent for GitHub Copilot for an alternative approach that uses GitHub Copilot to clean up flags.