3D editorial illustration of a glowing cyan AI navigator orb following a straight luminous path toward an emerald crystal while corroded dead-circuit branches and blank amber sticky notes siphon golden token orbs into dark side labyrinths.Illustration of AI coding agent distraction caused by stale TODOs and dead code siphoning tokens off the critical path.

Two weeks ago, I thought stale TODO comments were mostly harmless visual clutter—something you mentally skip right over during a morning code review. Then Google published the numbers.

In an empirical study published November 6, 2026 by Senior Staff Software Engineer Sam Saccone and Senior Staff Data Scientist Madhuri Garikapati, Google analyzed distributed telemetry across more than 913,000 file-reading coding-agent sessions and hundreds of millions of individual agent steps. Their finding—coined “Agent Distraction”—flips the traditional economics of technical debt upside down.

When an AI coding agent reads a file containing an outdated TODO, a resolved bug reference, or a dead V1 class, it does not shrug and move on like a seasoned engineer. It treats that comment as live prompt context. In controlled fixed-effects regressions across Google’s codebase (p < 0.0001), an unprompted detour triggered by a stale TODO inflated a session by +70% more steps, +77% more tokens, and +105% more developer wait time—literally more than doubling how long you sit staring at a spinner.

If you have read my earlier posts on Vibe Coding AIMUD, Coding Standard: Zero Tolerance, and Spec-Driven AI Architecture (AGENTS.md and ADRs), this study validates what many of us have felt in the trenches: codebase hygiene is no longer just aesthetics—it is a direct per-session inference tax.

1. Inside Google’s 913,000-Session Exposure Funnel

Google cross-referenced inline TODO(bug/...) and FIXME(bug/...) comments read by coding agents against its live issue tracker and the developer’s actual prompt. The funnel is eye-opening:

Funnel StageShareWhat Happened
Exposed to an inline bug TODO13% (~1 in 7 sessions)Agent read at least one source file containing an inline TODO(bug/...) or FIXME(bug/...).
Acted on the TODO (of exposed)6%Agent invoked bug-tracker/code/doc lookups or edited the TODO line.
Completely unprompted detour (of acted)83% (>4 in 5)The developer never mentioned the bug (60% ran lookups only; 40% edited code!).
Chased already-closed dead ends (of unprompted)41%32% investigated Fixed/Verified bugs; 9% chased Obsolete/Won’t Fix tickets.
Unauthorized scope creep (of unprompted)57%Active open bugs completely outside the developer’s task (39% actively modified code!).

Even more counterintuitive: **higher-capability models got distracted more often.** As models gain stronger tool-use agency (code search, issue tracker queries, internal docs search), their willingness to launch unrequested investigative side-quests scales right alongside their intelligence.

As engineer Ryan White summed up the economics neatly on X: “Leave a misleading comment and someone chases it for a day. Except now it happens 40 times an hour and you’re paying for the tokens.”

2. Two Real Failure Archetypes (And Why They Hurt So Much)

Google published two anonymized production traces that will feel painfully familiar to anyone running coding agents on an enterprise Java codebase:

  1. The Obsolete Detour (SurfaceControlTest.java): While debugging an unrelated graphics issue, an agent read a test file containing a TODO(bug/XXX) from 2023. Even though the bug had been closed three years earlier, the agent burned multiple tool calls investigating the stale ticket before returning to the user’s real problem.
  2. The Eager Agent (ModelDownloaderV1 vs. ModelDownloadServiceV2): At step #112 of a feature-flag task, an agent spotted a TODO hinting at unimplemented eligibility checks. Without asking, it fired off Code Search and Docs Search, then edited ModelDownloaderV1—which turned out to be 100% dead legacy code already replaced in production by ModelDownloadServiceV2, and violated the team’s dependency-injection boundary by leaking feature logic into a model-agnostic downloader!

That second case also echoes the broader industry conversation heating up across developer forums right now: when agents generate sprawling diffs—including unrequested edits to legacy code paths—human reviewers who stop staying close to the architecture miss subtle regressions until production breaks.

3. The “Load-Bearing TODO” Trap

Your first instinct might be to write a quick Python script that queries Jira or GitHub Issues and auto-deletes every TODO pointing to a closed ticket. Do not do that.

