AI & Emerging Interfaces

Google’s Cleanup System Targets Stale Agent Instructions

Google found that unrequested bug detours appeared in one in seven coding sessions and increased token use by 77%. Its cleanup approach makes code the default source of truth.

  • AuthorJames Calloway
  • ChannelAI & Emerging Interfaces
  • Filed
  • Read5 min
Google Cleanup System Shows How to Stop AI Chasing Fixed Bugs
Google Cleanup System Shows How to Stop AI Chasing Fixed BugsPexels / pixabay
  • Google reviewed millions of sessions from thousands of engineers; about 1 in 7 encountered a bug note.
  • More than 4 in 5 bug-note pursuits were unrequested; 41% targeted fixed bugs and 57% targeted still-open bugs.
  • Side quests used 70% more actions and 77% more tokens and took more than twice as long.
  • A code-first rule reversed a 9-out-of-10 stale-file follow-up result in testing.
  • Over six months, engineers accepted more than 95% of Google’s cleanup suggestions, clearing thousands of notes.

In Google’s analysis of millions of coding-agent sessions run by thousands of engineers, about one in seven encountered a project note about a bug; when an agent acted on such a note, more than four in five cases involved work no engineer had requested.

Google reached those figures by reviewing developer notes in code that linked to bug records, checking whether each bug was fixed and whether an engineer had requested the work.

Google calls these diversions “side quests.” In the measured cases, 41% pursued bugs already fixed and 57% pursued open bugs without a request to fix them. A side quest added 70% more actions and 77% more tokens, and the session took more than twice as long.

The agent could still finish the assigned task, which makes the cost easy to miss: an unsolicited change might alter behavior the developer meant to preserve, or implement a feature in a way that conflicts with a later plan.

Why do stale notes derail coding agents?

Claude Code loads CLAUDE.md at the start of every session and can also read plans and requirements from a specs folder. Everything enters the model’s context, so instructions that no longer match the app can compete with the task and with one another.

A requirements change exposes the problem. After a product drops Google sign-in for an email-only login, a later session can read the old requirements and treat the missing option as unfinished work, even though the current code reflects the new decision.

A separate study found that Claude Code and Codex followed an outdated project file instead of the app nine times out of 10. In the reviewed project, the agent also continued to follow CLAUDE.md when it conflicted with the app.

Claude reads the entire instruction file each time, including sections unrelated to the task. Researchers found that agent-written instruction files raised task costs by about 20% without improving performance. Accumulated rules can also contradict each other and force the agent to choose without asking.

Claude’s memory compounds the issue. It saves notes after corrections, and those notes never expire; a “second brain” of entries may have no live app against which to verify them. Current project files do not solve the problem either, because each session’s context accumulates failed attempts.

Chroma found that all 18 models it tested became less reliable as context grew. Users have also reported that completed plans reappear after a long Claude session is compacted, turning prior work into apparent pending work.

What rules keep Claude Code on task?

AI Labs’ proposed source-of-truth rule sets a clear priority. The CLAUDE.md instruction says Claude should “trust the existing code over a conflicting plan and report the difference.” In testing, that reversed the earlier nine-out-of-10 result: the agents followed the code instead of the stale file.

Ticket status adds a necessary exception for unfinished work. Labels such as completed, in progress, and not started tell Claude how to interpret a feature that appears in a plan but not in the code; when a ticket is in progress, the plan can override the absence of finished code.

AI Labs’ proposed setup also includes an instruction to “leave unrelated work alone.” In one test, Claude Code made no extra changes with that line; without it, the agent exceeded the request much more often.

For requests that do not already exist as tickets, the setup can require a comparison with existing plans before implementation. Overlap or contradiction should trigger a conflict report and a question to the developer, rather than an automatic rewrite.

AI Labs also recommends a fresh session for each task, including the shift from planning to building. That removes failed attempts from an earlier task’s context, although it leaves outdated notes stored in the project.

How does Google’s cleanup process work?

Google’s internal cleanup agents search for notes about fixed or dropped bugs, but age alone does not make a note disposable. A warning that a bug may return if surrounding code is removed can remain relevant years later, so the agents check the bug record and the relevant code’s change history before proposing removal.

An engineer reviewed every proposed removal. Over six months, the process cleared thousands of notes, and engineers accepted more than 95% of the suggestions. Google’s system remains unavailable to the public.

The proposed Claude Code sweep applies the same review discipline to plans and notes. It compares them with the current app and project history, reports potential conflicts, and leaves any note alone when no evidence shows that it is outdated.

The skill lives in the skills folder inside .claude, with its rules and phases in SKILL.md. Before producing findings, a separate checking agent receives the claims without the main agent’s suspicions. Memory or rule conflicts receive a separate listing for human resolution rather than automatic deletion.

After approval, sweep moves unnecessary files into a retained archive. A hook runs before Claude reads, searches, or edits files and blocks access to archived material. In the reviewed app, the sweep found that CLAUDE.md still named a products page and its former locations after the page moved to the catalog.

Claude Code’s monitor and loop features can help build a similar system, but both stop when the session closes and cannot check for days or weeks. The sweep skill and supporting materials are available through the AI Labs Pro community.

For teams running agents routinely, the practical next step is to make code the default source of truth, encode exceptions in ticket status, and audit long-lived instructions before they send another session down an unrequested path.

Source: geeky-gadgets.com

More from James Calloway

James Calloway

Show full bio

Senior reporter covering regulation, policy and their impact on Product and interaction design, design systems at Interface Wire.

174 articles

Related articles

« Previous articleNext article »