A leading product engineering company, creating adaptive software solutions to improve operations, providing businesses with expert development services from across domain.
A leading product engineering company, creating adaptive software solutions to improve operations, providing businesses with expert development services from across domain.
DoorDash automated feature flag cleanup with AI agents: 45 usable PRs from 50 stale flags at $4.79 and 13.8 minutes each. How the system works.

Every team that uses feature flags accumulates dead ones: flags whose feature shipped months ago, still wrapped around code nobody dares delete. DoorDash has published the most detailed account yet of automating feature flag cleanup with AI agents — and the numbers make a strong case that stale flags are one of the best first jobs to give a coding agent.
According to DoorDash's engineering write-up, summarised in detail by ZenML's LLMOps database and InfoQ, the company's experimentation platform manages more than 60,000 flags — DoorDash calls them dynamic values — across roughly 623 repositories. More than 1,000 were stale, and about 2,300 new flags are created every month. Removing one by hand takes an engineer one to two hours, because it means tracing every call site, collapsing the branching logic and updating tests.
DoorDash defines a flag as stale when it has not been modified for 90 days, is still referenced in code, is not archived and is not on an exclusion list. A daily job files a Jira ticket for each one and assigns it to the flag's creator. That gave the automation a queue to work from.
The system runs in two phases, with a person between them.
Isolation turned out to be essential. DoorDash reports that early experiments without separate worktrees produced race conditions and corrupted diffs.
DoorDash evaluated the system on its 50 most recent stale flags across several Kotlin repositories. It produced usable pull requests for 45 of them. Time and cost grew with complexity:
| Complexity | Flags | Average time | Average cost |
|---|---|---|---|
| Simple (one check, 1–2 files) | 6 | 7.5 min | $2.69 |
| Medium (3–5 files, some tests) | 18 | 10.4 min | $3.46 |
| Complex (nested logic, cross-file) | 26 | 17.7 min | $6.20 |
| All | 50 | 13.8 min | $4.79 |
Some complex outliers approached 40 minutes and $19. Against one to two hours of engineer time per flag, that is a large saving even before counting the context switching a manual cleanup costs. ZenML rightly cautions that the figures come from Kotlin repositories and may not transfer directly to other languages or codebases.
Most agent failures come from ambiguity. On private codebases, the best agents solve well under half of realistic tasks, and missed requirements and integration errors are the leading causes. Flag removal avoids most of that:
That profile — known outcome, mechanical verification, small reversible changes — is the same one that let Duolingo auto-approve a slice of its pull requests and let GitHub run an agent-assisted migration one slice at a time.
DoorDash's next step is a confidence score that could auto-approve the lowest-risk cases, such as a fully rolled-out boolean whose production value already matches the code default. That is a sensible direction, but only once the plain version has a track record.
If your codebase carries years of dead flags and your team never has time to remove them, our AI engineering services team can set up the same plan-confirm-remove pipeline against your repositories and CI.
A feature flag should be removed once its feature is fully rolled out or abandoned and the flag's value is no longer changing. DoorDash treats a flag as stale after 90 days without modification, provided it is still referenced in code and not archived or excluded.
Find stale feature flags by querying your flag platform for flags unchanged beyond a set period and fully rolled out, then searching code for remaining references. DoorDash runs a daily job that files a Jira ticket for each stale flag and assigns it to the creator.
AI agents can remove feature flags safely when a person confirms the target value, each change runs in an isolated branch or worktree, and build, test, coverage and lint checks must pass before a pull request opens. DoorDash got 45 usable pull requests from 50 flags.
DoorDash reported an average of $4.79 and 13.8 minutes per flag, ranging from $2.69 for simple cases to $6.20 for complex ones, with outliers near $19. A manual cleanup took an engineer one to two hours.
Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.
11th Floor, O-Hub, Chandaka Industrial Estate, Infocity, Bhubaneswar, Odisha 751024
Level 4, 11 York Street Sydney Startup Hub Sydney, NSW – 2000
30 N. Đinh Nghệ, Phước Mỹ Sơn Trà, Đà Nẵng / Da Nang City – 550000
Level 25, AIDP Business Tower, Dubai Marina, United Arab Emirates
50 Beauchamp Street, Wellington, WGN 5028, New Zealand