Google Finds Stale TODOs Can Send Coding Agents on Costly Detours

Google says obsolete bug references in source code can distract coding agents into investigating work that developers never requested. An analysis of millions of file-reading sessions found that these unprompted detours add substantial steps, tokens and wait time.
- Google found that 13% of file-reading sessions exposed agents to inline bug references.
- In 6% of encounters, agents took action targeting the referenced bug ID.
- Google says 83% of those actions were unprompted by developers.
- Unprompted detours added 70% more steps, 77% more tokens and 105% more wait time per session.
- Google's TODO cleaner removed thousands of obsolete references with more than 95% human acceptance.
Stale references become instructions for agents
In a Google for Developers blog post, Senior Staff Software Engineer Sam Saccone and Senior Staff Data Scientist Madhuri Garikapati describe how coding agents process information in a codebase. Text that humans may skim past, including obsolete specifications, resolved bugs and outdated documentation, can appear to an agent as a call to action during planning and research.
The researchers focused on inline TODO(bug/...) and FIXME(bug/...) comments. These references often remain in files after the underlying issue has been resolved or abandoned, while the linked bug ticket remains the canonical record. By comparing each reference with the ticket's status and the user's prompt, Google says it can distinguish relevant work from an unnecessary detour.
One in seven sessions encountered a bug reference
Google analyzed distributed traces from interactions involving thousands of engineers and more than hundreds of millions of individual agent steps. Of the millions of file-reading sessions studied, 13% exposed an agent to an inline bug reference.
Agents ignored the comment in 94% of encounters. In the remaining 6%, they took subsequent action targeting the bug ID, and 83% of those actions were unprompted by the developer. Google says 41% of the unprompted detours pursued closed tickets, including bugs that had already been fixed or verified and obsolete or won't-fix issues. Another 2% involved duplicate or restricted tickets.
In over half of the unprompted detours, the referenced bug was still open. Google says these cases expanded the task, with agents either looking up the issue or editing code to investigate or modify work outside the developer's request.
Unprompted detours increased time and token use
After controlling for developer, codebase complexity, task type, model tier, number of files read, initial prompt length and the step when the bug reference appeared, Google reports that unprompted bug detours added statistically significant overhead, with p<0.0001.
Per session, the detours were associated with 70% more steps, 77% more tokens and 105% more wait time. The post describes these diversions as ranging from minor investigations to scope creep that required human intervention.
One example involved an agent investigating an unrelated bug, finding a reference to an issue fixed in 2023 and then spending additional steps researching it. In another, an agent encountered a TODO and decided to fix the associated code without being asked. It ran multiple code search and internal knowledge search queries before changing ModelDownloaderV1 code. The human later challenged the expanded scope.
Google uses agents to clean obsolete TODOs
Google says it created agents to scan its codebases for bug references marked as fixed or obsolete. Finding those references was only the first step. The agents also examined bug history, file history and changes to the codebase, sometimes across years, before proposing deletion.
Only when an agent could confirm that both the TODO and its intended purpose were obsolete did it send a change for review. Google says its TODO cleaner removed thousands of obsolete references over the last 6 months, with human reviewers accepting more than 95% of the changes.
The findings suggest that maintaining code for agent use extends beyond the active execution path. Google says presubmit analyzers, whole-codebase scanners and automated coding agents for dead TODOs can help reduce distractions, and that cleanup work previously considered low value may need to be reassessed as agents operate across larger parts of a codebase.
Google for Developers: Agent Distraction- Google Developers Blog

