Agent Distraction: Coding Agents Chase 6% of the TODO Comments They Read. Over Half Those Bugs Are Still Open.
Google measured what stale TODO comments cost its coding agents. Deleting dead ones fixes 41% of the detours. The rest need a scope rule.
On 6 November, the Google Developers Blog published a study of what its authors call agent distraction: a coding agent reads a comment a human would skim past, treats it as a call to action, and starts work nobody requested. The proxy Google used was the humble TODO with a bug number attached. Agents ignored 94% of the ones they read. When they followed one without being asked, the session was associated with 77% more tokens and roughly double the wait.
Most coverage stopped at the headline: stale TODOs derail agents, so clean up your comments. The published figures support a narrower and more useful reading. The problem is rarer than the headline suggests, each instance costs more than the rate suggests, and more than half of the detours did not involve a stale comment at all.
What Google measured
Sam Saccone and Madhuri Garikapati worked from distributed traces of agent sessions inside Google, covering thousands of engineers and hundreds of millions of agent steps. They looked for inline comments of the form TODO(bug/...) and FIXME(bug/...). Those are convenient to study because the comment names a ticket, and the ticket has a status that can be checked.
For every such comment an agent read, they compared two things: the state of the linked bug, and the developer's prompt. If the agent then took an action aimed at that bug ID, and the developer had never mentioned the bug, the session counted as an unprompted detour.
- 13% of file-reading sessions exposed the agent to at least one bug-referencing TODO or FIXME.
- In 6% of encounters the agent acted on the referenced bug. In 94% it carried on.
- 83% of those actions were unprompted.
- Of the unprompted detours, 41% chased tickets that were already closed (32% fixed, 9% obsolete or won't-fix), 2% hit duplicate or restricted tickets, and 57% chased bugs that were still open.
- Among the open-bug detours, 61% stopped at looking the bug up. 39% went on to edit code.
Agent distraction by the numbers: multiply the funnel
The post gives each percentage against its own denominator and never multiplies them. Doing so gives a rough base rate. The arithmetic below is ours, and it mixes a per-session figure with a per-encounter one, so read it as an order of magnitude.
| Stage | Published rate | Share of file-reading sessions |
|---|---|---|
| Agent reads a bug-referencing TODO or FIXME | 13% of sessions | 13% |
| Agent acts on the referenced bug | 6% of encounters | about 0.8% |
| The action was unprompted | 83% of actions | about 0.65% (1 in 150) |
| Detour chased a closed ticket | 41% of detours | about 0.27% |
| Detour chased an open bug | 57% of detours | about 0.37% |
| Open-bug detour that edited code | 39% of open-bug detours | about 0.14% (1 in 700) |
At a team scale of 10,000 file-reading sessions a month, that is around 65 detours, 27 of them after closed tickets, and 14 that end with edits to code outside the request. Nobody would call that an emergency. It is a steady tax, and the last line is the one that deserves attention, because an unrequested edit inside a larger diff is exactly what a tired reviewer approves.
Stale comments and live comments are two different failures
The 41% and the 57% look like one problem and are two.
In the closed-ticket case the codebase is wrong. The comment points at work that was finished or abandoned, sometimes years ago. One of Google's examples is an agent investigating an unrelated issue that opened a test file, found a TODO for a bug fixed in 2023, and spent several steps on it. Deleting the comment removes the trigger.
In the open-bug case the codebase is right. The TODO is accurate, the bug is real, and someone may own it. The agent's error is one of scope: it decided that a true statement in a file was an assignment. Google's second example shows this. An agent on a bug investigation found a TODO, ran a series of code and knowledge searches, and changed code to address it. When the developer objected, the agent agreed the wider scope was a mistake.
No amount of comment cleanup reaches the second case, because there is nothing stale to clean. A team that deletes every dead TODO and stops there has addressed, on Google's figures, about two-fifths of the detours.
Why each detour costs more than the rate suggests
Google ran a fixed-effects regression that controlled for the developer, codebase complexity, task type, model tier, files read, prompt length and the step at which the bug reference appeared. Sessions with an unprompted bug detour were associated with 70% more steps, 77% more tokens and 105% more wait time.
Two cautions. This is an association in observational data, and sessions that wander may differ in ways the controls miss. The measured cost also stops at the session boundary. It leaves out the developer who notices the drift and has to steer back, the reviewer who has to work out why a diff touches an unrelated file, and the cases where no one notices.
Token spend is the smallest of these. If one session in 150 costs 77% more tokens, the fleet-wide bill rises by about half a percent. The wait time and the review burden land on people, and the 1-in-700 unrequested edit lands on production if review misses it.
Count your own exposure first
Google's 13% reflects Google's habits: a convention of tagging TODOs with bug IDs, in a codebase old enough to have accumulated many. Your number could be far lower or far higher. It takes a minute to find out how many ticket-referencing comments your repository holds and how old they are.
#!/usr/bin/env bash
# List TODO/FIXME comments that carry a ticket reference, oldest first.
# Matches TODO(bug/123), TODO(b/123), FIXME(PROJ-123), TODO(#123).
# Uses GNU date; on macOS replace the date call with: date -u -r "$when" +%Y-%m-%d
git grep -nE '(TODO|FIXME)\(([a-z]+/|#)?[A-Z]*-?[0-9]+\)' |
while IFS=: read -r file line _; do
when=$(git blame -L "$line,$line" --porcelain -- "$file" |
awk '/^author-time/ {print $2}')
printf '%s\t%s:%s\n' "$(date -u -d "@$when" +%Y-%m-%d)" "$file" "$line"
done | sortThe output is a dated list. Anything older than your ticket tracker's typical resolution time is a candidate for a status check. Joining the list against the tracker's API to mark closed tickets is the natural next step, and it is the same cross-reference Google used for its measurement.
Fix one: retire dead references, carefully
Google built a cleanup agent that scans for bug references whose tickets are marked fixed or obsolete. The authors are clear that a closed ticket was not enough to justify deletion. A TODO can outlive its ticket and still describe something true about the code. Their agent checked bug history, file history and surrounding code changes, sometimes going back years, and only proposed a removal once it had confirmed the comment's intent was obsolete.
Over six months the cleaner removed thousands of references, and human reviewers accepted more than 95% of its changes. The post also points to presubmit analysers and whole-corpus scanners as ways to stop new dead references piling up.
For a smaller team the same idea fits in three steps:
- Run the inventory, join it to ticket status, and open one pull request per directory that removes references to closed tickets. Keep a human reviewer on every one.
- Add a presubmit check that rejects a new TODO without a ticket reference, so every future comment has a status that can be looked up.
- When a ticket closes, search for its ID in the codebase as part of closing it.
Fix two: tell the agent that comments are not tasks
The open-bug detours need a rule about scope. Most coding agents read a project instruction file at the start of a session, and that is the cheapest place to state one.
## Comments are context, not tasks
- A TODO, FIXME or HACK comment describes someone else's backlog.
Do not start work on it unless the request names it or its ticket.
- Do not look up a ticket referenced in a comment unless the request
depends on it.
- If a comment looks relevant to the task, mention it in your summary
and ask before widening the change.
- Keep the diff to the files the request needs. List anything else you
noticed under "Not done".Google's post does not test instruction-level rules, so there is no published figure for how far this cuts the 6%. Treat it as a hypothesis and measure it. The signal is simple to log: sessions where the agent searches for or queries a ticket ID that never appears in the prompt. Count them for a fortnight before the rule and a fortnight after.
A second control sits in review. Ask the agent to end every change with a short list of what it noticed and left alone. That turns a silent detour into a visible suggestion, and it keeps the useful half of the behaviour: an agent that spots a live bug near the code it is editing has found something worth a human's decision.
What the study does not tell you
- It covers one company. The agents and models are unnamed, and the session count and time window are not given.
- Bug-tagged TODOs are a proxy chosen because they can be checked against a tracker. Untagged TODOs, outdated design documents, stale README sections and dead feature flags are the same kind of trap and are not counted, so the real rate of distraction is probably higher than the measured one.
- The 94% ignore rate may not transfer. A different agent, prompt style or model tier could follow comments more or less readily.
The cleanup numbers are self-reported, with no independent replication so far. InfoQ's summary adds reactions from practitioners and no new data.
The durable point is about audience. A codebase used to have one kind of reader, who knew which comments to distrust. It now has a second reader with no such instinct and a habit of acting on what it reads. Every piece of text an agent can open during planning, from comments to wikis to old tickets, is input to its next decision, and teams will start maintaining that text with the same care they give to code that runs.
Frequently asked questions
Related reading
AWS Emulator Passes 56.5% of Its Fidelity Tests and Ships Releases 90 Minutes Apart. Pin One Before CI Trusts It.
AWS's agent-built local emulator publishes its own failing tests. Here is what a fidelity score counts, why patch releases can change your results, and how to pin it in CI.
Zero Data Retention Covers a Request Path, Not a Vendor. The Fireworks Breach Reached the Paths Outside It.
The Fireworks AI breach exposed Notion AI transcripts despite a zero data retention commitment. The promise applied to inference requests. The transcripts sat in a feature that stores by design.
Developer Trust in AI Is Conditional: Only 6.6% Trust It With Important Decisions
Stack Overflow's 2026 survey: 80% use AI for an hour a day, 48% trust it only when they can verify it, 6.6% trust it with important decisions. Verification cost sets the ceiling.