Vega for flag cleanup
GitHub account required
Vega for flag cleanup requires a connected GitHub account to create pull requests. To learn how to connect GitHub, read Connecting Vega to GitHub.
Overview
Vega is LaunchDarkly’s AI-powered agent. To learn more about Vega, including eligibility and pricing, read Vega.
Vega can help you identify and remove stale feature flags from your codebase. Stale flags accumulate technical debt, and most teams don’t clean them up because the process is manual and error-prone. Vega automates safety checks and code changes, removing the main barriers to keeping flag counts manageable.
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.
- Click a flag in the Flags list, go to the Flag Cleanup tab, and click New Cleanup.
Once started:
- The cleanup job appears under the Flag Cleanup tab.
- Vega checks that the flag has only a single variation being evaluated across all critical environments. If multiple variations are still active, Vega won’t proceed with the cleanup task.
- If the check passes, Vega creates a GitHub pull request to remove the flag from your code.
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 notifies you. You can still tell Vega to clean up the flag if you’d like to proceed anyway.
Tracking cleanup status
Vega tags flags during the cleanup process. You can filter by these tags in the Flags list to track progress:
If Vega determines the flag is still active (multiple variations in use across critical environments), it will notify you and stop. If Vega cannot find the flag in your code repositories, it will also notify you.
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.