Google Finds Stale Tech Debt Derails Coding Agents by 70% More Steps

By Sergio De SimoneOriginal title: 谷歌发现,技术债务会通过“智能体分心”导致编码智能体偏离正轨
78AI Score

Drawing on distributed traces from thousands of engineers and hundreds of millions of agent operations, Google found that about 13% of coding-agent sessions encounter inline TODO/FIXME references, and in 6% of sessions the agent acts on the referenced defect even though most prompts never mention it. These unrequested detours add 70% more steps, 77% more token consumption and 105% more waiting time per session. Google built scanner agents to clean up stale TODOs, removing thousands of references over six months with over 95% human reviewer approval.

Full Report

In a recent article, Google senior software engineer Sam Saccone and senior data scientist Madhuri Garikapati highlighted the cost of agent distraction: AI coding agents get thrown off track by stale technical debt (such as outdated TODO comments, references to deprecated bugs, and obsolete specifications), and consequently start performing "side quests" that users never asked for.

Outdated specifications, long-resolved bugs, and stale documentation no longer just slumber in forgotten corners of the codebase; they are inadvertently pulled into context and indirectly mislead the next generation of coders—these agents.

According to the authors, at best, agent distraction increases token consumption and execution time; at worst, it can cause agents to produce "incorrect logic and decisions." To study its impact, they focused their research on TODO(bug/...) comments—which, as they point out, "often persist long after the underlying defect has been fixed or abandoned."

By cross-referencing each TODO an agent encounters with that TODO's bug status and the user prompt, we can automatically distinguish valid work from pointless detours at scale.

By analyzing distributed tracing data from thousands of engineers and hundreds of millions of agent operations, Google found that in about 13% of sessions, agents encountered inline TODO/FIXME references, and in 6% of those cases, agents took action on the referenced defect. In most cases, the prompt did not even mention the referenced defect. Furthermore, among these unprompted "detour" operations, in 41% of cases the agent worked on tickets that had already been closed; in 57% of cases, they worked on defects that were still open but outside the scope of the developer's request, which the investigators classified as "scope creep."

The researchers used a multi-way fixed-effects regression model (with standard errors clustered by developer) and found that these redundant operations imposed additional overhead per session: 70% more steps, 77% more token consumption, and 105% more waiting time.

To address this problem, Google developed scanning agents to identify and clean up outdated TODO items in codebases. In some cases, these agents needed to examine years of Git history to confirm that a TODO and the intent behind it were both obsolete. Only after confirming this would they submit a pull request (PR) to remove the outdated reference from the codebase.

Thanks to this multi-layered approach, our TODO cleanup tool has successfully removed thousands of genuinely outdated references over the past 6 months, with an approval rate of over 95% from human reviewers.

The researchers concluded that tools such as pre-commit analyzers, codebase scanners, and automated agents help mitigate the "agent distraction" phenomenon, thereby improving the efficiency of AI coding agents.

Commenting on this finding, X user Tulasiram remarked: "This is a reminder that comments are part of the context too." Ryan White emphasized:

This is just junior developer behavior repeating itself at machine speed. Leave a misleading comment, and someone will spend a whole day on it. Except now it happens 40 times an hour, and you pay token fees for it.

On LinkedIn, user Awais Raza expressed optimism about the possibility of mitigating agent distraction:

The fact that the TODO cleanup tool earned over 95% user approval is quite revealing: it shows that cleanup can be automated without losing human judgment.

Finally, Muhammad Zohaib further extended this point, noting: "The same may be true for websites: outdated pages and contradictory information make it harder for AI systems to pick the right answer."

Disclaimer: This article is a translation by InfoQ and may not be reproduced without permission.

Original link: https://www.infoq.com/news/2026/11/google-agent-distraction/