DoorDash Automates Code Cleanup for Under $5

TL;DR: DoorDash built a system of AI agents to automatically find and remove old code from its systems. In a trial, the system successfully created fixes for 90% of targeted issues, costing just $4.79 and taking 14 minutes each.
Key facts
- Category
- AI
- Impact
- High
- Published
- Source
- InfoQ
Full summary
DoorDash is using a multi-agent AI system to automatically find and remove old code, completing cleanups for under $5 each.
DoorDash has developed a novel system using multiple large language model (LLM) agents to tackle a persistent source of technical debt: stale feature flags. According to a report from InfoQ, the company was managing over 60,000 flags across more than 600 code repositories, a scale that makes manual cleanup inefficient and costly. The AI-driven system was designed to automate the process of identifying and safely removing this obsolete code. In an initial evaluation on 50 flags, the system demonstrated remarkable efficiency, successfully generating usable pull requests for 45 of them. Each successful cleanup took an average of just 13.8 minutes and cost only $4.79, showcasing a significant potential for cost and time savings.
The system's effectiveness comes from its multi-agent architecture, where different AI agents collaborate on distinct parts of the task. The workflow begins by analyzing live experimentation data to confirm a feature flag is no longer in use. Once a flag is identified as stale, a series of agents work in parallel to handle the code removal. They operate within isolated Git environments, called worktrees, to prevent interference with other development work. This process includes analyzing the codebase, drafting the necessary code changes, and running automated validation tests to ensure the removal doesn't break anything. A crucial final step involves a human engineer reviewing and approving the AI-generated pull request, keeping developers in control while automating the most laborious parts of the process.
This initiative places DoorDash at the forefront of a growing trend where AI is integrated more deeply into the software development lifecycle. While tools like GitHub Copilot assist developers with writing new code line-by-line, DoorDash's system represents a more autonomous approach focused on maintenance and refactoring. It treats AI not just as a coding assistant but as a specialized system capable of executing a complex, multi-step engineering task. This moves beyond simple code generation to address the entire lifecycle of code, including its eventual retirement. Such applications are critical for large engineering organizations where technical debt can slow down innovation and introduce instability.
The practical success of this project provides a compelling blueprint for other technology companies struggling with similar challenges. The specific metrics on cost and speed offer a clear business case for investing in AI-driven automation for software maintenance. For developers and CTOs, it signals a shift toward a future where AI agents handle routine but critical cleanup tasks, freeing up human engineers to focus on more creative and strategic work. The next phase to watch will be the expansion of these systems to tackle other forms of technical debt, such as updating outdated dependencies, refactoring complex code blocks, or even triaging production bugs, further embedding AI as a core member of the modern engineering team.
Why it matters
This is one of the first major case studies showing AI agents effectively tackling technical debt at scale. For engineering teams, it demonstrates a viable path to automate the tedious and error-prone process of cleaning up stale feature flags, freeing up developer time for new work.
Business impact
Automating feature flag cleanup directly translates to lower engineering costs and increased developer productivity. By reducing code complexity and the risk of bugs from old flags, companies can ship new products faster and maintain a healthier, more reliable codebase.
Tags
Related on Notifire
Related stories
Primary source: InfoQ