Give your team access to a coding agent like Codex, and each developer finds their own way to use it. As code output rises, so does the work of reviewing, testing, and deciding what is ready to ship. Developers also bring their own ways of reviewing that code: different models, prompts, skills, tools, and context.
Standardizing the review setup lets the team test improvements together and make them available to everyone. It can also become a shared workflow that runs in its own environment, independently of any developer’s machine. Code review is a good first workflow to standardize: it’s a common bottleneck as teams produce more code.
CodeRabbit and Greptile already offer AI code review. For this example, we’re building directly on Codex, a harness that connects a model to tools and a workspace. We want to evaluate new model and harness releases as they arrive, control the runtime, and reuse the team’s instructions, skills, and validation commands. That keeps review aligned with everyday development, while making us responsible for maintaining and evaluating the workflow.
Checks run in a disposable container; the workflow’s only shared writes are PR comments. Developers keep control of fixes and merges. Initially, the agent runs only when a team member explicitly requests its review on a PR. This lets the team try it on selected changes and use feedback to improve its reviews before enabling automatic runs.
Turn team practices into agent instructions
Before configuring the review agent, have another agent analyze varied past PR reviews: different changes, reviewers, comments, replies, and resulting edits. Ask it to suggest recurring priorities, tone, evidence standards, and topics rarely discussed, linking each inference to examples. Have the team approve these as instructions or skills for the agent. A written requirement still applies even if past reviews rarely mention it. Keep this lightweight: capture what the team already does, agree on a short set of instructions, and refine them through real reviews.
Store the approved review rules as reusable agent instructions or a review skill that team members can use locally and the shared workflow loads on every run. For example:
PR review instructions
Review the supplied PR against the original ticket and acceptance criteria.
Use the approved repository rules, product context, and architecture decisions.
For each acceptance criterion, state whether it is met, partially met,
unmet, or unverified. Cite the code and check results supporting the judgment.
Flag missing or conflicting requirements; do not infer them from the PR summary.
Assess technical and strategic risk using the team's criteria. Explain which
user journeys, data, interfaces, or dependencies could be affected. Flag
conflicts with supplied product goals or architecture decisions. Separate
evidence from assumptions; identify missing context instead of inventing it.
Produce the stakeholder sections relevant to this change:
- Engineering: identify material defects and regressions. Trace affected
callers and cite locations. Give reproduction steps and expected versus
actual behavior; label concerns you have not reproduced.
- QA: prioritize regression and exploratory test scenarios by risk.
For each, give the setup, action, expected outcome, and risk it covers.
Distinguish checks already run from tests you recommend running next.
- Product or business: explain effects on customer workflows and business
goals, trade-offs, and decisions needing confirmation. For example,
does a changed business rule apply to existing customers or only new ones?
- Engineering manager: explain delivery and rollout risks, cross-team
dependencies, and unresolved ownership. Identify what needs coordination
before the change can proceed.
Recommend the next actions and the human involvement needed under the team's
approval rules. Name the recipient role and decision needed for each action.
Keep the report actionable; omit style issues covered by automated checks.
If you want a Mermaid diagram with every review, put that here too. Specify what it should show—for example, the affected request flow and where the change sits within it.
The risk assessment decides how much human involvement comes next. A documentation fix might need a quick engineering review. A billing change may need the billing owner’s sign-off, QA guidance on rounding boundaries and payment reconciliation, and product analysis of rollout scope and customer impact. Downstream workflows can use that analysis, alongside the team’s approval rules, to route the work.
Define how the review workflow runs
Review instructions define how the agent should assess a change. The team also needs to agree on operating rules: when the agent runs, what it can access, which actions it may take, and who acts on its findings.
For a review workflow covering a retail team’s billing repository, those decisions might look like this:
| Decision | Billing review example |
|---|---|
| Scope | Billing repository |
| Trigger | Initially, a team member requests a PR review; a new commit supersedes it and needs a new request. Automatic runs are disabled. |
| Inputs | Base and head revisions, diff, the original Jira or Linear ticket with its requirements and acceptance criteria, CI results, and approved agent instructions. |
| Access | Read approved repository, ticket, and CI data; no production access. Relevant product and architecture context available via MCP. |
| Allowed actions | Inspect code and run checks in a disposable container. Post the review as a PR comment. The agent cannot push fixes or merge. |
| Output | Findings with evidence, missing checks, technical and strategic risk assessment, QA guidance, and stakeholder analysis with recommended actions and human involvement. All inside PR comments. |
| Owner | Billing engineering lead maintains the workflow. |
| Feedback | A separate periodic workflow analyzes run evidence and PR feedback, then proposes setup changes for team review. |
| Acceptance | Human reviewer decides on fixes and merge; risk and approval rules determine additional reviewers. |
Want a second set of eyes on your first review workflow? Talk to Solvd.
With these decisions in place, you can define the detailed controls: which MCP servers the agent can connect to, which tools it may call, what credentials and permissions it receives, and which network destinations it can reach. Use the review’s scope and complexity to choose the model and reasoning effort, balancing quality, response time, and cost. Allocate CPU, memory, storage, and execution time to match the work, whether that means inspecting code, running tests, or executing performance benchmarks.
Version and review the shared setup
In our experience, the workflow should be built like other software, with most of it runnable and testable locally. Keep its code, review instructions, and skills versioned in a shared repository, and review changes through PRs as you would application code. That gives the team a place to discuss and agree on changes before they become the shared default.
For example, publish the approved instructions and skills as a versioned agent plugin in an internal marketplace. If developers start finding workarounds, that may point to gaps in the shared setup. Make improvements easy to test locally and contribute back, keeping the team’s review practices consistent as they evolve.
Over time, the shared setup is also a natural place to grow tooling that evaluates the workflow itself, so the team can tell whether a new model, harness release, or instruction change actually improves the reviews. That’s a story for another day.
Give the reviewer the original requirement
Have workflow code assemble the starting context listed in the operating rules, including the requirements and acceptance criteria from the PR’s linked Linear or Jira ticket. Add domain references already known to be relevant, and record the ticket version or retrieval time.
The agent can then use approved MCP tools to retrieve additional context on demand from Confluence, service documentation, or other specialist sources. Its reusable instructions should explain where to start, which sources cover which topics, and when to consult them. For example, supply the invoice-calculation guide up front and let the agent fetch payment-reconciliation details if the change affects charges.
A developer or coding agent can overlook or misunderstand part of a ticket, then write a PR summary that reflects the same incomplete interpretation. In our billing example, the implementation might switch calculations to decimal arithmetic but leave the old rounding behavior unchanged. The summary can accurately describe that conversion while omitting the ticket’s requirement for final-total half-up rounding to two places. The reviewer needs a fresh context and the original acceptance criteria to catch what the implementation left out.
Prepare the environment for the review you want
Imagine we extend the billing review by adding one instruction: “Run performance benchmarks when a change could affect billing throughput.” Suppose the environment was prepared only for reading code, navigating the repository, and reasoning about requirements; running the application was never part of its setup.
Reviews become suspiciously slow and expensive. Whenever performance looks relevant, each agent starts assembling its own environment: finding runtime versions, installing dependencies, preparing fixtures, and working out how to launch the benchmark. The next review repeats the same work. Much of the review budget goes into setup before any performance evidence exists.
The fix is to make preparation a supported part of the workflow. You can provide the pinned runtime, dependencies, and synthetic billing fixtures before the agent starts. Or give the agent a documented command that prepares them automatically when a benchmark is needed. Define the storage, local services, and permissions that setup requires, and load the supported commands, prerequisites, and output locations into the agent’s instructions at runtime.
Preparing in advance makes the base environment heavier, but lets package downloads and any private-registry credentials stay in a separate setup stage. The review agent can then run with narrower network access. Preparing on demand keeps ordinary reviews lighter and adds setup time when benchmarks are needed, but may also require the agent’s runtime to reach a registry such as npm and use credentials for private packages. Choose based on both the setup overhead and the access you are willing to grant during review.
For example, implement and document these repository commands:
| Command | What it does |
|---|---|
make benchmark-prepare | Set up the pinned runtime, dependencies, synthetic fixtures, and local services when needed; make it safe to rerun. |
make benchmark-check | Verify runtime, dependencies, and fixtures; stop with a clear error if anything is missing. |
make benchmark-billing | Benchmark the current checkout using fixed fixtures; save results to artifacts/billing-benchmark.json. |
In either setup, run make benchmark-check before benchmarking; if preparation or readiness checks fail, report the benchmark as not run. Compare base and head revisions under the same benchmark conditions.
Track review cost, duration, and behavior
A successful review can still waste time and money. Collect measurements from the runner and provider records so you can see what each run costs and how that changes over time.
| Record for each run | What to capture |
|---|---|
| Duration | Total elapsed time, plus time spent preparing the environment, calling the model, and running tools or checks. |
| Cost and usage | Model usage and spend, compute and paid-tool costs, including retries. Label estimates where exact costs are unavailable. |
| Outcome | Completion or stopping reason, retries, failed checks, and missing evidence. |
| Review scope | Risk level the review assigned, code paths traced, and checks or benchmarks run. Record lines changed too, but not as a measure of effort. |
| Context and versions | Run ID and timestamp, reviewed revision, model and reasoning effort, harness version, instructions or plugin version, and environment version. |
Track typical runs and unusually slow or expensive ones, and compare similar work over time. PRs are not created equal, and lines changed are a poor proxy for complexity. A five-line change to invoice rounding can mean tracing every charge path and running the billing benchmark, while a 2,000-line rename or regenerated API client is long but mechanical. Group runs by review scope instead: low- and high-risk changes have different costs, as do reviews that inspect code and reviews that run benchmarks.
The configuration record lets you investigate changes after a model, instruction, or environment update. Judge savings alongside finding quality, reviewer effort, and downstream rework.
Use those measurements to set time, spend, retry, and concurrency limits, enforced by the runner. A stopped run returns its partial evidence and reason; it never becomes “no defects found.”
Analyze trajectories and recurring friction
Keep each run’s trajectory: the record of supplied context, tool calls and results, retries, checks, and final output. Link it to the run’s metrics so an analysis workflow can reconstruct where time and money went.
Give the agent a way to complain, even when it succeeds. Ask it to report missing context, failed tools, and unexpected setup work: what it tried, any workaround, what remains unverified, and links to the relevant steps. Feed those reports into the analysis alongside metrics and trajectories.
Use a separate workflow to build a picture of how the review agent is working across many PRs. Have another agent analyze unusually slow or costly runs, repeated failures, and a sample of ordinary successes, grouping recurring friction around context, tools, and setup. In the billing example, it could find that many successful reviews repeat the same dependency installation. As you add implementation, testing, or other SDLC workflows, extend the analysis across them to spot shared problems and gaps in their handoffs.
Once the team is requesting reviews, add its responses too: PR replies, emoji reactions, and the edits that follow. Combined, human and agent signals show not only that something went wrong, but why. Each alone is ambiguous: a thumbs-down doesn’t say what was wrong with a finding, and a cost spike doesn’t explain its cause. Suppose developers start dismissing findings about payment reconciliation. The trajectories show the agent stopped retrieving the reconciliation guide, its reports say the documentation tool timed out, and the run records show the shift began with the last environment update. Together they point to a single cause: the update blocked access to that source.
Ask for a prioritized report of recurring problems, affected runs, and proposed improvements, with links to representative traces. The owner works from that summary, opening individual trajectories to verify specific findings.
The codebase readiness article shows how to fix what recurs in the repository itself.
Roll out gradually and improve with feedback
Validate before the first live review
Before offering reviews on live PRs, test representative historical changes locally and in the shared environment, using the same versioned instructions or plugin. Include known defects and clean changes, and exercise context retrieval and any on-demand benchmark preparation.
| Trial | Required observation |
|---|---|
| Known defects and clean changes | Supported findings on defects; inspect false alarms on clean changes. |
| Missing ticket or failed setup | Explicit blocked/error result, with an owner. |
| Budget exhausted | Partial evidence and a stop; no clean-review claim. |
| Head changes in on-demand mode | Stale result withheld; next run needs a request. |
| Publication retries | No duplicate comment. |
Have another engineer operate it and recover a failed run without its author’s help.
Improve through requested reviews
Start with requested reviews in one repository. Link each team response to the finding and reviewed revision it concerns, and use these signals to assess whether the review helps people catch defects, plan testing, or make decisions. Agree what reactions mean; silence is not approval. Read the discussion and resulting edits before judging a finding’s correctness.
For example, “the linter covers this” suggests removing duplicated style checks; a missed rounding rule suggests adding its reference and a regression case. Test proposed changes against saved reviews and include the results in a PR for the team to discuss and approve. Then publish a new version of the shared instructions or plugin.
Expand to automatic reviews
When people routinely want the review and requesting it feels like a chore, consider automatic runs. Use the evidence collected so far to assess finding quality, reviewer effort, and predictable cost. Account for the expected increase in run volume and total spend as well as cost per review.
Define which PRs qualify—for example, non-draft PRs touching billing code with a linked ticket. Use a GitHub PR event for code changes, or a CI-completion event when the review needs test results for the captured revision. A new commit supersedes the previous review; cancel any active run or withhold its stale result, then apply the configured trigger to the new revision. Keep on-demand requests available and automatic runs easy to disable.
Define your first review workflow
Use the workflow definition checklist to record your review workflow’s inputs, permissions, owner, limits, and trial evidence. Complete it for one repository with the person who will accept the findings. The unresolved decisions tell you what to fix before the team requests its first review.
Get the checklist as a PDF: