You ask a coding agent to fix a null check.
- This guide provides comprehensive, actionable information
- Consider your specific workflow needs when evaluating options
- Explore our curated IDEs & Coding Tools tools for specific recommendations
- AI coding tools range from code completion to autonomous development
The one-line fix that was not one line
You ask a coding agent to fix a null check. It comes back having also renamed three variables for consistency, pulled the logic into a new helper function, and reformatted a block it decided was hard to read. Nothing it changed was wrong. None of it was requested. Now the twenty-minute fix is a forty-minute review, because the two lines that mattered are sitting inside two hundred that did not.
This happens across every agent in general use, not one vendor's quirk. Claude Code, Cursor, GitHub Copilot, and OpenAI Codex all share the same default, because none of them assume you want a minimal diff unless you say so.
Why the model does this
A coding model is trained toward code that is complete and correct. Nothing in that training pushes it toward a diff that is small. Left alone, it reads a function, notices something it can make cleaner, and fixes that too, in the same turn, without asking. That is the model doing exactly what it was optimized to do. The mismatch is between what it optimizes for and what you actually wanted from this one request.
It is worth naming what this is not. It is not the model being careless, and it is not a sign the tool is unreliable for bigger work. It is a scope default that suits some tasks and actively hurts others, and nobody tells the model which situation it is in unless you do.
The instruction that fixes it
Add this to your CLAUDE.md, your .cursorrules, or whatever file your agent reads at the start of a session:
Make the smallest possible change that solves the stated problem.
Do not refactor, rename, or restructure code outside the lines
directly required to fix it. If a larger change seems warranted,
stop and propose it separately before making it. Ask before you
improve anything I did not ask you to improve.
That is the whole fix. It is one paragraph, it costs a few dozen tokens on every turn, and it changes what the model treats as the goal: not "make this file better" but "make this specific thing true, and nothing else."
What actually changes
Diffs shrink to the size of the actual fix. A one-line bug fix produces a one-line diff. A small feature adds only the lines the feature needs. The model still catches real bugs adjacent to what you asked about, but it now surfaces them as a question or a separate suggestion instead of folding them into the same commit uninvited.
The part worth being honest about: the model is not smarter for having this instruction, and it will occasionally miss a genuine improvement it would otherwise have made unprompted. That is the trade. You are exchanging some unrequested cleanup for a review you can actually finish in the time the task deserved.
When to use it, and when to take it out
The actual bottleneck
Model capability stopped being the limiting factor in AI-assisted coding a while ago. The limiting factor now is review time, specifically the time it takes a human to work out what an agent actually decided to change and whether all of it was warranted. Every line of unrequested improvement is a line that has to be re-derived and re-justified by whoever reviews it, and that cost does not show up anywhere except the clock.
One instruction does not make an agent more capable. It makes its output match the size of the question you asked, which is usually the thing standing between "this tool is fast" and "this tool is fast and I can actually keep up with it."
This pairs directly with CLAUDE.md in practice, which covers what else belongs in the same file and what does not. For the rest of the setup around a coding agent, see getting more out of a coding agent. Tool pages: Claude Code, Cursor, GitHub Copilot, and OpenAI Codex.
Explore curated tools related to this guide:
Ready to try AI tools? Explore our curated directory: