TL;DR
- Nearly 1 in 7 coding sessions expose agents to obsolete TODO or FIXME bug references, with agents taking unprompted action 6% of the time
- Unprompted bug detours add 70% more steps, 77% more tokens, and 105% more wait time per session when agents chase closed or obsolete issues
- Google deployed automated agents to scan codebases and remove thousands of dead TODOs with over 95% acceptance from human reviewers
- Sessions with obsolete
- 13% of file-reading sessions
- Unprompted agent
- 6% of encounters with TODO
- Overhead per wasted
- 70% more steps, 77% more tokens
What happened
Google's engineering team analyzed patterns across millions of monthly AI agent coding sessions and identified a systematic problem: agents frequently pursue work triggered by obsolete code comments that developers never asked them to address. The research measured how often agents encounter inline TODO(bug/...) and FIXME(bug/...) comments while reading files, and whether those comments lead to tangential work.
The scale of distraction
Nearly 13% of file-reading sessions expose agents to bug-related TODO or FIXME comments. While agents ignore the comment in 94% of cases, the remaining 6% of encounters trigger subsequent action. Crucially, 83% of those actions are completely unprompted—the developer did not ask the agent to investigate or fix the referenced bug.
When agents do pursue these detours, they split into two failure modes. Over 41% chase closed dead ends: bugs already fixed and verified (32%), obsolete or won't-fix tickets (9%), or duplicates and restricted issues (2%). In the remaining 57% of unprompted detours, the referenced bug is still open, and agents expand their work scope to investigate or modify code the developer never requested changed.
The cost per session
Google controlled for developer, codebase complexity, task type, model tier, number of files read, initial prompt length, and the step where the bug reference appeared, using multi-way fixed-effects regression. The analysis shows that unprompted bug detours impose measurable overhead: per session, agents spend 70% more steps, 77% more tokens, and 105% more wait time when they fall into these traps.
Real examples from the wild
The report describes two trajectories from actual sessions. In the Obsolete Detour case, an agent investigating an unrelated bug encounters a TODO referencing a bug fixed in 2023 but never removed from the codebase. The agent then spends multiple steps digging into the history and details of the already-resolved issue. In the Eager Agent case, while investigating a different bug, the agent spots a TODO, decides unprompted to fix the associated code, and modifies ModelDownloaderV1 across multiple code search and knowledge queries before the developer challenges the scope creep. In both cases, human intervention was required to correct the agent's misdirected effort.
How Google addressed it
Google deployed automated agents to scan entire codebases and identify bug references marked as fixed or obsolete. The agents went further, examining bug history, file history, and codebase changes spanning years to confirm whether each TODO was truly load-bearing or dead code. Only when the agent could verify that the TODO and its intent were obsolete did it send a change for human review to delete it. Over the last six months, this multi-layer approach removed thousands of obsolete references with over 95% acceptance from human reviewers.
Implications for codebases at scale
As agents take on more ambitious problems, maintaining agent-friendly codebases requires attention beyond the code in the critical path. Forgotten corners of the codebase now carry a significant performance and cost tax on agents. Google suggests that projects once deprioritized for code cleanup—lingering technical debt—should be re-evaluated given the scale at which agents now operate. Tooling such as presubmit analyzers, corpus scanners, and automated cleanup agents offer scalable solutions to reduce distractions and enable healthier codebases.
Source
Google Developers Bloghttps://developers.googleblog.com/agent-distraction/AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.
- #aiagents
- #codequality
- #developerproductivity
- #technicaldebt