Writing · Tools
How to Review AI-Generated Code: What Else Does It Reach?
The question to ask of every edit a coding agent hands back, why the agent rarely answers it on its own, and how to get the answer.
A coding agent such as Claude Code or Codex hands back a diff. It is usually tidy, the tests pass, and the lines that changed do what was asked. The diff does not show what those lines now reach. If a function deep in the code starts calling the network, every function that calls it now depends on the network too, and none of those callers appear in the diff.
That is the question we ask first when we review an agent’s edit: what else does this change reach? We built candor to answer it, and this essay covers how to answer it with or without candor, and what we found when we measured how well agents answer it by themselves.
Volume makes it matter more. Agents produce change faster than people can check it, which is the subject of our working paper The Heat Death of the Codebase? Whatever a tool can check for you never reaches a reviewer’s queue.
What a diff doesn’t show
Take an agent adding a method to a pricing service in the domain layer. The simplest way to get the data it needs is to call an existing helper, and that helper, three hops and one package away, opens a socket. The diff shows one new method and one new call. A reviewer reading it sees nothing wrong, because nothing in the changed lines is wrong. The problem is two layers below them.
The effects to track cross the edge of the program: the network, the filesystem, a database, a subprocess. The blast radius of an edit is every function that gains one of those effects because of it, traced up through every caller. It is a property of the call graph, and the call graph is exactly what a diff leaves out.
Asking the agent doesn’t close the gap
The obvious fix is to ask the agent to describe the consequences of its own edit. We tested that with a pre-registered A/B across four model tiers, and the results are on candor’s evidence page. The task was a Rust edit whose network effect propagates to 16 functions across 9 files and 5 call-graph layers. Each agent made the edit and described what it affected.
Unaided, the agents surfaced between 0 and 6 of the 16 functions. The mean was 0.0 for Haiku 4.5, 1.1 for Sonnet 5, 4.5 for Opus 4.8 and 6.3 for Fable 5. A stronger model did a little better, and the strongest still missed more than half. Given candor’s report, the same agents conveyed the whole chain, scoring between 14.0 and 15.2 of 16 at every tier. The biggest lift was for the smallest model, from 0 to 14.
Our reading is that no model volunteers tedious enumeration. An agent asked about consequences names the local change and stops.
The second half of the test asked the direct question instead: list every function that transitively gains this effect. Pointed at it, the unaided agents traced the whole graph and found all 16. They got there by reading files and reasoning, and with candor the same answer took one query, about 24–42% fewer tokens (1.37× fewer at the median) and 2–3 tool calls against 3–13.
The method was fixed before any trial ran: models, trial count, scoring rule and falsification conditions were committed to the repository first. There were 40 engineer agents and 120 blind judges, three per trial, scoring against shuffled opaque IDs. All 40 edits were machine-checked to introduce the effect.
The evidence page also says what the numbers don’t show, and it belongs here too. “Completeness” means the agent conveyed the whole affected chain, by naming the functions or by stating that the effect reaches every caller up to main; it does not mean it typed out all 16 names. Token counts are the clean metric, and wall-clock time is only directional because the trials ran concurrently. And the gain is on large graph questions over real code. On a small, local question a capable model needs no help.
Reviewing an agent’s edit by hand
None of this needs a tool to start. When we review an agent’s change, these are the questions we work through:
- What effects do the changed functions have now? Look for anything new that reaches the network, the filesystem, a database or a subprocess, including through calls into existing helpers.
- Who calls them? Walk up the callers and ask, for each, whether it should now have that effect. This is the step a diff hides and an agent skips.
- Did it cross a boundary? If the team has rules such as “the domain does no I/O” or “billing talks to the payment provider and nothing else”, check the new reach against them.
- Did a dependency change? A version bump can give trusted code a new capability, such as a library that starts phoning home, without a line of your own code changing.
- Ask the agent the direct question. “Describe the consequences” gets the local change. “List every function that transitively gains this effect” got the complete answer from every tier we tested, at the cost of the agent reading its way through the graph.
The last point is the cheapest improvement available today. The rest is slow on a real codebase, which is why it tends not to happen on every edit.
Making the check mechanical
candor does the enumeration once and keeps it. It maps which functions reach the network, the filesystem, a database or a subprocess, traced through every call, and stores the map in the repository’s .candor/ folder. An agent then asks “what’s the blast radius of this change?” or “what reaches the network?” and gets a deterministic answer from the map, over MCP or from the command line.
In Claude Code, a Stop hook refreshes candor’s summary on each turn that touches the code. With self-review turned on, candor hands the agent the knock-on effects of its own edit while it works: “your change gave foo a new Net — intended?”
Declare a boundary and the map becomes a gate. A policy file says, for example, that the pricing package is pure and that billing may reach only the payment provider’s hosts, and the edit that crosses it fails the build in CI, whoever or whatever wrote it. Where candor can’t resolve a call, through reflection or dynamic dispatch, it reports the result as Unknown, so an unresolved call never reads as clean.
It covers the JVM (Java, Kotlin, Scala and Groovy), Rust, TypeScript and JavaScript, and Swift. It runs locally and in your CI, with no model inside it, and your code is not sent anywhere.
Trying it
candor is open source under MIT or Apache-2.0. Three commands install it, map the repository and give your agent the queries:
brew install tombaldwin/tap/candor # install candor
candor scan . # map the repo, fetching the engine it needs
candor mcp install # give the agent the queries
On Homebrew 6 or newer, run brew trust tombaldwin/tap first. Claude Code asks you to approve the server the next time it starts, and any other MCP client can point its server config at candor mcp.
The candor page has the full setup for each language, and the evidence page has the method and the raw evals behind every number here.