AI coding agents: stop old TODOs becoming new tasks

Hands typing on a laptop with green text on its screen.

A comment left beside working code can send an AI coding agent towards a task nobody assigned. Google’s 6 November analysis of agent distraction describes agents following inline bug references into closed tickets or unrelated open work. For agencies using coding agents, that gives repository housekeeping a specific purpose: make the boundary of the current job easier to recognise.

The findings come from Google’s own engineering environment. They don’t establish how often your chosen agent will wander. Our recommendation is to examine a few real runs before deciding that a faster model or a longer prompt will solve the problem.

Find the point where the task changed

Choose a recent job that took longer than expected. Compare the request with the files the agent read and the changes it proposed. Mark the first action that served a different objective. A bug lookup may be useful context; editing that unrelated bug needs a separate decision.

Keep the evidence small enough for a reviewer to follow. Record the original request, the comment encountered and the subsequent action. Avoid copying an entire client repository into a reporting document just to explain one detour.

Check history before deleting old reminders

Google describes checking the history behind apparently obsolete comments before proposing their removal. A closed ticket alone doesn’t explain whether a warning still protects an important assumption.

Ask the maintainer what the comment means today. If the underlying limitation remains, rewrite it as a factual constraint with a current reference. If the limitation has gone, propose a small cleanup with the supporting history. Keep that change separate from an urgent customer fix so each reviewer can assess its purpose.

Give discovery an explicit destination

Our suggested task brief tells the agent what to deliver, which checks establish success and where to record unrelated defects. For example: repair the named checkout validation fault, run the relevant tests and report any other suspected issue without changing it.

A discovered problem can then enter the normal backlog with an owner. The developer reviewing the checkout fix can judge the requested behaviour without also evaluating an unexpected refactor. Don’t treat every nearby comment as authority to broaden the assignment.

Review scope as well as correctness

Before accepting a patch, compare its changed files with the original objective. Ask why each extra file needed an edit. A passing test suite doesn’t explain the business reason for an unrelated change.

For teams developing Shopify integrations, our article on using coding agents for Shopify development provides related context. Start the next repository review with one question for the maintainer: which instructions or comments could a new contributor reasonably mistake for today’s work? Resolve those ambiguities through normal code review, then watch whether future runs stay within their briefs.

Is your website not up to scratch?

Hire our team to take care of it and get back to focusing on what really matters to you.