This guide shows how to review AI generated code before merging it, in seven steps. AI coding agents can open pull requests quickly — Devin Desktop’s subagents open their own PRs, and its PR review workflow shows CI status — but a green check does not mean the code is right. Augment Code adds AI code review for GitHub pull requests, with human-in-the-loop checkpoints. The review is still yours to do, and the steps below work the same whatever produced the code.
Step 1: Read the diff, not just the summary
Start with the diff itself, not the summary the agent wrote. The summary tells you what the agent thinks it changed; the diff shows what actually changed. Read every file in the PR, including the ones that look routine — generated code can touch files you did not expect. If the diff is large, ask the agent to split it into smaller PRs, one per piece of work, so each one can be read properly. Devin Desktop’s subagents already work this way, opening a separate PR for each piece.
Step 2: Check what the change was asked to do
Before judging the code, check the brief or ticket it answers. The change should do what was asked — nothing more, nothing less. Compare the diff with the brief: does it cover every item, and did it add anything nobody asked for? The Devin Desktop Prompts library has a review brief that starts from the same check: read the diff, flag logic errors and missing tests, and list what must change before merge. If the brief is unclear, the review cannot be clear either — rewrite the brief before reviewing the code.
Step 3: Run the tests and check CI
Run the tests yourself and check the CI status shown in the PR review workflow. A passing build means the code compiles and the tests that exist pass; it does not mean the change is correct or complete. Look for the tests the change should have added and check whether they exist. If the tests are thin or missing, ask the agent to add them before you merge. A PR with no new tests for new behaviour is not ready, however green its CI is.
Step 4: Look for logic errors, security issues and missing edge cases
Now read for what tests cannot catch. Check the logic step by step: does the code do what the brief asked in every branch, not just the happy path? Look for security issues — user input that reaches a query, secrets in code, and permissions that are wider than needed. Look for the edge cases the agent did not handle: empty lists, missing values, dates and time zones, and inputs at the limits. Augment Code’s Context Engine gives its AI code review an understanding of the whole codebase, which helps it spot problems that span files — but the final check is still a human reading the code.
Step 5: Ask for changes where the code is unclear
If you cannot follow the code, say so — unclear code is a defect, not a style preference. Ask the agent to rename what is vague, split what is long, and explain what is surprising. Generated code often works but reads badly: duplicated logic, names that say nothing, and comments that restate the code instead of explaining why it exists. The fix is a change request, not a shrug. A PR should be readable by the next person who opens it, not only by the agent that wrote it.
Step 6: Keep a human in the loop before merge
No merge should happen without a human decision. Augment Code builds human-in-the-loop checkpoints into its agent loops, and the same rule applies here: a person reads the diff, runs the checks and approves the merge. Devin Desktop’s PR review workflow shows CI status so the reviewer can see the checks before deciding. Do not let an agent merge its own PR, and do not approve a PR you have not read. The checkpoint is the point of the review — without it, the earlier steps are only notes.
Step 7: Merge, then watch the change in production
Once the review is done and CI is green, merge the PR — and then watch the change. Check the logs and metrics after it ships, and confirm the behaviour you reviewed is the behaviour running in production. If something looks wrong, the record of the review tells you what was checked and what was not, and the PR can be reverted while the problem is investigated. The review does not end at the merge; it ends when the change is running as intended.
That is the whole process: read the diff, check the brief, run the tests and CI, look for logic errors, security issues and missing edge cases, ask for changes where the code is unclear, keep a human in the loop, and watch the change after it merges.
