Reviewing Code Without amp review
amp review has been removed from the Amp CLI. Project-defined checks in .agents/checks/ are deprecated too, including the @amp/review-checks plugin that runs them. In
our evals, checks often made reviews worse rather than better.
To review code, ask Amp directly with a prompt that says what to review and what to look for. If
you ran amp review from a script, replace it with a short wrapper around amp -x.
Write a Review Prompt
A good review prompt tells Amp these things:
- What to review. Name the exact changes, e.g., the uncommitted changes, a commit SHA, a branch compared with its base, or a pull request number or URL. You can also pipe the diff into Amp.
- What to look for. Asking for “bugs” is too vague to help. Name the specific mistakes that are easy to make in your codebase, e.g., “a new SQL query on the orders table without an index”. Keep a list of these footguns, add the cause of each past incident to it, and include the list in the prompt.
- What the result should look like. Ask for the file, line, problem, and suggested fix for each finding. If a script reads the output, describe the exact format you want.
- That the review is read-only. Tell Amp not to edit files.
If you used checks, the problems they described are a good start for your footgun list.
Keep a Footgun List
Write the list in a file in your repository, e.g., review-footguns.md, so your team can add to
it after each incident:
- A new SQL query on the orders or events table that does not use an index.
- An async call whose result is not awaited, so its errors are lost.
- A change to an API response type without the same change in the web client.
- A new background job that does not handle being run twice. Wrap the Prompt in a Script
Save the prompt in a script so you and your team run the same review every time:
#!/usr/bin/env bash
# review.sh: review the changes since the merge base with a base branch.
set -euo pipefail
base="${1:-origin/main}"
amp -x "Review the changes since the merge base with $base \
(git diff --merge-base $base). Do not edit files. Check the changed code for \
the problems in this list, which caused bugs or incidents in this codebase:
$(cat review-footguns.md)
For each problem you find, give the file, the line, what is wrong, and a \
suggested fix. If you find none, say so." To review a diff you already have, pipe it into Amp:
git diff HEAD~1 | amp -x "Review this diff for the problems in review-footguns.md. Do not edit files." Execute mode prints Amp’s final reply, so you can save it to a file or pass it to another program. See Execute Mode for more scripting options.