Uber says AutoClean has removed more than 16,000 feature flags and cleaned up over one million lines of code across its monorepositories. The system combines AI-assisted decisions with deterministic code transformations, CI and further validation; a human reviewer from the owning team makes the final call. Uber’s engineering account describes the totals as cumulative and built up over the past few years.
How AutoClean turns a flag into a code change
Uber describes AutoClean as a continuously running system that finds flags in its feature-flag management system that it considers safe to remove. A feature flag is a switch in code; once its value is settled, the code can often be simplified around that value. Uber’s description of the workflow and code example shows how the system handles that cleanup.
In the example, flipr.GetBool("new_order_pipeline", false) is replaced with true. AutoClean then follows that value through a function call: it reaches processOrder, makes the useNewPipeline parameter constant, and allows an obsolete else branch to be removed.
The work is divided between AI and deterministic tools. An AI agent makes broader decisions about propagating a flag’s value through the code. PolyglotPiranha handles Boolean-algebra and conditional simplification in a predictable, rule-based way. That division lets the system reason about where a value flows while relying on fixed transformations for the simpler rewrites.
Why does CI have more gates?
When a proposed change fails continuous integration (CI), Uber says deterministic fixers run before agent-based fixers. Fixers also have limited editing scopes: a test fixer, for example, can change test files but not production code.
A passing CI run is followed by static checks and CodeCourt validation. The extra checks address problems that tests may miss, such as removing a test that protects existing behavior or stopping after an incomplete simplification. CodeCourt checks properties including semantic preservation, avoiding drift from the intended change and preventing agent artifacts. If a check fails, the diff is abandoned.
Changes that pass those gates go to the team responsible for the code. A human reviewer there decides whether the flag is ready to remove.