Stale TODO comments: the old notes coding agents now act on

Stale TODO comments now steer coding agents. Google found unprompted detours meant 70% more steps. Here is how delivery teams can clear them safely.

Old notes, new readers. A code snippet with two stale TODO comments highlighted and an arrow to a coding agent taking a detour the developer never asked for.
In this article7 min read

In brief

  • Google traced coding agents across thousands of its engineers and found that old TODO comments with bug links can pull an agent off the task it was given.
  • When an agent took an unprompted detour, the session needed 70% more steps, 77% more tokens and 105% more wait time.
  • Over two-fifths of those detours chased tickets that were already closed. Most of the rest wandered into open bugs nobody had asked about.
  • My read: clean-up work that lived at the bottom of the backlog now has a cost you can measure. Re-score it.

Stale TODO comments used to be harmless

Every codebase has stale TODO comments. One points at a bug fixed two years ago. Another is a FIXME nobody owns. A third says “temporary” in a file older than half the team.

Most people skim past them. We know the codebase, or at least we know which bits to ignore.

Coding agents do not share that memory. They read the files in front of them, and they treat the comments as part of the brief. As a result, the note you left for “later” is now an instruction to a very keen reader.

On 6 November, Sam Saccone and Madhuri Garikapati of Google published Agent Distraction on the Google Developers Blog. Their opening line sums it up: “What is easy for humans to skim past in code, agents see as a call to action.”

Most of us have left a TODO and never gone back to it. It turns out something was listening.

What Google measured

First, Google needed a signal it could check automatically across millions of sessions. So it picked inline comments in the form TODO(bug/…) or FIXME(bug/…), because each one links to a ticket with a known status.

Cross-reference the comment, the ticket and the developer’s prompt, and you can tell useful work from a detour without reading every transcript. The data came from agent traces across thousands of engineers and hundreds of millions of agent steps.

MeasureFinding
Sessions that exposed the agent to a TODO or FIXME with a bug link13%, nearly 1 in 7
Encounters where the agent ignored the comment94%
Encounters where the agent then acted on that bug6%
Share of those actions the developer had not asked for83%
Unprompted detours that chased closed ticketsOver two-fifths: 32% already fixed, 9% obsolete or won’t fix
Unprompted detours into bugs that were still openOver half: 61% lookup only, 39% edited code
Diagram of how stale TODO comments pull coding agents off task, from Google's data. 13% of agent sessions met a TODO or FIXME with a bug link. Agents ignored the comment in 94% of encounters and acted on the bug in 6%. 83% of those actions were unprompted. Of unprompted detours, over two-fifths chased closed tickets (32% already fixed, 9% obsolete) and over half went into open bugs nobody asked about.
How often a TODO with a bug link turns into a detour. Source: Google Developers Blog, Agent Distraction, 6 November 2026.

So most of the time the agent behaves. Six per cent of encounters sounds small. However, at the volume agents now run, a small percentage is still a lot of sessions.

What a detour costs

Next, Google compared sessions with an unprompted bug detour against sessions without one. It controlled for developer, codebase complexity, task type, model tier, files read, prompt length and the step where the bug reference appeared. Per session, a detour meant:

  • 70% more steps
  • 77% more tokens
  • 105% more wait time
Stat panel. Sessions with an unprompted bug detour needed 70% more steps, 77% more tokens and 105% more wait time. Google's clean-up changes for obsolete TODOs were accepted by human reviewers more than 95% of the time over six months.
The cost of a detour per session, and the acceptance rate of Google's clean-up changes. Source: Google Developers Blog, 6 November 2026.

Wait time is the figure I would put in front of a team. After all, tokens show up on an invoice. Wait time shows up as a developer watching a spinner, or switching to something else and losing the thread.

Google is fair about the size of its own examples, calling them “only trivial to minor detours”. In one, an agent looking into an unrelated bug started digging into a TODO for a bug fixed in 2023. In another, the agent decided, unprompted, to “fix” code linked to a TODO, until the developer challenged the scope creep.

Minor still is not free. In the worst case, Google says, a stray reference grounds the agent “on falsehoods leading to incorrect logic and decisions during implementation.”

Why stale TODO comments now matter to delivery

Here is where I think it lands for delivery teams. This part is my inference, not Google’s finding.

