devdot
← All postsEngineering ·

Stale TODOs Cost Google's Coding Agents 77% More Tokens. Your Dead Comments Are Instructions Now.

Google traced hundreds of millions of coding agent steps and found that obsolete TODO comments send agents on unprompted detours that add 70% more steps, 77% more tokens and double the wait time. Here is what that means for your codebase.

Google published something last week that should change how you think about the comments sitting in your codebase. Two of their engineers, Sam Saccone and Madhuri Garikapati, pulled distributed traces from thousands of engineers and hundreds of millions of coding agent steps, then went looking for one specific thing: what happens when an agent reads a TODO(bug/...) comment that nobody asked it to deal with.

The short version. Agents treat stale comments as instructions. The line from the post that stuck with me: "What is easy for humans to skim past in code, agents see as a call to action."

The numbers

13% of file-reading sessions put the agent in front of a TODO or FIXME that referenced a bug. Most of the time the agent ignored it (94% of encounters). In the remaining 6% it acted, and 83% of those actions were unprompted. The developer never mentioned the bug.

Then it gets expensive. 41% of those unprompted detours chased tickets that were already closed: fixed, obsolete, won't-fix, duplicate. Dead ends. The other 57% were open bugs outside the scope of the task, and in 39% of those cases the agent went further and edited code nobody asked it to touch.

After controlling for developer, codebase complexity, task type, model tier and a handful of other variables, a single unprompted detour added 70% more steps, 77% more tokens and 105% more wait time to a session. These were "minor" detours in the authors' own words. One agent spent several steps researching a bug that had been fixed in 2023, because a test file still carried the comment.

Why this is different from ordinary tech debt

We've all shipped past a TODO. Humans have a filter for this. You read // TODO: handle the retry case and your brain files it under "someone's problem, not mine today." Agents don't have that filter. They read everything in the file with the same weight, and a comment pointing at a bug tracker looks a lot like a task.

So the cost model of tech debt just shifted. A stale comment used to cost nothing until a human tripped over it. Now it costs tokens on every session that reads that file, and it costs correctness when the agent decides to "help" with something out of scope. Dead code, outdated docs and resolved-bug references used to be clutter. Now they're noise injected straight into the planning loop of the thing writing your code.

This also puts a number on something we see constantly on client codebases: a team buys the coding agent, gets mediocre results, and blames the model. Quite often the model is doing exactly what the codebase told it to do.

What Google did about it

They built agents to clean up after agents. A scanner walks the codebase looking for bug references marked fixed or obsolete. Before it deletes anything, it checks the bug history, the file history and the surrounding changes to confirm the intent behind the TODO is dead. Then it opens a change for human review. Over six months it removed thousands of stale references, with over 95% reviewer acceptance.

95% is the number that matters. It means this kind of cleanup is boring enough to automate and safe enough to trust, as long as a review step stays attached.

What we'd do on a normal-sized codebase

You don't have Google's trace infrastructure. You don't need it.

  • Grep for TODO and FIXME and count them. Most teams we work with are surprised by the number. Anything referencing a ticket ID gets cross-checked against the tracker. Closed ticket, delete the comment.
  • Add a lint rule that rejects a bare TODO without an owner and a ticket. That stops the pile growing again.
  • Delete dead code instead of commenting it out. Commented-out code is the worst kind of distractor because it looks like a plan.
  • Treat outdated docs and READMEs inside the repo as bugs. Agents read them before they read your code.
  • Put the real intent in an AGENTS.md or equivalent, so the agent has one authoritative place to look instead of inferring it from scattered comments.

Do this before you spend another week tuning prompts. The cheapest way to make an agent smarter is to stop lying to it.

We're here to help founders and teams design and build digital products that are built to scale with you, not slow you down. If you're looking to build something, get in contact with us today!

NEXT POST →Deleting a Leaked Secret Doesn't Revoke It. After Nine AI Platform Incidents, Rotate at the Issuer.