InfoQLeela Kumili2 min readintermediate
DoorDash Uses Multi Agent LLMs to Clean up 60,000 Feature Flags
Summary
DoorDash built a two‑phase, multi‑agent LLM system (Claude Sonnet orchestrator + Claude Opus cleanup agents) that automatically removes stale feature flags from 623 repos. In a 50‑flag pilot it generated usable PRs for 45 flags at ~14 min and $4.79 each, with 100 % success on simple flags and no regressions.
- LLM agents can reliably perform non‑trivial refactorings when paired with strict validation (build, tests, coverage, static analysis).
- Semantic patterns like dependency‑injected flag wrappers defeat pure AST‑based tools; prompting LLMs to reason about call‑graphs can fill the gap.
- Isolating work in Git worktrees and enforcing timeouts prevents state bleed between concurrent agents.
- Cost‑per‑cleanup (~$5) and time savings (≈1 h manual vs 14 min automated) make AI‑driven cleanup economically viable at scale.
Feature‑flag debt is a hidden source of technical debt in large codebases. Automating its removal with LLMs shows a practical path to scaling code hygiene without sacrificing safety, and provides a template for other semantic refactoring problems.
8/10


