A coding agent can pass every test and still leave you with two implementations of the same job. It finds a problem, writes a helper, tests the helper, and moves on. A reviewer later finds that the repository already had a function that did almost the same thing. Now there are two places to fix the next bug, and someone has to decide which behavior is authoritative.
The expensive part is not only the duplicate. The agent has already spent time writing and testing it. Review has to detect the overlap, explain it, and send the work back. A second agent doing a read-only review can miss the same existing function if it starts with the same incomplete picture of the repository.
Move the reuse decision before the edit. Require the agent to name the existing file and symbol it will extend, or explain why the search found no suitable owner. That makes the design visible while it is still cheap to change.
Make the first output an ownership claim
For a task such as "validate the account identifier before saving," ask for three things before code changes:
- The files searched and the terms used.
- The existing function or module that owns the behavior, with its path.
- The intended change there, or the reason a new owner is necessary.
A useful answer says: "src/accounts/validate.js exports validateAccountId; I will extend its checks and add cases to its existing tests." An answer that says "I will add accountValidator.js" has not established whether the job already belongs somewhere else.
The path and symbol matter. "I searched the repo" is not enough to review. A concrete citation lets you check the proposed owner in seconds. If there is no match, the agent should say what it searched, inspect adjacent code and explain the gap. A human can then decide whether the new component belongs.
Search by behavior, not just the requested name
The existing code may use different words from the ticket. Search for inputs, outputs, error messages, routes, and call sites as well as the proposed function name. Follow imports into the implementation. Read the existing tests: they often reveal behavior that a function name does not.
Also inspect the boundary around the job. A helper can look reusable while depending on a particular request context or assuming a different lifecycle. Reuse means extending the right owner, not forcing unrelated callers through a function that was never responsible for them.
For parallel work, give each agent the same ownership rule. If two workers need a shared constant, they should identify its existing definition or propose one shared owner. A test that passes in each module will not detect two matching literals that drift apart next month.
Put the rule where the agent reads it
Add a short instruction to the agent's existing project guidance. For example:
Before editing, identify the existing file and function that own this behavior.
Search for the behavior and its call sites. State what you will extend.
If no suitable owner exists, explain the search and why a new one belongs.
Do not create a parallel implementation merely because it is faster to write.
Use the instruction file your agent actually reads. A rule in a document that never enters the working context does nothing. Keep project-specific ownership notes close to the code, and remove stale directions when the code moves. Do not let the guidance file become a history of every mistake ever made.
A check is not a proof that the agent understood the repository. Review the named file and the resulting diff. If the agent cites a function but then writes a separate wrapper with the same responsibility, the preflight failed. Ask it to explain the boundary before accepting the extra layer.
Measure the change at review
Try the rule on a handful of ordinary tasks. Record whether the proposed owner was right, whether a duplicate was found before implementation, and whether a reviewer had to redirect the work. Look at the finished diff too: a preflight that produces confident but wrong citations has not saved you anything.
AI Lint packages a preflight checklist and architecture reject patterns for coding agents, including AR-R2: Parallel Solutions. It supplies guidance for agents such as Claude Code and Cursor; your repository still supplies the actual ownership map, and a person still judges the diff. The Free Edition is for personal and evaluation use by individuals only (never free for corporate or internal team work). Personal packs are $49/$79 for one user; the Company Bundle is $499 one-time for one legal entity with unlimited internal users.