Clean-up work has always lost the prioritisation argument. Deleting dead comments, refreshing a README and archiving an old spec are all sensible and all low value, so they get bumped for the next feature. For years, the cost of leaving them was a mildly confused new starter.

That cost has changed because the reader has changed. GitHub’s Octoverse 2026 report says that by September 2026, more than 40% of pull requests on GitHub started with an agent’s first draft, up from 17% in March. In other words, each of those agents reads your forgotten corners as if they were current.

Google makes the same point about priorities: “Projects that once were on the backburner to cleanup lingering debt but deprioritized due to perceived low value need to be reevaluated with the new agents acting at scale on your codebase.”

If you score your backlog with something like weighted shortest job first, stale TODO comments now carry a cost of delay that most teams have never counted. Re-score the hygiene items honestly. Some will still lose. Others will not.

One caution, though. Google measured one signal, TODOs with bug links, in its own codebase. It names obsolete specs and lagging documentation as the same kind of hazard, but it did not measure them. Extending the finding to READMEs, design docs and runbooks is my reading, so test it on your own sessions before you quote it.

How Google cleared its stale TODO comments

The fix is the most useful part of the post. Google did not bulk-delete every TODO. Instead, it used agents to find bug references marked fixed or obsolete, then had them check the history of the bug, the file and the related changes, sometimes across years.

Only when the agent could confirm that the TODO and the intent behind it were obsolete did it send a change for human review. Over six months, that clean-up removed thousands of obsolete references, and human reviewers accepted more than 95% of the changes.

That is why the checking step matters. A closed ticket does not prove a comment is dead. Sometimes the ticket closed in a tidy-up and the risk it described is still there. Delete that comment and you have swapped a distraction for a blind spot.

A clean-up plan for stale TODO comments

You do not need Google’s tooling to start. Here is how I would run it on a team or a release train. The steps are mine; the evidence behind them is Google’s.

  1. Measure first. Count the TODO and FIXME comments that reference a ticket, then check each ticket’s status. The share pointing at closed work is your baseline.
  2. Sample your own agent sessions. Take a batch of recent agent-drafted pull requests and note any change the developer did not ask for. A scope question in review is enough to start.
  3. Check before you delete. For each comment linked to a closed ticket, read the ticket and the file history. Then delete it, re-link it to a live ticket, or rewrite it as a dated plain note.
  4. Guard the door. Add a presubmit or CI check that flags new TODOs without a ticket and existing ones that point at closed tickets. Google lists presubmit analysers and whole-corpus scanners as ready options.
  5. Tell the agent the rule. In your agent instruction file, say that TODOs outside the task are for reporting, not fixing. It is one line, and it turns a detour into a note in the summary.
  6. Re-score the hygiene backlog. Bring the baseline and the session sample to refinement, and let the numbers make the case.
Six-step loop for clearing stale TODOs: measure the baseline, sample agent sessions, check history before deleting, guard with a presubmit check, tell the agent the rule, re-score the hygiene backlog, then repeat.
A clean-up loop for teams. The steps are the author's own; the evidence behind them is Google's.

Keep the agent’s brief current

JetBrains’ State of Developer Ecosystem 2026, based on 28,945 developers, found that “Senior developers go beyond prompts and give agents guidelines, specs, and ways to verify their work.” However, those guidelines and specs only help if they are current. In practice, the repository is part of the spec, whether anyone wrote that down or not.

If you want each agent to have a defined job in the first place, I covered that in AI job design. And if your worry is the debt agents create rather than the debt they read, start with AI coding assistants and the next technical debt crisis.

Limits of the evidence

  • One company and one codebase. Google’s internal tools, models and agent setup may differ a lot from yours.
  • One proxy. TODOs with bug links are easy to measure. Other stale context was named but not measured.
  • A blog post, not a peer-reviewed paper. Google describes its regression but does not publish the full model or data.
  • Relative costs only. The detour figures are percentage increases, not minutes or pounds.
  • The GitHub and JetBrains figures come from vendors with an interest in agent adoption, and the JetBrains figures are survey responses.

Sources

Kevin Campbell, writer behind Beta Tester Life

Behind the notebook

Written by Kevin Campbell

Thirty years of technology, delivery and organisational change—translated into practical thinking for people doing the work.

Continue the journey

One thought leads to another.

Scroll to explore

Conversation

Add to the thinking

Questions, experience and thoughtful disagreement are welcome.

Leave a Reply