Flag cleanup. It’s one of the most annoying things about feature flags. The code cleanup is straightforward enough, but the task management, context switching, waiting for tests to complete, and code review all makes it a frustrating chore and something we want to put off.
Now, many of the feature flagging vendors recognize this and have created little helpers. Usually they’re CLI tools that highlight mentions of feature keys in your code, or some also show you which flags haven’t been accessed in a while. But these only make things less painful, you’re still on the hook to do the work.
So that’s the part we wanted to solve with AI, removing the flag code itself. That way you can put flag maintenance on autopilot.
We detect stale flags, and you can either get alerted to this in Slack and manually clean up the code, or the bot can go ahead and remove the flag code for you. The cleanup bot operates as a GitHub integration. When it runs, it searches for usage of the Bucket SDK in the codebase and identifies where specific feature keys are used. LLMs are employed to refactor the code to remove the flag and eliminate codepaths that become unreachable.
We’ve been running this in production ourselves for a few months alongside a few early-access partners. For over a month now it has been getting everything right in the changes we've been reviewing —consistently good PRs that can be merged without edits.