Google explicitly warned against naive ticket-status deletion because many inline TODO comments are “load-bearing.” Even if the linked ticket was closed years ago as Won’t Fix due to a quirky JDBC driver, an OS filesystem edge case, or a third-party API bug, the comment text often documents why a weird workaround exists. Blindly deleting it strips critical maintenance context and invites the next developer (or agent) to “clean up” the workaround and reintroduce the production outage.

Instead, Google built autonomous “Todo Cleaner” scanner agents that inspect multi-year Git history, file evolution, and bug discussions before proposing a targeted cleanup PR—removing thousands of confirmed-obsolete references over six months with over 95% acceptance from human reviewers.

4. The 4-Step Anti-Distraction Playbook for Java & Spring Teams

You do not need Google’s monorepo infrastructure to cut Agent Distraction out of your repositories. Here is a four-step playbook you can implement in an afternoon.

Step 1: Enforce Ticket-Linked TODO Hygiene in Gradle + Checkstyle

Stop letting unowned, undated TODOs enter main. Configure Checkstyle’s TodoComment (or a lightweight custom regex rule) so every TODO must reference an active issue key, and prune stale comments as part of ticket closure:

<!-- config/checkstyle/checkstyle.xml -->
<module name="Checker">
    <module name="TreeWalker">
        <!-- Reject bare TODO/FIXME comments that lack an active issue tracker key -->
        <module name="TodoComment">
            <property name="format" value="(?i)(TODO|FIXME)(?!\([A-Z]+-[0-9]+\):)"/>
            <message key="todo.match"
                     value="TODO/FIXME must link to an active issue, e.g. TODO(ENG-1234): context"/>
        </module>
    </module>
</module>

Pair that with a scheduled monthly audit script (or a dedicated Git-history-aware cleanup agent) that flags any TODO(ENG-...) whose Jira/GitHub issue has been CLOSED for more than 30 days—converting load-bearing explanations into normal NOTE: comments and deleting dead reminders.

Step 2: Add Explicit Scope Guardrails to AGENTS.md

If you already maintain an AGENTS.md at the root of your repository (from our Spec-Driven AI Architecture guide), add a crisp anti-distraction rule right under your execution constraints:

## Scope & Anti-Distraction Guardrails
- Treat inline `TODO` / `FIXME` comments in files you read as **informational context only**, never as implicit work items.
- Do **not** look up issue tickets, modify unrelated `TODO`s, or refactor adjacent dead code unless the issue ID or file is explicitly named in the user prompt.
- If you spot a genuine bug or obsolete `TODO` outside task scope, note it in your final summary under **Out-of-Scope Observations** instead of editing it in-place.

Step 3: Stamp [SUPERSEDED] Banners on Legacy ADRs and Design Docs

Agent Distraction does not stop at .java files. Outdated Architecture Decision Records (docs/adr/), stale DESIGN.md files, and forgotten wiki exports poison both coding agents and RAG pipelines.

Whenever a new ADR or V2 design replaces an older document, stamp line 1 of the old file unambiguously:

> **STATUS: [SUPERSEDED BY ADR-042 — 2026-10-15]**
> Do NOT implement or reference this design for new work. See `docs/adr/042-v2-downloader.md`.

Step 4: Actually Delete Your V1 Services

Google’s ModelDownloaderV1 incident is a textbook lesson for Spring Boot teams: once a feature flag hits 100% rollout and your soak window passes, delete the V1 implementation, its @Deprecated configuration properties, and its old tests. Keeping “just in case” V1 classes sitting in the same package is a magnet for eager agents—and your Git history already preserves every line if you ever need to look back.

Conclusion

For decades, we treated dead code and forgotten TODOs as zero-interest technical debt—annoying, sure, but easy to defer until “next sprint.” In 2026, coding agents read those forgotten corners dozens of times a day and charge you real tokens, latency, and blown review cycles every time they take the bait. Clean up your dead V1 code, turn load-bearing TODOs into clear NOTEs, guard your AGENTS.md scope, and stop paying an AI tax on three-year-old comments.


Discover more from GhostProgrammer - Jeff Miller

Subscribe to get the latest posts sent to your email.

By Jeffery Miller

I am known for being able to quickly decipher difficult problems to assist development teams in producing a solution. I have been called upon to be the Team Lead for multiple large-scale projects. I have a keen interest in learning new technologies, always ready for a new challenge.