[{"data":1,"prerenderedAt":55},["ShallowReactive",2],{"blog-claude-code-code-review":3,"blog-related-claude-code-code-review":39},{"slug":4,"title":5,"description":6,"category":7,"categoryId":8,"keyword":9,"date":10,"minutes":11,"body":12,"html":13,"headings":14},"claude-code-code-review","Using Claude Code to review code: \u002Fcode-review, yours and its own","How to review code with Claude Code: \u002Fcode-review targets and flags, a fresh-context reviewer subagent, ultrareview, and a checklist for AI-written diffs.","Workflows","workflows","claude code code review","2026-11-17",5,"Run `\u002Fcode-review` in a Claude Code session and it reviews the changes on your branch for correctness bugs, then reports what it found in the conversation. Point it at a pull request number, a branch, a path or a commit range, and add `--fix` to have Claude apply the findings. The command works on any plan and counts toward your usage like the rest of the session. This page covers the command, how to review Claude's own work without fooling yourself, and the other review tools in the box.\n\n## How do you run \u002Fcode-review?\n\n```text\n\u002Fcode-review\n```\n\nWith no target it reviews your branch's commits ahead of its upstream plus your uncommitted changes. If the branch has no upstream, it compares against `main`, or the previous commit. `\u002Freview` is an alias.\n\nIn a terminal session the review runs as a background subagent with its own context window, so it does not fill your conversation, and the findings arrive when it finishes. In a `-p` (headless) run it waits and prints the findings.\n\n## What can you point it at?\n\nType a target after the command:\n\n| To review | Type |\n| --- | --- |\n| Current branch and uncommitted changes | `\u002Fcode-review` |\n| Your last 15 commits | `\u002Fcode-review HEAD~15..HEAD` |\n| One branch against another | `\u002Fcode-review main...my-feature` |\n| A single commit | `\u002Fcode-review abc1234^..abc1234` |\n| A pull request | `\u002Fcode-review 1234` |\n| A file or directory | `\u002Fcode-review src\u002Fauth` |\n\nTwo flags change what happens next. `--fix` also asks Claude to apply the findings to your working tree afterward; its edits still go through your permission mode. `--comment` posts the findings on a GitHub pull request as inline comments (on a GitLab merge request it uses `glab` and posts a single note). Both need `gh` or `glab` set up as for any PR work; see [commit, push and open a PR](\u002Fblog\u002Fclaude-code-commit-and-pull-requests).\n\n## How much effort should a review use?\n\nPut an effort level first: `low`, `medium`, `high`, `xhigh` or `max`, as in `\u002Fcode-review high src\u002Fauth`. At `low` the review reports only the findings it is most confident about, so you get fewer false positives. From `medium` up it broadens coverage and may also flag reuse, simplification and efficiency cleanups. If you do not type a level, it reuses the last one you typed, even from an earlier session, and says so. `--max-findings \u003Cn>` (or `all`) raises the cap on how many findings are reported.\n\nA reasonable routine: `low` on every branch before you push, `high` on risky or large changes.\n\n## How do you review Claude's own code without grading your own homework?\n\nA model that wrote the code carries its assumptions into the review. Three ways to break that:\n\n**Review from a clean context.** `\u002Fcode-review` already runs as a separate subagent with its own context window. If you want a reviewer with your standards baked in, write a [subagent](\u002Fblog\u002Fclaude-code-subagents) in `.claude\u002Fagents\u002Freviewer.md`:\n\n```md\n---\nname: reviewer\ndescription: Reviews a diff for bugs, missing tests and security problems. Use after code changes.\ntools: Read, Grep, Glob, Bash\n---\n\nYou review code you did not write. Run `git diff main...HEAD`. For each\nproblem report: file and line, what breaks, and a concrete fix. Check that\nnew behavior has tests and that tests assert something. Do not edit files.\nSkip style nits the linter already catches.\n```\n\n**Put your rules in CLAUDE.md.** The review follows your `CLAUDE.md`, including in `-p` runs. It does not read a `REVIEW.md`; that file is for a different, managed GitHub review service. Rules like \"all SQL goes through the query builder\" or \"never log request bodies\" become review criteria for free. See [writing a CLAUDE.md](\u002Fblog\u002Fclaude-md-guide).\n\n**Run something that is not a model.** Tests, type checks and a linter disagree with Claude for reasons Claude cannot talk away. `\u002Fverify` goes further and builds and runs your app to confirm a change does what it should.\n\n## What else is there besides \u002Fcode-review?\n\n- **`\u002Fsecurity-review`** analyzes your branch against origin's default branch for injection, auth problems and data exposure. It needs an `origin` remote.\n- **`\u002Fsimplify`** reviews changed code for reuse, simplification and efficiency, then applies the fixes. It does not hunt for bugs.\n- **`\u002Fdiff`** shows your working tree, including Claude's edits so far. Often the best review is reading it yourself.\n- **Ultrareview** is a deeper, multi-agent review that runs in the cloud. `\u002Fcode-review ultra` starts it from a session, and `claude ultrareview` runs it from a script or CI and prints the findings. It needs a claude.ai login and is not available on every provider or organization setup; read the ultrareview page for limits and cost on your plan.\n- **Managed Code Review on GitHub** reviews every pull request automatically once an organization Owner turns it on. That is a service, separate from the local command.\n\n## A checklist for reviewing AI-written diffs\n\nWhoever reviews, check these, because they are where assistant-written changes tend to go wrong:\n\n1. Did the tests change? Read test diffs first. A loosened assertion or a deleted test is a bigger signal than any source line.\n2. Is there new behavior without a test?\n3. Did it add a dependency, a config flag or a feature you did not ask for?\n4. Are error paths handled, or only the happy path?\n5. Did it touch files outside the task's scope?\n6. Is anything duplicated that already exists elsewhere in the repo?\n7. Do secrets, `.env` files or debug logging appear in the diff?\n\nThen run the suite yourself. Ask Claude to explain any hunk you do not understand; if its explanation does not convince you, the code is not ready.\n\n## How does review fit into the rest of the flow?\n\nA loop that works: build in a [worktree or branch](\u002Fblog\u002Fclaude-code-git-worktrees), run `\u002Fcode-review low`, fix or `--fix`, read the diff yourself, commit, push, open the PR, and let your human reviewers (or the managed service) take it from there. For code written test-first, the tests are the first reviewer; see [test-driven development with Claude Code](\u002Fblog\u002Fclaude-code-test-driven-development). If Claude's `--fix` edits go wrong, [undoing them](\u002Fblog\u002Fundo-claude-code-changes) is easier when you committed first, and note that a background review's fixes fall outside `\u002Frewind`.\n\n## In Relais\n\nRelais is a layer over Claude Code, and its composer's `\u002F` menu lists Claude Code's commands and skills, so look for `\u002Fcode-review` there. What Relais adds is the reading side. The Changes tab lists what each repository of the project has uncommitted, with a dot on what the current session changed, and a diff opens when you click a file. Edits Claude proposes come with their diff in the conversation before you approve them. See [features](\u002Ffeatures).","\u003Cp>Run \u003Ccode>\u002Fcode-review\u003C\u002Fcode> in a Claude Code session and it reviews the changes on your branch for correctness bugs, then reports what it found in the conversation. Point it at a pull request number, a branch, a path or a commit range, and add \u003Ccode>--fix\u003C\u002Fcode> to have Claude apply the findings. The command works on any plan and counts toward your usage like the rest of the session. This page covers the command, how to review Claude&#39;s own work without fooling yourself, and the other review tools in the box.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-run-code-review\">\u003Ca class=\"anchor\" href=\"#how-do-you-run-code-review\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you run \u002Fcode-review?\u003C\u002Fh2>\n\u003Cpre class=\"code\" data-lang=\"text\">\u003Ccode>\u002Fcode-review\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>With no target it reviews your branch&#39;s commits ahead of its upstream plus your uncommitted changes. If the branch has no upstream, it compares against \u003Ccode>main\u003C\u002Fcode>, or the previous commit. \u003Ccode>\u002Freview\u003C\u002Fcode> is an alias.\u003C\u002Fp>\n\u003Cp>In a terminal session the review runs as a background subagent with its own context window, so it does not fill your conversation, and the findings arrive when it finishes. In a \u003Ccode>-p\u003C\u002Fcode> (headless) run it waits and prints the findings.\u003C\u002Fp>\n\u003Ch2 id=\"what-can-you-point-it-at\">\u003Ca class=\"anchor\" href=\"#what-can-you-point-it-at\" aria-label=\"Link to this section\">#\u003C\u002Fa>What can you point it at?\u003C\u002Fh2>\n\u003Cp>Type a target after the command:\u003C\u002Fp>\n\u003Cdiv class=\"table-wrap\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>To review\u003C\u002Fth>\u003Cth>Type\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Current branch and uncommitted changes\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Your last 15 commits\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review HEAD~15..HEAD\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>One branch against another\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review main...my-feature\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>A single commit\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review abc1234^..abc1234\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>A pull request\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review 1234\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>A file or directory\u003C\u002Ftd>\u003Ctd>\u003Ccode>\u002Fcode-review src\u002Fauth\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>Two flags change what happens next. \u003Ccode>--fix\u003C\u002Fcode> also asks Claude to apply the findings to your working tree afterward; its edits still go through your permission mode. \u003Ccode>--comment\u003C\u002Fcode> posts the findings on a GitHub pull request as inline comments (on a GitLab merge request it uses \u003Ccode>glab\u003C\u002Fcode> and posts a single note). Both need \u003Ccode>gh\u003C\u002Fcode> or \u003Ccode>glab\u003C\u002Fcode> set up as for any PR work; see \u003Ca href=\"\u002Fblog\u002Fclaude-code-commit-and-pull-requests\">commit, push and open a PR\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"how-much-effort-should-a-review-use\">\u003Ca class=\"anchor\" href=\"#how-much-effort-should-a-review-use\" aria-label=\"Link to this section\">#\u003C\u002Fa>How much effort should a review use?\u003C\u002Fh2>\n\u003Cp>Put an effort level first: \u003Ccode>low\u003C\u002Fcode>, \u003Ccode>medium\u003C\u002Fcode>, \u003Ccode>high\u003C\u002Fcode>, \u003Ccode>xhigh\u003C\u002Fcode> or \u003Ccode>max\u003C\u002Fcode>, as in \u003Ccode>\u002Fcode-review high src\u002Fauth\u003C\u002Fcode>. At \u003Ccode>low\u003C\u002Fcode> the review reports only the findings it is most confident about, so you get fewer false positives. From \u003Ccode>medium\u003C\u002Fcode> up it broadens coverage and may also flag reuse, simplification and efficiency cleanups. If you do not type a level, it reuses the last one you typed, even from an earlier session, and says so. \u003Ccode>--max-findings &lt;n&gt;\u003C\u002Fcode> (or \u003Ccode>all\u003C\u002Fcode>) raises the cap on how many findings are reported.\u003C\u002Fp>\n\u003Cp>A reasonable routine: \u003Ccode>low\u003C\u002Fcode> on every branch before you push, \u003Ccode>high\u003C\u002Fcode> on risky or large changes.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-review-claude-39-s-own-code-without-grading-your-own-homework\">\u003Ca class=\"anchor\" href=\"#how-do-you-review-claude-39-s-own-code-without-grading-your-own-homework\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you review Claude&#39;s own code without grading your own homework?\u003C\u002Fh2>\n\u003Cp>A model that wrote the code carries its assumptions into the review. Three ways to break that:\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Review from a clean context.\u003C\u002Fstrong> \u003Ccode>\u002Fcode-review\u003C\u002Fcode> already runs as a separate subagent with its own context window. If you want a reviewer with your standards baked in, write a \u003Ca href=\"\u002Fblog\u002Fclaude-code-subagents\">subagent\u003C\u002Fa> in \u003Ccode>.claude\u002Fagents\u002Freviewer.md\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"md\">\u003Ccode>---\nname: reviewer\ndescription: Reviews a diff for bugs, missing tests and security problems. Use after code changes.\ntools: Read, Grep, Glob, Bash\n---\n\nYou review code you did not write. Run `git diff main...HEAD`. For each\nproblem report: file and line, what breaks, and a concrete fix. Check that\nnew behavior has tests and that tests assert something. Do not edit files.\nSkip style nits the linter already catches.\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>Put your rules in CLAUDE.md.\u003C\u002Fstrong> The review follows your \u003Ccode>CLAUDE.md\u003C\u002Fcode>, including in \u003Ccode>-p\u003C\u002Fcode> runs. It does not read a \u003Ccode>REVIEW.md\u003C\u002Fcode>; that file is for a different, managed GitHub review service. Rules like &quot;all SQL goes through the query builder&quot; or &quot;never log request bodies&quot; become review criteria for free. See \u003Ca href=\"\u002Fblog\u002Fclaude-md-guide\">writing a CLAUDE.md\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Run something that is not a model.\u003C\u002Fstrong> Tests, type checks and a linter disagree with Claude for reasons Claude cannot talk away. \u003Ccode>\u002Fverify\u003C\u002Fcode> goes further and builds and runs your app to confirm a change does what it should.\u003C\u002Fp>\n\u003Ch2 id=\"what-else-is-there-besides-code-review\">\u003Ca class=\"anchor\" href=\"#what-else-is-there-besides-code-review\" aria-label=\"Link to this section\">#\u003C\u002Fa>What else is there besides \u002Fcode-review?\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>\u003Ccode>\u002Fsecurity-review\u003C\u002Fcode>\u003C\u002Fstrong> analyzes your branch against origin&#39;s default branch for injection, auth problems and data exposure. It needs an \u003Ccode>origin\u003C\u002Fcode> remote.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>\u003Ccode>\u002Fsimplify\u003C\u002Fcode>\u003C\u002Fstrong> reviews changed code for reuse, simplification and efficiency, then applies the fixes. It does not hunt for bugs.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>\u003Ccode>\u002Fdiff\u003C\u002Fcode>\u003C\u002Fstrong> shows your working tree, including Claude&#39;s edits so far. Often the best review is reading it yourself.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Ultrareview\u003C\u002Fstrong> is a deeper, multi-agent review that runs in the cloud. \u003Ccode>\u002Fcode-review ultra\u003C\u002Fcode> starts it from a session, and \u003Ccode>claude ultrareview\u003C\u002Fcode> runs it from a script or CI and prints the findings. It needs a claude.ai login and is not available on every provider or organization setup; read the ultrareview page for limits and cost on your plan.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Managed Code Review on GitHub\u003C\u002Fstrong> reviews every pull request automatically once an organization Owner turns it on. That is a service, separate from the local command.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"a-checklist-for-reviewing-ai-written-diffs\">\u003Ca class=\"anchor\" href=\"#a-checklist-for-reviewing-ai-written-diffs\" aria-label=\"Link to this section\">#\u003C\u002Fa>A checklist for reviewing AI-written diffs\u003C\u002Fh2>\n\u003Cp>Whoever reviews, check these, because they are where assistant-written changes tend to go wrong:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Did the tests change? Read test diffs first. A loosened assertion or a deleted test is a bigger signal than any source line.\u003C\u002Fli>\n\u003Cli>Is there new behavior without a test?\u003C\u002Fli>\n\u003Cli>Did it add a dependency, a config flag or a feature you did not ask for?\u003C\u002Fli>\n\u003Cli>Are error paths handled, or only the happy path?\u003C\u002Fli>\n\u003Cli>Did it touch files outside the task&#39;s scope?\u003C\u002Fli>\n\u003Cli>Is anything duplicated that already exists elsewhere in the repo?\u003C\u002Fli>\n\u003Cli>Do secrets, \u003Ccode>.env\u003C\u002Fcode> files or debug logging appear in the diff?\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Then run the suite yourself. Ask Claude to explain any hunk you do not understand; if its explanation does not convince you, the code is not ready.\u003C\u002Fp>\n\u003Ch2 id=\"how-does-review-fit-into-the-rest-of-the-flow\">\u003Ca class=\"anchor\" href=\"#how-does-review-fit-into-the-rest-of-the-flow\" aria-label=\"Link to this section\">#\u003C\u002Fa>How does review fit into the rest of the flow?\u003C\u002Fh2>\n\u003Cp>A loop that works: build in a \u003Ca href=\"\u002Fblog\u002Fclaude-code-git-worktrees\">worktree or branch\u003C\u002Fa>, run \u003Ccode>\u002Fcode-review low\u003C\u002Fcode>, fix or \u003Ccode>--fix\u003C\u002Fcode>, read the diff yourself, commit, push, open the PR, and let your human reviewers (or the managed service) take it from there. For code written test-first, the tests are the first reviewer; see \u003Ca href=\"\u002Fblog\u002Fclaude-code-test-driven-development\">test-driven development with Claude Code\u003C\u002Fa>. If Claude&#39;s \u003Ccode>--fix\u003C\u002Fcode> edits go wrong, \u003Ca href=\"\u002Fblog\u002Fundo-claude-code-changes\">undoing them\u003C\u002Fa> is easier when you committed first, and note that a background review&#39;s fixes fall outside \u003Ccode>\u002Frewind\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"in-relais\">\u003Ca class=\"anchor\" href=\"#in-relais\" aria-label=\"Link to this section\">#\u003C\u002Fa>In Relais\u003C\u002Fh2>\n\u003Cp>Relais is a layer over Claude Code, and its composer&#39;s \u003Ccode>\u002F\u003C\u002Fcode> menu lists Claude Code&#39;s commands and skills, so look for \u003Ccode>\u002Fcode-review\u003C\u002Fcode> there. What Relais adds is the reading side. The Changes tab lists what each repository of the project has uncommitted, with a dot on what the current session changed, and a diff opens when you click a file. Edits Claude proposes come with their diff in the conversation before you approve them. See \u003Ca href=\"\u002Ffeatures\">features\u003C\u002Fa>.\u003C\u002Fp>\n",[15,18,21,24,27,30,33,36],{"id":16,"text":17},"how-do-you-run-code-review","How do you run \u002Fcode-review?",{"id":19,"text":20},"what-can-you-point-it-at","What can you point it at?",{"id":22,"text":23},"how-much-effort-should-a-review-use","How much effort should a review use?",{"id":25,"text":26},"how-do-you-review-claude-39-s-own-code-without-grading-your-own-homework","How do you review Claude&#39;s own code without grading your own homework?",{"id":28,"text":29},"what-else-is-there-besides-code-review","What else is there besides \u002Fcode-review?",{"id":31,"text":32},"a-checklist-for-reviewing-ai-written-diffs","A checklist for reviewing AI-written diffs",{"id":34,"text":35},"how-does-review-fit-into-the-rest-of-the-flow","How does review fit into the rest of the flow?",{"id":37,"text":38},"in-relais","In Relais",[40,45,50],{"slug":41,"title":42,"description":43,"category":7,"categoryId":8,"keyword":44,"date":10,"minutes":11},"claude-code-multi-repo-projects","Claude Code across several repositories: --add-dir and layouts","How to work with Claude Code on a project split across repos: launch from a parent folder, --add-dir, what config loads from extra folders, and commits.","claude code multiple repositories",{"slug":46,"title":47,"description":48,"category":7,"categoryId":8,"keyword":49,"date":10,"minutes":11},"claude-code-commit-and-pull-requests","Commit, push and open a pull request with Claude Code","How to have Claude Code write commit messages, push a branch and open a PR with gh: prompts that work, permission rules, attribution settings and checks.","claude code commit and pull request",{"slug":51,"title":52,"description":53,"category":7,"categoryId":8,"keyword":54,"date":10,"minutes":11},"claude-code-git-worktrees","Git worktrees with Claude Code: parallel features, no conflicts","Run Claude Code in a git worktree with one flag: separate branches, no stepping on each other's files. Setup, cleanup, base branches and the gotchas.","claude code git worktrees",1794931098788]