Smaller Diffs, Fewer Tokens, Faster Reviews: Running AI Coding Agents Like a Senior Developer
How do you run an AI coding agent the way a senior developer would? You ask it for the smallest change that fully solves the problem, you make it finish everything that change touches, and you review its work as a design decision, not as a pile of generated lines. Do those three things and the diffs get smaller, the reviews get faster, and the code you merge is code you can explain.
That is the short answer. The rest of this guide is how we do it at Wbcom Designs, with the actual rules we give our coding agents, the numbers we can count from our own library, and the places where the approach can cut too far. We have written about the cost side of Claude Code before. This post is deliberately not about cost. It is about quality: what lands in your repository and how fast a person can decide whether it should.
One honest note up front. We did not run a controlled experiment with before and after diff sizes, so you will not find a percentage here. What you will find is the working mode, the reasons behind each rule, and a review checklist you can copy today.
What does a senior developer do differently with an AI coding agent?
A senior developer spends the effort before and after the code, not during it. They narrow the request, they name what the change must reach, and they read the result for what should not be there.
A junior developer with an agent tends to do the opposite. They type a loose request, accept what comes back if it runs, and move on. The agent is fast, so the loose request produces a lot of code quickly, and nobody has the time to read all of it carefully. That is how a codebase fills with helpers nobody asked for, options nobody uses, and a second copy of something that already existed.
The difference is not intelligence. It is where the attention goes. Writing a line of code is now nearly free. Understanding a line of code, deciding it belongs, and being accountable for it is not. So the skilled part of the job moves to the parts that are still scarce: scope, reach and judgement.
Three habits that show up in every good run
- Read first. Before anything is written, the agent reads the code the change touches, and lists every place the change must reach: callers, tests, fixtures, config, exports.
- Change little, finish fully. The diff is as small as it can be while still being complete.
- Prove it. New logic arrives with one small check, and the report says what was verified and what was not.
None of these is new. They are what a careful engineer already does. The change is that with an agent you have to write them down, because the agent will not infer them from a vague request.
What is a “smallest complete change” mode for a coding agent?
It is a working mode where the agent is told to solve the whole problem with the least new code, and where “least” never means leaving parts undone. We run it as a short set of rules the agent loads at the start of a session.
The core is an ordered list. The agent takes the first option that fully works:
- Does it need to exist at all? Skip features, options and flexibility nobody asked for, and say in one line what was skipped.
- Is it already in this codebase, as a helper, component or pattern? Use it the way the surrounding code does.
- Does the standard library or a platform feature cover it? Use that, unless the project has its own wrapper, in which case the house component wins.
- Is there an installed dependency that does it? Use it. Never add a dependency for a few lines.
- Can it be one line a reader understands at a glance? Write one line.
- Otherwise, write the minimum code that works.
Then a second group of rules stops the first group from turning into carelessness:
- Be lazy about the solution, never about the change itself. Finish every part the task needs, including the callers, tests and fixtures the change breaks.
- For a bug fix, grep every caller of the function you touch first, then fix the root cause once, in the shared code.
- Code you move or merge keeps its error handling and validation.
- New non-trivial logic, meaning a branch, a loop, a parser, anything involving money or security, leaves one small test or self-check.
- A shortcut with a known limit gets a one-line comment saying what the limit is and when to upgrade.
- Never cut: validation at trust boundaries, error handling that prevents data loss, security, accessibility, or anything the user actually asked for.
Read that list again and notice how much of it is about protecting the reviewer. “Skip what nobody asked for” removes lines the reviewer would have to read and question. “Reuse what exists” removes a second implementation the reviewer would have to compare against the first. “Finish the callers” removes the follow-up bug report.
Why the “never cut” list has to be written down
An agent told to write less code will, left alone, sometimes cut the wrong code. Validation looks like clutter when the happy path works. Error handling looks like clutter until the day it matters. So the rules name the things that stay, even when removing them would make the diff shorter. This is the mirror of the problem in our last post, where a tool default did something nobody intended: a good default is the one that is safe when nobody is looking. The same idea applies to the agent’s own habits. We wrote about the tool side in giving AI agents real access to client sites.
Do smaller diffs actually make reviews faster?
They make a review lighter to start and easier to finish, which in practice means faster. We can say that from how review works, and we are not going to put a number on it that we did not measure.
Here is the mechanism. A reviewer’s time goes into three things: reading each changed line, working out whether it is the right change, and hunting for what is missing. A smaller diff shrinks the first. A diff that only contains what the task needed shrinks the second, because every line has a reason. A diff that already includes the callers and the test shrinks the third, because the reviewer does not have to go looking.
The reverse is familiar to anyone who has reviewed generated code. A large diff with fifteen helper functions invites the reviewer to skim, and skimming is where bad code gets through. People review fewer lines carefully than many lines quickly. Keeping the diff small is a way of keeping the review honest.
What it cut, and what we cannot prove
What the mode is designed to remove is easy to list: unrequested options, duplicate helpers, wrapper layers, and dependencies added for a handful of lines. Those are the things that make a generated diff long and a review slow.
What we have not done is count them across a before and after period, and we would be guessing if we offered a figure. If you want to know whether this works for your team, measure two things for a month: lines changed per merged task, and how long reviews take from open to approve. That is a better answer than ours, because it is yours.
Where it can cut too far
The failure this mode invites is a diff that is small because it is incomplete. The agent changes a function and leaves one of its callers on the old signature. It fixes the bug in the path the report mentioned and misses the sibling path that shares the code. It writes the change and skips the test because the change was “trivial”.
This is why the rules say, in plain words, that being lazy applies to the solution and never to the change itself, and why the first step is listing everything the change must reach. A small diff is a goal. A complete diff is the requirement. When they conflict, complete wins.
The other way to cut too far is validation and error handling, which we covered above. Our rule is that code you move keeps its checks. When an agent merges two similar functions into one, the check that lived in only one of them must survive in the merged version.
How do you review code written by an AI coding agent?
Review it against the request, not against itself. Ask whether the change does what was asked, whether it reaches everything it should, and whether anything is in it that nobody asked for.
Plenty of reviewers read generated code the way they read a colleague’s, line by line from the top. That works poorly, because generated code looks fluent everywhere. Fluency is not correctness. A senior reviewer reads in a different order.
The order we read a diff in
- The request first. What was the agent asked to do, and what did it say it did? A diff you cannot connect to a request is already suspect.
- The file list. Are these the files you expected? An unexpected file is a question to ask before reading a single line.
- The deletions. What was removed, and was it meant to go? Removed validation and removed error handling are the ones to catch.
- The additions nobody asked for. New options, new helpers, new dependencies, new config. Each needs a reason.
- The reach. Pick the function that changed and look for its callers yourself. If the agent listed them, check the list against a search.
- The check. Is there a test or self-check for the new logic, and does it fail on the old code? A test that passes either way proves nothing.
- The report. What does it say was verified, and what does it admit was not?
Only then read the lines themselves. By that point you know what you are looking for.
A table you can copy
| Question for the diff | What it catches | What to do if it fails |
|---|---|---|
| Is every changed file one you expected? | Scope creep, edits in the wrong place | Ask why before reading further |
| Is anything removed that should stay? | Lost validation, lost error handling | Restore it, and add it to the “never cut” list if it keeps happening |
| Does it add anything nobody requested? | Extra options, helpers, dependencies | Delete it or ask for the reason in one line |
| Did the callers and fixtures change too? | A fix that works in one path and breaks another | Send it back with the missing caller named |
| Would the test fail on the old code? | Tests that cannot fail | Ask for a negative case |
| Does the report say what was not verified? | Overclaiming | Treat an empty “not verified” field as a warning sign |
Ask for the shortcut comment
One of our rules gives a reviewer something very useful. When the agent takes a shortcut with a known limit, it leaves a one-line comment naming the limit and when to upgrade. That turns an invisible trade-off into a visible one. The reviewer no longer has to guess whether “this only handles the first page of results” was a decision or an accident. It says so, right where it happens.
Do small skills reduce Claude Code token usage?
Smaller instruction files mean less loaded into every session, which is one lever on usage. Whether it moves your bill depends on your setup, so treat it as a good habit first and a saving second.
The official guidance is consistent about it. The Claude Code skills documentation (read 1 December 2026) says to keep SKILL.md under 500 lines and move detailed reference material into separate files. The memory documentation, read the same day, suggests targeting under 200 lines per CLAUDE.md file, because longer files consume more context and reduce adherence, and recommends path-scoped rules for instructions that apply to only part of a codebase. The costs page lists moving instructions from CLAUDE.md into skills among its ways to reduce token usage.
We follow the same shape, and our library gives us real numbers to show for it. We counted them from disk today:
| Skill file length (SKILL.md) | Number of skills |
|---|---|
| 100 lines or fewer | 28 |
| 101 to 200 lines | 40 |
| 201 to 300 lines | 17 |
| 301 to 400 lines | 19 |
| 401 to 500 lines | 11 |
| Over 500 lines | 2 |
That is 117 skills. The median is 166 lines. Two are over 500, the longest at 547 lines, and we are not going to pretend our own library is perfect: those two are overdue for a split. Sixty-three skills keep detail in a references folder that loads only when a task needs it, which is how most of them stay short.
The reason this belongs in a post about review, not cost, is that a short skill is a readable skill. When an agent misbehaves, you can open the skill and find the rule that should have stopped it. In a 2,000-line file you would not find it, and neither would the agent. Our deeper write-up of the structure is in how Claude Code skills stay small, so we will not repeat it here.
A word on what a skill is for
A skill is a work order the agent loads when it needs it. It is not a place to store every opinion your team has ever had. If a rule matters only to one kind of task, it goes in that task’s skill or its reference file, not in the file every session reads. That keeps the always-loaded text short and the situational detail one step away.
What does a small, complete fix look like in practice?
It looks boring. It is the fix you would have made by hand if you had the afternoon free, with the loose ends tied off. Here are two from our own recent work.
Example one: the tool default that deleted images
On 29 November a publishing agent used a blog tool with its default settings, and the default deleted the old featured image on ten posts. Those images were still used as banners inside the posts. The tempting response is a rewrite: rebuild the media handling, add an undo system, redesign the tool.
What we did was smaller and finished. We repointed each of the ten banners to the new image. We checked that zero media references were missing. We changed our briefs so every featured-image call passes the delete option as false. We recorded the trap in the publishing skill’s gotchas so the next agent reads it. Four steps, no new machinery, and every place the problem could reach was checked.
Example two: links to posts that do not exist yet
In the same run, 26 internal links pointed at posts scheduled for later dates, which would have returned a 404 until those posts went live. The smallest complete answer was a script that finds links to unpublished or scheduled posts and unlinks them before publish. It does one thing, it is run every time, and it removed the whole class of problem rather than the 26 instances.
Both examples have the same shape. Find the reach, fix the class not the instance, add the one check that would have caught it, and write the lesson where the next run will read it.
What do juniors still need to learn when an agent writes the code?
Almost everything a senior knows, because the agent does not remove the need to judge. What changes is the order in which they learn it. They start by reading and reviewing code, not by writing it.
This is our opinion, formed from how we work, not a study. If the agent produces the first draft, the junior’s growth comes from what they do with it. Here is what we think they need to practise, in the order we would teach it.
- Reading code that is not theirs. Reviewing an agent’s diff is the same skill as reviewing a colleague’s, with more volume. They need to get fast at it without getting sloppy.
- Writing the brief. Scope, files to read, what not to touch, how to report. A junior who can write a clear brief understands the task. One who cannot has found out early that they do not yet.
- Finding the reach. Searching for every caller, every fixture, every place the change spreads. This is the habit that stops half-finished fixes.
- Writing a test that can fail. Not a test that passes, a test that fails on the old code and passes on the new.
- Saying what was not verified. This is the hardest and the most valuable. It is also what makes a report trustworthy.
- Debugging without the agent. Sometimes the agent is wrong in a way it cannot see. The junior needs to be able to trace a problem with a debugger and a log, with no help.
If a junior cannot do the last one, they are not yet in a position to supervise the agent, because they will not notice when it fails.
What seniors still owe the team
Seniors have a job here too. They decide which tasks suit an agent and which do not. They keep the rules files short and current. They review the reviews: a spot check of an approved diff now and then shows whether the team is reading carefully or skimming. And they write down the traps, because an agent only learns from what is on the page.
A review checklist for agent-written code
Use this on any diff an agent produces. Print it, paste it into your pull request template, or give it to your juniors.
Before the agent starts
- The request names the goal, the scope and the files to read first.
- The agent has been told to list everything the change must reach before writing.
- The “never cut” list is in the working rules: validation, error handling, security, accessibility.
When the diff arrives
- Every changed file is one you expected.
- Nothing was removed that should stay.
- Nothing was added that nobody asked for, or each addition has a one-line reason.
- Callers, fixtures and config that the change touches were updated.
- New logic has a test or check, and that check fails on the old code.
- Any shortcut with a limit has a comment saying what the limit is.
Before you merge
- The report says what was verified and what was not.
- You ran the code or the test yourself, or you can say why you did not.
- You could explain every line to a colleague. If you cannot, ask the agent to simplify until you can.
Frequently asked questions
Is it safe to tell an agent to write less code?
Only if you also tell it what must stay and what must be finished. “Write less” on its own can remove validation and error handling. Pair it with a never-cut list and a rule to finish every caller and test.
Will smaller diffs reduce my Claude Code token usage?
Possibly, because there is less to read and re-read in a session, but we have not measured it and the answer depends on how you work. The official costs page lists specific ways to reduce usage. We treat smaller diffs as a quality practice first.
How long should a skill file be?
The official skills documentation says to keep SKILL.md under 500 lines and to move reference material into separate files. In our library the median is 166 lines.
Should juniors use AI coding agents at all?
Yes, with a review habit built in from the start. The risk is a junior who accepts output they cannot read. The fix is to teach reading, brief writing and test writing early, and to keep them able to debug without the agent.
What is the single most useful review question for generated code?
What is in this diff that nobody asked for? Unrequested additions are where most of the length, and much of the risk, in generated code lives.
Can an agent review its own code?
It can catch some problems, and a second pass is worth running, but it is not a replacement for a person who owns the result. The person is the one accountable when the code breaks, so the person reads the diff.
Sources
- Claude Code documentation, “Extend Claude with skills” (SKILL.md under 500 lines), code.claude.com/docs/en/skills, read 1 December 2026.
- Claude Code documentation, “How Claude remembers your project” (CLAUDE.md target under 200 lines, path-scoped rules), code.claude.com/docs/en/memory, read 1 December 2026.
- Claude Code documentation, “Manage costs effectively” (ways to reduce token usage), code.claude.com/docs/en/costs, read 1 December 2026.
- First-hand: our own working rules for coding agents, our skill library counted from disk on 1 December 2026 (117 skills, median 166 lines, 63 with a references folder), and our 29 November publishing run.