DoorDash Tests Multi-Agent AI for Feature Flag Retirement
DoorDash reports that a multi-agent LLM workflow can turn stale feature flag removal into reviewed, validated pull requests, while keeping engineers involved before code changes begin.

A controlled workflow for a persistent codebase burden
Feature flags support experimentation and controlled releases, but they can become a substantial maintenance burden once their purpose has ended. DoorDash says its experimentation platform spans more than 60,000 flags in about 623 repositories, with roughly 2,300 additional flags created each month. It identified over 1,000 candidates for removal under its stale-flag criteria: no modification for 90 days, continuing code references, no archived or retired status, and no explicit exclusion.
The engineering challenge is not simply deleting a switch. DoorDash uses dependency-injected wrappers, which can separate a flag’s declaration, its client invocation and the associated application behavior. As a result, removing even a Boolean flag may require coordinated edits in five to 20 files, including test code. The company concluded that syntax-oriented tooling did not sufficiently capture these semantic links in its environment.
Its alternative is a two-stage, multi-agent process built with Google’s Agent Development Kit. First, an orchestrator using Claude Sonnet collects stale-flag tickets from Jira, searches relevant repositories and obtains experimentation metadata through Model Context Protocol. That metadata includes details such as rollout percentage and the intended value. Crucially, an engineer examines the resulting report and confirms the target value before automated code editing starts.
In the second stage, Claude Opus agents work in separate Git worktrees. Up to four can operate concurrently for a repository. They identify references, select an approach to the removal, update implementation and tests, and then run the required checks. DoorDash’s gate includes builds, tests, JaCoCo patch coverage and Detekt static analysis; a pull request is created only when those checks succeed. Agents are limited to one hour, while Gradle is run without its daemon to avoid shared state across worktrees.
In an assessment covering 50 stale flags, DoorDash says 45 produced usable pull requests. The reported average was 13.8 minutes and $4.79 for each cleanup, versus an estimated one to two hours of manual work. Thirty-one changes merged on the first attempt, 14 needed revision and five required engineer intervention. The single-pass result declined with complexity: all simple cases succeeded immediately, compared with 94% of medium cases and 85% of complex cases.
The intervention cases point to an important boundary for the system. They involved long call paths and parameters passed across interfaces, areas where understanding and changing software structure becomes harder. DoorDash reported no bugs or regressions among the 50 evaluated changes, but its workflow remains deliberately supervised at the decision point and rigorously checked before a pull request is opened.
Next, the company plans confidence scoring to distinguish lower-risk work and a post-removal review aimed at residual quality problems, such as variable names that no longer describe the code. The approach illustrates a practical use of agentic coding systems: not autonomous deployment, but narrowing repetitive maintenance work into isolated, reviewable and test-verified changes.
Key points
- DoorDash identified more than 1,000 stale flags within an experimentation estate of over 60,000 flags.
- Engineer confirmation of the target value is required before agents begin modifying code.
- Agents work in isolated Git worktrees and must pass build, test, coverage and static-analysis checks before a pull request is opened.
- Across 50 evaluated flags, 45 resulted in usable pull requests, while five needed direct engineer intervention.
