modified
--- a/code-review.md +++ b/code-review.md @@ -2,7 +2,7 @@ Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues. A review with no findings doesn’t mean your code is error-free or secure. -To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). Claude can also review code without this service. Run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options. +To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). To get a review another way, run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options. ## Availability @@ -40,7 +40,7 @@ ## How reviews work -By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages: +By default, Code Review focuses on correctness: bugs that would break production. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages: 1. **Find** : several agents examine the diff and the surrounding code in parallel. 2. **Verify** : a verification step checks the candidate findings against the code and filters out false positives. @@ -53,7 +53,7 @@ * **A check run** : named **Claude Code Review** , with the findings listed in its [details](</docs/en/code-review-pull-requests#check-run-output>). The check run doesn’t conclude as a failure. * **A note in place of findings** : posted when the check run’s title reads **Code review found no issues** -Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After an Owner turns on Code Review, each repository has a setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>): once when a pull request opens, after every push, or only on request. Whichever it is, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>). +Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After turning on Code Review, an Owner can change each repository’s setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>). Whichever option is set, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>). ### Review levels @@ -75,7 +75,7 @@ ### Who controls a review - * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository. + * **Who can start one** : where reviews run automatically, opening or pushing to a pull request can start a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. Only a person with write access to the repository can start one with a [comment command](</docs/en/code-review-pull-requests#comment-commands>). * **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>). ## Compare ways to get a review @@ -86,7 +86,7 @@ ---|---|---|--- Code Review| Pull request activity, as each repository is set, or an `@claude review` comment| Anthropic infrastructure| Organizations on a Team or Enterprise plan with GitHub repositories, once an Owner turns it on [`/code-review`](</docs/en/code-review-local>)| You run the command on your branch| Your Claude Code session| Anyone, on any plan -[Ultrareview](</docs/en/ultrareview>)| You start it from Claude Code| A cloud sandbox| Requires signing in with a claude.ai account. See [Ultrareview](</docs/en/ultrareview>) for where it isn’t available +[Ultrareview](</docs/en/ultrareview>)| You start it from Claude Code| A cloud sandbox| Requires signing in with a claude.ai account. See [Ultrareview](</docs/en/ultrareview>) for availability Claude in your own CI, with [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>)| Your pipeline’s events, such as every pull request or merge request| Your own CI runners| Anyone with a Claude API key or cloud provider credentials, on GitHub or GitLab Your own reviewer, as a [subagent](</docs/en/sub-agents>) or [skill](</docs/en/skills>)| You or Claude invoke it during a session| Wherever you run Claude Code| Anyone who writes one
modified
--- a/code-review.md +++ b/code-review.md @@ -6,7 +6,7 @@ ## Availability -Check that your organization qualifies before you set up Code Review: +Check these requirements before setting up Code Review: * **Plans** : [Team and Enterprise](</docs/en/feature-availability>) * **Code hosts** : repositories hosted on GitHub, including [GitHub Enterprise Server](</docs/en/github-enterprise-server>) and GitHub Enterprise Cloud with data residency. For data residency, have an Owner follow the [GitHub Enterprise Server admin setup](</docs/en/github-enterprise-server#admin-setup>) and enter your enterprise’s `ghe.com` hostname.
modified
--- a/code-review.md +++ b/code-review.md @@ -1,4 +1,4 @@ -With Code Review, Claude reviews the pull requests in your GitHub repositories. Several agents read each change alongside the surrounding code, looking for issues such as logic errors, security vulnerabilities, or broken edge cases. A verification step checks findings against the code before they’re reported. Findings arrive as inline comments on the lines concerned, ranked by [severity](</docs/en/code-review-pull-requests#severity-levels>), with a summary and a check run on the pull request. A review never approves or blocks the pull request, so the decision to merge stays with your team. +With Code Review, Claude reviews the pull requests in your GitHub repositories. Several agents read each change alongside the surrounding code, looking for issues such as logic errors, security vulnerabilities, or broken edge cases. A verification step checks findings against the code before they’re reported. Findings arrive as inline comments on the lines concerned, ranked by [severity](</docs/en/code-review-pull-requests#severity-levels>), with a summary and a check run on the pull request. By itself, a review doesn’t approve or block the pull request. Its result counts toward approvals in a repository whose [Claude Approvals](</docs/en/approvals>) policy file uses it. Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues. A review with no findings doesn’t mean your code is error-free or secure.
modified
Show diff (103 lines)
--- a/code-review.md +++ b/code-review.md @@ -4,11 +4,7 @@ To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). Claude can also review code without this service. Run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options. -## - -​ - -Availability +## Availability Check that your organization qualifies before you set up Code Review: @@ -18,11 +14,7 @@ * **Encryption keys** : Code Review isn’t yet available for organizations that use customer-managed encryption keys (CMEK). * **Cloud providers** : you need a Claude organization on one of these plans even if your developers use Claude Code through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry -## - -​ - -Set up and use Code Review +## Set up and use Code Review Pick the page for what you need to do: @@ -46,11 +38,7 @@ See how reviews are billed, estimate spend, set the monthly spend limit, and track review activity -## - -​ - -How reviews work +## How reviews work By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages: @@ -67,11 +55,7 @@ Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After an Owner turns on Code Review, each repository has a setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>): once when a pull request opens, after every push, or only on request. Whichever it is, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>). -### - -​ - -Review levels +### Review levels The review level sets how thorough each review is, and a more thorough review costs more: @@ -81,11 +65,7 @@ An Owner [chooses one level for the organization](</docs/en/code-review-setup#set-the-default-review-level>) and can give an individual repository its own, such as Quick for a routine codebase and Deep for a critical one. For what else drives the cost of each review, see [Code Review costs and usage](</docs/en/code-review-costs>). -### - -​ - -What a review can access +### What a review can access A review reaches your repository through the Claude GitHub App that an Owner [installs during setup](</docs/en/code-review-setup#turn-on-code-review>): @@ -93,20 +73,12 @@ * **What it reads and writes** : inside a review, access to your repository is read-only, and a review doesn’t push commits. On the pull request, it posts comments and the [check run](</docs/en/code-review-pull-requests#check-run-output>), resolves its own earlier comment threads, and can react to a comment command with 👀. The app itself holds a [broader permission set](</docs/en/github-actions#github-app-permissions>) that other Claude features share. * **How it examines your code** : a review works from reading the diff and the surrounding code, without building or running your code. -### - -​ - -Who controls a review +### Who controls a review * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository. * **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>). -## - -​ - -Compare ways to get a review +## Compare ways to get a review To find the options open to you, check the **Who can use it** column against your plan and code host: @@ -118,11 +90,7 @@ Claude in your own CI, with [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>)| Your pipeline’s events, such as every pull request or merge request| Your own CI runners| Anyone with a Claude API key or cloud provider credentials, on GitHub or GitLab Your own reviewer, as a [subagent](</docs/en/sub-agents>) or [skill](</docs/en/skills>)| You or Claude invoke it during a session| Wherever you run Claude Code| Anyone who writes one -## - -​ - -Related resources +## Related resources * [GitHub Enterprise Server](</docs/en/github-enterprise-server>): use Code Review with a self-hosted GitHub instance * [GitHub App permissions](</docs/en/github-actions#github-app-permissions>): the full permission set the Claude GitHub App requests
modified
--- a/code-review.md +++ b/code-review.md @@ -63,7 +63,7 @@ * **Findings** : inline comments on the lines concerned, with a summary in the review body * **A check run** : named **Claude Code Review** , with the findings listed in its [details](</docs/en/code-review-pull-requests#check-run-output>). The check run doesn’t conclude as a failure. - * **When it finds nothing** : the check run’s title reads **Code review found no issues** , and Claude posts the same short note on the pull request + * **A note in place of findings** : posted when the check run’s title reads **Code review found no issues** Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After an Owner turns on Code Review, each repository has a setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>): once when a pull request opens, after every push, or only on request. Whichever it is, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>).
modified
--- a/code-review.md +++ b/code-review.md @@ -99,7 +99,7 @@ Who controls a review - * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository. + * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository. * **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>). ##
modified
Show diff (509 lines)
--- a/code-review.md +++ b/code-review.md @@ -1,14 +1,50 @@ -Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled or with the [HIPAA configuration](</docs/en/hipaa-setup>) applied, and is not covered under Anthropic’s BAA. On other plans, you can still review a diff locally with the `/code-review` command. +With Code Review, Claude reviews the pull requests in your GitHub repositories. Several agents read each change alongside the surrounding code, looking for issues such as logic errors, security vulnerabilities, or broken edge cases. A verification step checks findings against the code before they’re reported. Findings arrive as inline comments on the lines concerned, ranked by [severity](</docs/en/code-review-pull-requests#severity-levels>), with a summary and a check run on the pull request. A review never approves or blocks the pull request, so the decision to merge stays with your team. -Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers: +Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues. A review with no findings doesn’t mean your code is error-free or secure. - * How reviews work - * Setup - * Triggering reviews manually with `@claude review` and `@claude review always` - * Customizing reviews with `CLAUDE.md` and `REVIEW.md` - * Pricing - * Troubleshooting failed runs and missing comments - * Reviewing a diff locally with the `/code-review` command +To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). Claude can also review code without this service. Run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options. + +## + +​ + +Availability + +Check that your organization qualifies before you set up Code Review: + + * **Plans** : [Team and Enterprise](</docs/en/feature-availability>) + * **Code hosts** : repositories hosted on GitHub, including [GitHub Enterprise Server](</docs/en/github-enterprise-server>) and GitHub Enterprise Cloud with data residency. For data residency, have an Owner follow the [GitHub Enterprise Server admin setup](</docs/en/github-enterprise-server#admin-setup>) and enter your enterprise’s `ghe.com` hostname. + * **Data retention** : Code Review isn’t available to organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled or with the [HIPAA configuration](</docs/en/hipaa-setup>) applied, and isn’t covered under Anthropic’s Business Associate Agreement (BAA). + * **Encryption keys** : Code Review isn’t yet available for organizations that use customer-managed encryption keys (CMEK). + * **Cloud providers** : you need a Claude organization on one of these plans even if your developers use Claude Code through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry + +## + +​ + +Set up and use Code Review + +Pick the page for what you need to do: + +## Set up Code Review + +Check the requirements, install the Claude GitHub App, and choose repositories, a review level, and when reviews run + +## Customize Code Review + +Tune what gets flagged with `REVIEW.md` and `CLAUDE.md` files in your repository + +## Read and request reviews on a pull request + +Read the findings and their severities, and request another review with a comment + +## Troubleshoot Code Review + +Fix a review that didn’t start, failed, or was skipped for budget + +## Code Review costs and usage + +See how reviews are billed, estimate spend, set the monthly spend limit, and track review activity ## @@ -16,396 +52,71 @@ How reviews work -Once an Owner enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts a review on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Owners can monitor review activity and spend via the analytics dashboard. +By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages: + + 1. **Find** : several agents examine the diff and the surrounding code in parallel. + 2. **Verify** : a verification step checks the candidate findings against the code and filters out false positives. + 3. **Rank** : the findings that remain are deduplicated and ranked by severity. + 4. **Post** : the review posts its results on the pull request. + +Each review leaves these on the pull request: + + * **Findings** : inline comments on the lines concerned, with a summary in the review body + * **A check run** : named **Claude Code Review** , with the findings listed in its [details](</docs/en/code-review-pull-requests#check-run-output>). The check run doesn’t conclude as a failure. + * **When it finds nothing** : the check run’s title reads **Code review found no issues** , and Claude posts the same short note on the pull request + +Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After an Owner turns on Code Review, each repository has a setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>): once when a pull request opens, after every push, or only on request. Whichever it is, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>). ### ​ -Severity levels +Review levels -Each finding is tagged with a severity level: +The review level sets how thorough each review is, and a more thorough review costs more: -Marker| Severity| Meaning ----|---|--- -🔴| Important| A bug that should be fixed before merging -🟡| Nit| A minor issue, worth fixing but not blocking -🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR + * **Quick** : a lighter pass. The fastest level, at the lowest cost. + * **Standard** : balanced depth, speed, and cost. The default level. + * **Deep** : the most thorough pass. Takes the longest and costs the most. -Findings include a collapsed **Why this was flagged** section that you can expand to read why Claude flagged the issue and how it verified the problem. +An Owner [chooses one level for the organization](</docs/en/code-review-setup#set-the-default-review-level>) and can give an individual repository its own, such as Quick for a routine codebase and Deep for a critical one. For what else drives the cost of each review, see [Code Review costs and usage](</docs/en/code-review-costs>). ### ​ -Rate and reply to findings +What a review can access -Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review` as a top-level PR comment. To dismiss a finding without a code change, resolve its thread; replying doesn’t dismiss it. +A review reaches your repository through the Claude GitHub App that an Owner [installs during setup](</docs/en/code-review-setup#turn-on-code-review>): + + * **Where it runs** : on Anthropic infrastructure, in a managed environment. Reviews don’t run in [self-hosted environments](</docs/en/self-hosted-environments>). + * **What it reads and writes** : inside a review, access to your repository is read-only, and a review doesn’t push commits. On the pull request, it posts comments and the [check run](</docs/en/code-review-pull-requests#check-run-output>), resolves its own earlier comment threads, and can react to a comment command with 👀. The app itself holds a [broader permission set](</docs/en/github-actions#github-app-permissions>) that other Claude features share. + * **How it examines your code** : a review works from reading the diff and the surrounding code, without building or running your code. ### ​ -Check run output +Who controls a review -Beyond the inline review comments, each review populates the **Claude Code Review** check run that appears alongside your CI checks. Expand its **Details** link to see a summary of every finding in one place, sorted by severity: - -Severity| File:Line| Issue ----|---|--- -🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active -🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input - -Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. Annotations and the severity table are written to the check run independently of inline review comments, so they remain available even if GitHub rejects an inline comment on a line that moved. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq. To find the check run ID, list the commit’s check runs with `gh api repos/OWNER/REPO/commits/<commit-sha>/check-runs --jq '.check_runs[] | {id, name}'` and take the `id` of the `Claude Code Review` run. Replace `OWNER`, `REPO`, and `CHECK_RUN_ID` with your repository owner, repository name, and that ID: - - gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID \ - --jq '.output.text | split("bughunter-severity: ")[1] | split(" -->")[0] | fromjson' - -This returns a JSON object with counts per severity, for example `{"normal": 2, "nit": 1, "pre_existing": 0}`. The `normal` key holds the count of Important findings; a non-zero value means Claude found at least one bug worth fixing before merge. - -### - -​ - -What Code Review checks - -By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. You can expand what it checks by adding guidance files to your repository. + * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository. + * **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>). ## ​ -Set up Code Review +Compare ways to get a review -An Owner enables Code Review once for the organization and selects which repositories to include. +To find the options open to you, check the **Who can use it** column against your plan and code host: -1 - -Open Claude Code admin settings - -Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and find the Code Review section. You need the Owner or Primary Owner role in your Claude organization and permission to install GitHub Apps in your GitHub organization. - -2 - -Start setup - -Click **Setup**. This begins the GitHub App installation flow. - -3 - -Install the Claude GitHub App - -Follow the prompts to install the Claude GitHub App: pick the GitHub organization that owns the repositories you want reviewed, choose which repositories the app can access, and approve the requested permissions.To review a pull request, Claude reads your repository contents through the app’s read access, and posts comments and the check run through its write access to pull requests and checks. During installation, you grant a broader permission set shared by other Claude features, such as [GitHub Actions](</docs/en/github-actions>); see [GitHub App permissions](</docs/en/github-actions#github-app-permissions>) for the full list. - -4 - -Select repositories - -Choose which repositories to enable for Code Review. If you don’t see a repository, make sure you gave the Claude GitHub App access to it during installation. You can add more repositories later. - -5 - -Set review triggers per repo - -After setup completes, the Code Review section shows your repositories in a table. For each repository, use the **Review Behavior** dropdown to choose when reviews run: - - * **Once after PR creation** : review runs once when a PR is opened or marked ready for review - * **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues - * **Manual** : opening or pushing to a PR doesn’t start a review; comment `@claude review` to request one, or `@claude review always` to also subscribe the PR to reviews on subsequent pushes - -Whichever option you choose, Claude reviews a pull request from a fork only when someone comments `@claude review` on it.Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. - -The repositories table also shows the average cost per review for each repo based on recent activity. Use the row actions menu to turn Code Review on or off per repository, or to remove a repository entirely. To verify setup, open a test PR. If you chose an automatic trigger, a check run named **Claude Code Review** appears within a few minutes. If you chose Manual, comment `@claude review` on the PR to start the first review. If no check run appears, confirm the repository is listed in your admin settings and the Claude GitHub App has access to it. - -## - -​ - -Manually trigger reviews - -Comment commands start a review on demand. They work regardless of the repository’s configured trigger, so you can use them to opt specific PRs into review in Manual mode or to get an immediate re-review in other modes. - -Command| What it does ----|--- -`@claude review`| Starts a single review without subscribing the PR to future pushes -`@claude review always`| Starts a review and subscribes the PR to push-triggered reviews going forward -`@claude review once`| Same as `@claude review`: starts a single review without subscribing - -Use `@claude review always` when you want every subsequent push to the PR to start a fresh review, such as on a high-priority PR in a repository set to Manual mode. Because the bare command doesn’t subscribe the PR, you can request a one-off second opinion without changing whether later pushes trigger reviews. - -Before a July 2026 update, `@claude review` subscribed the PR to push-triggered reviews. If you relied on that behavior, comment `@claude review always` instead. `@claude review once` still works and behaves the same as the bare command. - -For any of these commands to trigger a review: - - * Post it as a top-level PR comment, not an inline comment on a diff line - * Put the command at the start of the comment, with `once` or `always` on the same line as the rest of the command - * You must have write, maintain, or admin permission on the repository - * The PR must be open - -Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. - -### - -​ - -Review pull requests from forks - -Claude doesn’t review a pull request from a fork automatically, regardless of the repository’s **Review Behavior** setting. To start one, comment `@claude review` on the pull request. The requirements for comment commands still apply, and the write access you need is to the base repository, not the fork. To get another review of a fork pull request, post a new `@claude review` comment. `@claude review always` works too, but doesn’t subscribe the pull request to reviews on later pushes. Nothing other than a comment command starts a review on a fork pull request: - - * Clicking **Re-run** on the check run doesn’t start a review - * Pushing new commits doesn’t start a review, even in a repository set to **After every push** - -## - -​ - -Customize reviews - -Code Review reads two files from your repository to guide what it flags. They differ in how strongly they influence the review: - - * **`CLAUDE.md`** : shared project instructions that Claude Code uses for all tasks, not just reviews. Code Review reads it as project context and flags newly introduced violations as nits. - * **`REVIEW.md`** : review-only instructions, given to the agents that find and verify findings and consulted by the agents that rank and report them. Use it to say what your team wants flagged, at what severity, and how findings are reported. - -### - -​ - -CLAUDE.md - -Code Review reads your repository’s `CLAUDE.md` files and treats newly introduced violations as nit-level findings. This works bidirectionally: if your PR changes code in a way that makes a `CLAUDE.md` statement outdated, Claude flags that the docs need updating too. Claude reads `CLAUDE.md` files at every level of your directory hierarchy, so rules in a subdirectory’s `CLAUDE.md` apply only to files under that path. See the [memory documentation](</docs/en/memory>) for more on how `CLAUDE.md` works. For review-specific guidance that you don’t want applied to general Claude Code sessions, use `REVIEW.md` instead. - -### - -​ - -REVIEW.md - -`REVIEW.md` is a file at your repository root that tailors Code Review to your repo. The agents in the review pipeline that find and verify findings receive its contents as your repository’s review instructions, alongside Code Review’s default review guidance, and the agents that rank and report findings consult it before settling severity and writing the review. Put the rules you want enforced directly in `REVIEW.md`. - -#### - -​ - -What you can tune - -`REVIEW.md` is freeform markdown, so anything you can express as a review instruction is in scope. The patterns below have the most impact in practice. **Severity** : redefine what 🔴 Important means for your repo. The default calibration targets production code; a docs repo, a config repo, or a prototype might want a much narrower definition. State explicitly which classes of finding are Important and which are Nit at most. You can also escalate in the other direction, for example treating any `CLAUDE.md` violation as Important rather than the default nit. **Nit volume** : cap how many 🟡 Nit comments a single review posts. Prose and config files can be polished forever. A cap like “report at most five nits, mention the rest as a count in the summary” keeps reviews actionable. **Skip rules** : list paths, branch patterns, and finding categories where Claude should post no findings. Common candidates are generated code, lockfiles, vendored dependencies, and machine-authored branches, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead of skipping entirely: “in `scripts/`, only report if near-certain and severe.” **Repo-specific checks** : add rules you want flagged on every PR, like “new API routes must have an integration test.” Because `REVIEW.md` reaches every finding and verification agent directly, these land more reliably than the same rules in a long `CLAUDE.md`. **Verification bar** : require evidence before a class of finding is posted. For example, “behavior claims need a `file:line` citation in the source, not an inference from naming” cuts false positives that would otherwise cost the author a round trip. **Re-review convergence** : tell Claude how to behave when a PR has already been reviewed. A rule like “after the first review, suppress new nits and post Important findings only” stops a one-line fix from reaching round seven on style alone. **Summary shape** : ask for the review body to open with a one-line tally such as `2 factual, 4 style`, and to lead with “no factual issues” when that’s the case. The author wants to know the shape of the work before the details. - -#### - -​ - -Example - -This `REVIEW.md` recalibrates severity for a backend service, caps nits, skips generated files, and adds repo-specific checks. - - # Review instructions - - ## What Important means here - - Reserve Important for findings that would break behavior, leak data, - or block a rollback: incorrect logic, unscoped database queries, PII - in logs or error messages, and migrations that aren't backward - compatible. Style, naming, and refactoring suggestions are Nit at - most. - - ## Cap the nits - - Report at most five Nits per review. If you found more, say "plus N - similar items" in the summary instead of posting them inline. If - everything you found is a Nit, lead the summary with "No blocking - issues." - - ## Do not report - - - Anything CI already enforces: lint, formatting, type errors - - Generated files under `src/gen/` and any `*.lock` file - - Test-only code that intentionally violates production rules - - ## Always check - - - New API routes have an integration test - - Log lines don't include email addresses, user IDs, or request bodies - - Database queries are scoped to the caller's tenant - -#### - -​ - -Keep it focused - -Length has a cost: a long `REVIEW.md` dilutes the rules that matter most. Keep it to instructions that change review behavior, and leave general project context in `CLAUDE.md`. - -## - -​ - -View usage - -Go to [claude.ai/analytics/code-review](<https://claude.ai/analytics/code-review>) to see Code Review activity across your organization. The dashboard shows: - -Section| What it shows ----|--- -PRs reviewed| Daily count of pull requests reviewed over the selected time range -Code Review cost| Code Review spend so far this month -Feedback| Count of review comments that were auto-resolved because a developer addressed the issue -Repository breakdown| Per-repo counts of PRs reviewed, comments resolved, and review runs, with estimated cost and a per-PR view - -The Code Review cost card shows an amount only when the current month is selected. Cost figures in analytics can differ from your invoice. Repository breakdown costs are estimated at list price, before any discounts or credits, and cover only reviews that Claude posted on a pull request. For invoice-accurate spend, refer to your Anthropic bill. - -## - -​ - -Pricing - -Code Review is billed based on token usage. Each review averages $15-25 in cost, scaling with PR size, codebase complexity, and how many issues require verification. Code Review usage is billed separately through [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) and does not count against your plan’s included usage. The review trigger you choose affects total cost: - - * **Once after PR creation** : runs once per PR - * **After every push** : runs on each push, multiplying cost by the number of pushes - * **Manual** : no reviews on open or push, so cost accrues only from reviews someone requests - -In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. To monitor spend, use the analytics dashboard. - -## - -​ - -Troubleshooting - -Review runs are best-effort, and a failed run never blocks your PR. Code Review retries some interrupted reviews on its own. This section covers how to run a review again yourself and where to look when the check run reports issues you can’t find. - -### - -​ - -Retrigger a failed or timed-out review - -When a review fails or exceeds its time limit, the check run completes with a title such as **Code review failed** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge. Unless the check run’s summary says a new review of the commit has been queued automatically, run the review again yourself. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR isn’t from a fork, you can instead click **Re-run** on the **Claude Code Review** check in GitHub’s Checks tab. A re-run also starts a fresh review without subscribing the PR. - -### - -​ - -Review didn’t run and the PR shows a budget message - -When your organization’s monthly spend cap for Code Review is reached or its usage-credits balance is used up, Code Review skips the review and posts a single comment on the PR. The comment and the check-run card both name the cause and link the admin page where an admin fixes it: - - * **Spend cap reached** : reviews resume at the start of the next billing period, or immediately after an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) - * **Usage credits used up** : reviews resume once an admin adds more [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) - -### - -​ - -Find issues that aren’t showing as inline comments - -If the check run title says issues were found but you don’t see inline review comments on the diff, look in these other locations where findings are surfaced: - - * **Check run Details** : click **Details** next to the Claude Code Review check in the Checks tab. The severity table lists every finding with its file, line, and summary regardless of whether the inline comment was accepted. - * **Files changed annotations** : open the **Files changed** tab on the PR. Findings render as annotations attached directly to the diff lines, separate from review comments. - * **Review body** : if you pushed to the PR while a review was running, some findings may reference lines that no longer exist in the current diff. Those appear under an **Additional findings** heading in the review body text rather than as inline comments. - -## - -​ - -Review a diff locally - -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs. Depending on your model and effort level, the review also covers reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. - -1 - -Run /code-review - -From the session where you’re working, run the command: - - /code-review - -It reviews your branch’s commits ahead of its upstream plus any uncommitted changes, so it needs work on the branch or in the working tree to have something to report. To review something else, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`.You can also add flags: - - * `--fix`: applies the findings to your working tree after the review - * `--comment`: posts the findings on a GitHub pull request as inline comments, or on a GitLab merge request as a single note - * `--post`: on an `ultra` cloud review of a `github.com` pull request, preselects posting the finished findings to the PR in the launch dialog; see [Post findings to the pull request](</docs/en/ultrareview#post-findings-to-the-pull-request>). Requires Claude Code v2.1.227 or later - * `--max-findings <n>`, `--max-findings all`, or `--max-findings default`: reports up to `n` findings, or every finding with `all`, in place of the review’s usual limit. Later reviews reuse the value you typed until you pass `--max-findings default`. Requires Claude Code v2.1.288 or later - -When you pass `--comment` for a GitLab merge request, Claude Code posts the findings through GitLab’s `glab` CLI. Requires Claude Code v2.1.257 or later. When `glab` isn’t installed, Claude prints the findings in the terminal instead.Pass the merge request as its URL or a `!123` reference. Claude Code treats a bare number or branch name as a merge request only when the checkout’s origin is on `gitlab.com`. On a self-managed GitLab instance, pass the URL or `!123` form. - -2 - -Keep working - -The review runs as a background [subagent](</docs/en/sub-agents>) with its own context window, so it doesn’t fill your conversation. The findings arrive in your conversation when the review completes. - -3 - -Act on the findings - -Ask Claude to fix what the review found. If you passed `--fix` or `--comment`, the review has already applied or posted its findings. - -Claude reports the findings as text in the reply in both of these runs, even when a host application requests a findings list: - - * In a terminal session, where `/code-review` runs the review as a [forked subagent](</docs/en/skills#run-skills-in-a-subagent>) - * In a `-p` run with text or JSON output - -In a host application that requests the findings list, such as the [desktop app](</docs/en/desktop#review-your-code>), Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead. Claude Code renders the report as a findings list, and each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the updated findings list as fixed, skipped, or no change needed. - -### - -​ - -What the review reads and edits - -The review follows your `CLAUDE.md` like any Claude Code session, but it doesn’t read `REVIEW.md`. A background review applies its `--fix` edits outside your session’s [checkpoints](</docs/en/checkpointing#subagent-edits-not-restored>), so `/rewind` doesn’t undo them; use git to revert them. When the review runs in the foreground, it edits your working tree during your own turn, so `/rewind` restores its edits as usual. - -### - -​ - -Tune effort and arguments - -Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low`, the review reports the findings it’s most confident in, so you see fewer false positives. From `medium` through `max`, the review broadens coverage. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: - - * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. - * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note. - -### - -​ - -Run in the foreground - -The review runs in the background by default; before v2.1.218, it ran inside your conversation. It runs in the foreground instead in cases like these: - - * You run `/code-review` again while an earlier review is still in progress - * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which [doesn’t wait for the cloud review](</docs/en/ultrareview#run-ultrareview-non-interactively>) - * You set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) to `1`, which also turns off every other background task feature - -### - -​ - -Let Claude start the review - -Claude can start `/code-review` on its own. Ask it to review your changes in plain language and it can run the skill without you typing the command, and a [scheduled task](</docs/en/scheduled-tasks>) with `/code-review` as its prompt runs the review. A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#where-settings-live>) such as `~/.claude/settings.json`: - - { - "skillOverrides": { - "code-review": "user-invocable-only" - } - } - -Before v2.1.246, Claude started `/code-review` on its own only where a feature flag fetched from Anthropic turned it on. In [sessions that don’t fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), `/code-review` ran only when you typed it, and a scheduled `/code-review` reached Claude as plain text. - -### - -​ - -Escalate to ultrareview - -`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus uncommitted and staged changes in the working tree. For uncommitted changes to files named like credentials or keys, such as `.env` and `*.tfvars` files, Claude Code follows the rules for [uploading a local repository to a cloud session](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>). Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. When the target is a `github.com` pull request, you can have Claude [post the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) as a comment from your GitHub account. Requires Claude Code v2.1.227 or later. - -Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled or with the [HIPAA configuration](</docs/en/hipaa-setup>) applied. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. - -To run a cloud review from a script or CI job, use the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>), which waits for the findings and prints them to stdout. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`. +Option| What starts a review| Where it runs| Who can use it +---|---|---|--- +Code Review| Pull request activity, as each repository is set, or an `@claude review` comment| Anthropic infrastructure| Organizations on a Team or Enterprise plan with GitHub repositories, once an Owner turns it on +[`/code-review`](</docs/en/code-review-local>)| You run the command on your branch| Your Claude Code session| Anyone, on any plan +[Ultrareview](</docs/en/ultrareview>)| You start it from Claude Code| A cloud sandbox| Requires signing in with a claude.ai account. See [Ultrareview](</docs/en/ultrareview>) for where it isn’t available +Claude in your own CI, with [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>)| Your pipeline’s events, such as every pull request or merge request| Your own CI runners| Anyone with a Claude API key or cloud provider credentials, on GitHub or GitLab +Your own reviewer, as a [subagent](</docs/en/sub-agents>) or [skill](</docs/en/skills>)| You or Claude invoke it during a session| Wherever you run Claude Code| Anyone who writes one ## @@ -413,9 +124,6 @@ Related resources - * [Commands](</docs/en/commands>): run `/code-review` in a local Claude Code session to check a diff before pushing - * [GitHub Actions](</docs/en/github-actions>): run Claude in your own GitHub Actions workflows for custom automation beyond code review - * [GitLab CI/CD](</docs/en/gitlab-ci-cd>): self-hosted Claude integration for GitLab pipelines - * [Memory](</docs/en/memory>): how `CLAUDE.md` files work across Claude Code - * [Analytics](</docs/en/analytics>): track Claude Code usage beyond code review + * [GitHub Enterprise Server](</docs/en/github-enterprise-server>): use Code Review with a self-hosted GitHub instance + * [GitHub App permissions](</docs/en/github-actions#github-app-permissions>): the full permission set the Claude GitHub App requests * [How Anthropic secures its AI-native software development lifecycle](<https://claude.com/blog/how-anthropic-secures-its-ai-native-software-development-lifecycle>): how automated review fits as one layer of Anthropic’s secure development process
modified
--- a/code-review.md +++ b/code-review.md @@ -141,7 +141,7 @@ * You must have write, maintain, or admin permission on the repository * The PR must be open -If the repository belongs to an organization and your membership in that organization is private, which is GitHub’s default, GitHub doesn’t identify you to Claude as a member. Claude may still react to your comment with 👀, but it doesn’t start a review unless you were added to the repository directly as a collaborator, even when a team or the organization’s base permissions give you write access. To fix this, [make your organization membership public](<https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership>) or ask a repository admin to add you to the repository as a collaborator. Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. +Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -245,11 +245,11 @@ Section| What it shows ---|--- PRs reviewed| Daily count of pull requests reviewed over the selected time range -Cost weekly| Weekly spend on Code Review +Code Review cost| Code Review spend so far this month Feedback| Count of review comments that were auto-resolved because a developer addressed the issue -Repository breakdown| Per-repo counts of PRs reviewed and comments resolved - -Dashboard cost figures are estimates for monitoring activity. For invoice-accurate spend, refer to your Anthropic bill. +Repository breakdown| Per-repo counts of PRs reviewed, comments resolved, and review runs, with estimated cost and a per-PR view + +The Code Review cost card shows an amount only when the current month is selected. Cost figures in analytics can differ from your invoice. Repository breakdown costs are estimated at list price, before any discounts or credits, and cover only reviews that Claude posted on a pull request. For invoice-accurate spend, refer to your Anthropic bill. ## @@ -263,7 +263,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews on open or push, so cost accrues only from reviews someone requests -In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. To monitor spend, use the analytics dashboard. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -362,7 +362,7 @@ Tune effort and arguments -Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` broaden coverage and may include findings the review is less sure about. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: +Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low`, the review reports the findings it’s most confident in, so you see fewer false positives. From `medium` through `max`, the review broadens coverage. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note.
modified
--- a/code-review.md +++ b/code-review.md @@ -346,7 +346,7 @@ * In a terminal session, where `/code-review` runs the review as a [forked subagent](</docs/en/skills#run-skills-in-a-subagent>) * In a `-p` run with text or JSON output -In a host application that requests the findings list, such as the [desktop app](</docs/en/desktop>), Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead. Claude Code renders the report as a findings list, and each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the updated findings list as fixed, skipped, or no change needed. +In a host application that requests the findings list, such as the [desktop app](</docs/en/desktop#review-your-code>), Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead. Claude Code renders the report as a findings list, and each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the updated findings list as fixed, skipped, or no change needed. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -1,4 +1,4 @@ -Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. On other plans, you can still review a diff locally with the `/code-review` command. +Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled or with the [HIPAA configuration](</docs/en/hipaa-setup>) applied, and is not covered under Anthropic’s BAA. On other plans, you can still review a diff locally with the `/code-review` command. Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers: @@ -403,7 +403,7 @@ `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus uncommitted and staged changes in the working tree. For uncommitted changes to files named like credentials or keys, such as `.env` and `*.tfvars` files, Claude Code follows the rules for [uploading a local repository to a cloud session](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>). Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. When the target is a `github.com` pull request, you can have Claude [post the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) as a comment from your GitHub account. Requires Claude Code v2.1.227 or later. -Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. +Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled or with the [HIPAA configuration](</docs/en/hipaa-setup>) applied. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. To run a cloud review from a script or CI job, use the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>), which waits for the findings and prints them to stdout. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`.
modified
--- a/code-review.md +++ b/code-review.md @@ -285,9 +285,12 @@ ​ -Review didn’t run and the PR shows a spend-cap message - -When your organization’s monthly spend cap is reached, Code Review posts a single comment on the PR explaining that the review was skipped. Reviews resume automatically at the start of the next billing period, or immediately when an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). +Review didn’t run and the PR shows a budget message + +When your organization’s monthly spend cap for Code Review is reached or its usage-credits balance is used up, Code Review skips the review and posts a single comment on the PR. The comment and the check-run card both name the cause and link the admin page where an admin fixes it: + + * **Spend cap reached** : reviews resume at the start of the next billing period, or immediately after an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) + * **Usage credits used up** : reviews resume once an admin adds more [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) ### @@ -307,7 +310,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs and reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs. Depending on your model and effort level, the review also covers reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. 1
modified
--- a/code-review.md +++ b/code-review.md @@ -322,6 +322,7 @@ * `--fix`: applies the findings to your working tree after the review * `--comment`: posts the findings on a GitHub pull request as inline comments, or on a GitLab merge request as a single note * `--post`: on an `ultra` cloud review of a `github.com` pull request, preselects posting the finished findings to the PR in the launch dialog; see [Post findings to the pull request](</docs/en/ultrareview#post-findings-to-the-pull-request>). Requires Claude Code v2.1.227 or later + * `--max-findings <n>`, `--max-findings all`, or `--max-findings default`: reports up to `n` findings, or every finding with `all`, in place of the review’s usual limit. Later reviews reuse the value you typed until you pass `--max-findings default`. Requires Claude Code v2.1.288 or later When you pass `--comment` for a GitLab merge request, Claude Code posts the findings through GitLab’s `glab` CLI. Requires Claude Code v2.1.257 or later. When `glab` isn’t installed, Claude prints the findings in the terminal instead.Pass the merge request as its URL or a `!123` reference. Claude Code treats a bare number or branch name as a merge request only when the checkout’s origin is on `gitlab.com`. On a self-managed GitLab instance, pass the URL or `!123` form.
modified
--- a/code-review.md +++ b/code-review.md @@ -372,7 +372,7 @@ The review runs in the background by default; before v2.1.218, it ran inside your conversation. It runs in the foreground instead in cases like these: * You run `/code-review` again while an earlier review is still in progress - * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which launches the cloud review without waiting + * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which [doesn’t wait for the cloud review](</docs/en/ultrareview#run-ultrareview-non-interactively>) * You set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) to `1`, which also turns off every other background task feature ### @@ -401,7 +401,7 @@ Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. -To start a cloud review from a script or CI, run `claude -p '/code-review ultra'`. Claude Code launches the review and prints a link for tracking it. Requires Claude Code v2.1.218 or later. When the review would bill [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), Claude Code stops before launching, because the billing confirmation needs an interactive session. Run the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>) instead; by running it, you consent to the charge. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`. +To run a cloud review from a script or CI job, use the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>), which waits for the findings and prints them to stdout. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -32,7 +32,7 @@ 🟡| Nit| A minor issue, worth fixing but not blocking 🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR -Findings include a collapsible extended reasoning section you can expand to understand why Claude flagged the issue and how it verified the problem. +Findings include a collapsed **Why this was flagged** section that you can expand to read why Claude flagged the issue and how it verified the problem. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -271,7 +271,7 @@ Troubleshooting -Review runs are best-effort. A failed run never blocks your PR, but it also doesn’t retry on its own. This section covers how to recover from a failed run and where to look when the check run reports issues you can’t find. +Review runs are best-effort, and a failed run never blocks your PR. Code Review retries some interrupted reviews on its own. This section covers how to run a review again yourself and where to look when the check run reports issues you can’t find. ### @@ -279,7 +279,7 @@ Retrigger a failed or timed-out review -When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR isn’t from a fork, you can instead click **Re-run** on the **Claude Code Review** check in GitHub’s Checks tab. A re-run also starts a fresh review without subscribing the PR. +When a review fails or exceeds its time limit, the check run completes with a title such as **Code review failed** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge. Unless the check run’s summary says a new review of the commit has been queued automatically, run the review again yourself. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR isn’t from a fork, you can instead click **Re-run** on the **Claude Code Review** check in GitHub’s Checks tab. A re-run also starts a fresh review without subscribing the PR. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -40,7 +40,7 @@ Rate and reply to findings -Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review` as a top-level PR comment. +Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review` as a top-level PR comment. To dismiss a finding without a code change, resolve its thread; replying doesn’t dismiss it. ### @@ -179,7 +179,7 @@ REVIEW.md -`REVIEW.md` is a file at your repository root that tailors Code Review to your repo. The agents in the review pipeline that find and verify findings receive its contents as your repository’s review instructions, alongside Code Review’s default review guidance, and the agents that rank and report findings consult it before settling severity and writing the review. The agents read the file’s text as-is, so `REVIEW.md` is plain instructions: [`@` import syntax](</docs/en/memory#import-additional-files>) is not expanded, and referenced files are not read along with it. Put the rules you want enforced directly in the file. +`REVIEW.md` is a file at your repository root that tailors Code Review to your repo. The agents in the review pipeline that find and verify findings receive its contents as your repository’s review instructions, alongside Code Review’s default review guidance, and the agents that rank and report findings consult it before settling severity and writing the review. Put the rules you want enforced directly in `REVIEW.md`. #### @@ -337,7 +337,7 @@ Ask Claude to fix what the review found. If you passed `--fix` or `--comment`, the review has already applied or posted its findings. -Claude reports the findings as text in the reply in both of these runs, even when a host application requests the findings list described below: +Claude reports the findings as text in the reply in both of these runs, even when a host application requests a findings list: * In a terminal session, where `/code-review` runs the review as a [forked subagent](</docs/en/skills#run-skills-in-a-subagent>) * In a `-p` run with text or JSON output
modified
--- a/code-review.md +++ b/code-review.md @@ -320,8 +320,10 @@ It reviews your branch’s commits ahead of its upstream plus any uncommitted changes, so it needs work on the branch or in the working tree to have something to report. To review something else, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`.You can also add flags: * `--fix`: applies the findings to your working tree after the review - * `--comment`: posts the findings as inline PR comments + * `--comment`: posts the findings on a GitHub pull request as inline comments, or on a GitLab merge request as a single note * `--post`: on an `ultra` cloud review of a `github.com` pull request, preselects posting the finished findings to the PR in the launch dialog; see [Post findings to the pull request](</docs/en/ultrareview#post-findings-to-the-pull-request>). Requires Claude Code v2.1.227 or later + +When you pass `--comment` for a GitLab merge request, Claude Code posts the findings through GitLab’s `glab` CLI. Requires Claude Code v2.1.257 or later. When `glab` isn’t installed, Claude prints the findings in the terminal instead.Pass the merge request as its URL or a `!123` reference. Claude Code treats a bare number or branch name as a merge request only when the checkout’s origin is on `gitlab.com`. On a self-managed GitLab instance, pass the URL or `!123` form. 2
modified
--- a/code-review.md +++ b/code-review.md @@ -395,7 +395,7 @@ Escalate to ultrareview -`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. When the target is a `github.com` pull request, you can have Claude [post the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) as a comment from your GitHub account. Requires Claude Code v2.1.227 or later. +`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus uncommitted and staged changes in the working tree. For uncommitted changes to files named like credentials or keys, such as `.env` and `*.tfvars` files, Claude Code follows the rules for [uploading a local repository to a cloud session](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>). Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. When the target is a `github.com` pull request, you can have Claude [post the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) as a comment from your GitHub account. Requires Claude Code v2.1.227 or later. Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead.
modified
--- a/code-review.md +++ b/code-review.md @@ -399,7 +399,7 @@ Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. -To start a cloud review from a script or CI, run `claude -p '/code-review ultra'`. Claude Code launches the review and prints a link for tracking it. Requires Claude Code v2.1.218 or later. When the review would bill [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), Claude Code stops before launching, because the billing confirmation needs an interactive session. Run the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>) instead; by running it, you consent to the charge. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. +To start a cloud review from a script or CI, run `claude -p '/code-review ultra'`. Claude Code launches the review and prints a link for tracking it. Requires Claude Code v2.1.218 or later. When the review would bill [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), Claude Code stops before launching, because the billing confirmation needs an interactive session. Run the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>) instead; by running it, you consent to the charge. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -110,9 +110,9 @@ * **Once after PR creation** : review runs once when a PR is opened or marked ready for review * **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues - * **Manual** : reviews start only when someone comments `@claude review` on a PR; `@claude review always` starts a review and subscribes the PR to reviews on subsequent pushes - -Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. + * **Manual** : opening or pushing to a PR doesn’t start a review; comment `@claude review` to request one, or `@claude review always` to also subscribe the PR to reviews on subsequent pushes + +Whichever option you choose, Claude reviews a pull request from a fork only when someone comments `@claude review` on it.Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. The repositories table also shows the average cost per review for each repo based on recent activity. Use the row actions menu to turn Code Review on or off per repository, or to remove a repository entirely. To verify setup, open a test PR. If you chose an automatic trigger, a check run named **Claude Code Review** appears within a few minutes. If you chose Manual, comment `@claude review` on the PR to start the first review. If no check run appears, confirm the repository is listed in your admin settings and the Claude GitHub App has access to it. @@ -138,10 +138,21 @@ * Post it as a top-level PR comment, not an inline comment on a diff line * Put the command at the start of the comment, with `once` or `always` on the same line as the rest of the command - * You must have owner, member, or collaborator access to the repository + * You must have write, maintain, or admin permission on the repository * The PR must be open -Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. +If the repository belongs to an organization and your membership in that organization is private, which is GitHub’s default, GitHub doesn’t identify you to Claude as a member. Claude may still react to your comment with 👀, but it doesn’t start a review unless you were added to the repository directly as a collaborator, even when a team or the organization’s base permissions give you write access. To fix this, [make your organization membership public](<https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership>) or ask a repository admin to add you to the repository as a collaborator. Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. + +### + +​ + +Review pull requests from forks + +Claude doesn’t review a pull request from a fork automatically, regardless of the repository’s **Review Behavior** setting. To start one, comment `@claude review` on the pull request. The requirements for comment commands still apply, and the write access you need is to the base repository, not the fork. To get another review of a fork pull request, post a new `@claude review` comment. `@claude review always` works too, but doesn’t subscribe the pull request to reviews on later pushes. Nothing other than a comment command starts a review on a fork pull request: + + * Clicking **Re-run** on the check run doesn’t start a review + * Pushing new commits doesn’t start a review, even in a repository set to **After every push** ## @@ -250,9 +261,9 @@ * **Once after PR creation** : runs once per PR * **After every push** : runs on each push, multiplying cost by the number of pushes - * **Manual** : no reviews until someone comments `@claude review` on a PR - -In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. + * **Manual** : no reviews on open or push, so cost accrues only from reviews someone requests + +In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ## @@ -268,7 +279,7 @@ Retrigger a failed or timed-out review -When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR is already subscribed to push-triggered reviews, pushing a new commit also starts a new review. The **Re-run** button in GitHub’s Checks tab does not retrigger Code Review. Use the comment command or a new push instead. +When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR isn’t from a fork, you can instead click **Re-run** on the **Claude Code Review** check in GitHub’s Checks tab. A re-run also starts a fresh review without subscribing the PR. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -368,13 +368,7 @@ Let Claude start the review -Claude can start `/code-review` on its own. Ask it to review your changes in plain language and it can run the skill without you typing the command, and a [scheduled task](</docs/en/scheduled-tasks>) with `/code-review` as its prompt runs the review. Exceptions include the following sessions, where `/code-review` runs only when you type it yourself and a scheduled `/code-review` reaches Claude as plain text instead of running the review: - - * **Cloud providers** : sessions on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry, unless a host platform that embeds Claude Code sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) - * **Claude apps gateway** : sessions that connect through the [Claude apps gateway](</docs/en/claude-apps-gateway>) - * **Privacy environment variables** : sessions that opt out of telemetry or feature-flag fetching with [`DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK`](</docs/en/env-vars#variables>) - -A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#where-settings-live>) such as `~/.claude/settings.json`: +Claude can start `/code-review` on its own. Ask it to review your changes in plain language and it can run the skill without you typing the command, and a [scheduled task](</docs/en/scheduled-tasks>) with `/code-review` as its prompt runs the review. A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#where-settings-live>) such as `~/.claude/settings.json`: { "skillOverrides": { @@ -382,7 +376,7 @@ } } -From v2.1.215 through v2.1.222, Claude never started `/code-review` on its own in any configuration. +Before v2.1.246, Claude started `/code-review` on its own only where a feature flag fetched from Anthropic turned it on. In [sessions that don’t fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), `/code-review` ran only when you typed it, and a scheduled `/code-review` reached Claude as plain text. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -374,7 +374,7 @@ * **Claude apps gateway** : sessions that connect through the [Claude apps gateway](</docs/en/claude-apps-gateway>) * **Privacy environment variables** : sessions that opt out of telemetry or feature-flag fetching with [`DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK`](</docs/en/env-vars#variables>) -A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#settings-files>) such as `~/.claude/settings.json`: +A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#where-settings-live>) such as `~/.claude/settings.json`: { "skillOverrides": {
modified
--- a/code-review.md +++ b/code-review.md @@ -152,7 +152,7 @@ Code Review reads two files from your repository to guide what it flags. They differ in how strongly they influence the review: * **`CLAUDE.md`** : shared project instructions that Claude Code uses for all tasks, not just reviews. Code Review reads it as project context and flags newly introduced violations as nits. - * **`REVIEW.md`** : review-only instructions, injected directly into every agent in the review pipeline as highest priority. Use it to change what gets flagged, at what severity, and how findings are reported. + * **`REVIEW.md`** : review-only instructions, given to the agents that find and verify findings and consulted by the agents that rank and report them. Use it to say what your team wants flagged, at what severity, and how findings are reported. ### @@ -168,7 +168,7 @@ REVIEW.md -`REVIEW.md` is a file at your repository root that overrides how Code Review behaves on your repo. Its contents are injected into the system prompt of every agent in the review pipeline as the highest-priority instruction block, taking precedence over the default review guidance. Because it’s pasted verbatim, `REVIEW.md` is plain instructions: [`@` import syntax](</docs/en/memory#import-additional-files>) is not expanded, and referenced files are not read into the prompt. Put the rules you want enforced directly in the file. +`REVIEW.md` is a file at your repository root that tailors Code Review to your repo. The agents in the review pipeline that find and verify findings receive its contents as your repository’s review instructions, alongside Code Review’s default review guidance, and the agents that rank and report findings consult it before settling severity and writing the review. The agents read the file’s text as-is, so `REVIEW.md` is plain instructions: [`@` import syntax](</docs/en/memory#import-additional-files>) is not expanded, and referenced files are not read along with it. Put the rules you want enforced directly in the file. #### @@ -176,7 +176,7 @@ What you can tune -`REVIEW.md` is freeform markdown, so anything you can express as a review instruction is in scope. The patterns below have the most impact in practice. **Severity** : redefine what 🔴 Important means for your repo. The default calibration targets production code; a docs repo, a config repo, or a prototype might want a much narrower definition. State explicitly which classes of finding are Important and which are Nit at most. You can also escalate in the other direction, for example treating any `CLAUDE.md` violation as Important rather than the default nit. **Nit volume** : cap how many 🟡 Nit comments a single review posts. Prose and config files can be polished forever. A cap like “report at most five nits, mention the rest as a count in the summary” keeps reviews actionable. **Skip rules** : list paths, branch patterns, and finding categories where Claude should post no findings. Common candidates are generated code, lockfiles, vendored dependencies, and machine-authored branches, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead of skipping entirely: “in `scripts/`, only report if near-certain and severe.” **Repo-specific checks** : add rules you want flagged on every PR, like “new API routes must have an integration test.” Because `REVIEW.md` is injected as highest priority, these land more reliably than the same rules in a long `CLAUDE.md`. **Verification bar** : require evidence before a class of finding is posted. For example, “behavior claims need a `file:line` citation in the source, not an inference from naming” cuts false positives that would otherwise cost the author a round trip. **Re-review convergence** : tell Claude how to behave when a PR has already been reviewed. A rule like “after the first review, suppress new nits and post Important findings only” stops a one-line fix from reaching round seven on style alone. **Summary shape** : ask for the review body to open with a one-line tally such as `2 factual, 4 style`, and to lead with “no factual issues” when that’s the case. The author wants to know the shape of the work before the details. +`REVIEW.md` is freeform markdown, so anything you can express as a review instruction is in scope. The patterns below have the most impact in practice. **Severity** : redefine what 🔴 Important means for your repo. The default calibration targets production code; a docs repo, a config repo, or a prototype might want a much narrower definition. State explicitly which classes of finding are Important and which are Nit at most. You can also escalate in the other direction, for example treating any `CLAUDE.md` violation as Important rather than the default nit. **Nit volume** : cap how many 🟡 Nit comments a single review posts. Prose and config files can be polished forever. A cap like “report at most five nits, mention the rest as a count in the summary” keeps reviews actionable. **Skip rules** : list paths, branch patterns, and finding categories where Claude should post no findings. Common candidates are generated code, lockfiles, vendored dependencies, and machine-authored branches, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead of skipping entirely: “in `scripts/`, only report if near-certain and severe.” **Repo-specific checks** : add rules you want flagged on every PR, like “new API routes must have an integration test.” Because `REVIEW.md` reaches every finding and verification agent directly, these land more reliably than the same rules in a long `CLAUDE.md`. **Verification bar** : require evidence before a class of finding is posted. For example, “behavior claims need a `file:line` citation in the source, not an inference from naming” cuts false positives that would otherwise cost the author a round trip. **Re-review convergence** : tell Claude how to behave when a PR has already been reviewed. A rule like “after the first review, suppress new nits and post Important findings only” stops a one-line fix from reaching round seven on style alone. **Summary shape** : ask for the review body to open with a one-line tally such as `2 factual, 4 style`, and to lead with “no factual issues” when that’s the case. The author wants to know the shape of the work before the details. #### @@ -407,3 +407,4 @@ * [GitLab CI/CD](</docs/en/gitlab-ci-cd>): self-hosted Claude integration for GitLab pipelines * [Memory](</docs/en/memory>): how `CLAUDE.md` files work across Claude Code * [Analytics](</docs/en/analytics>): track Claude Code usage beyond code review + * [How Anthropic secures its AI-native software development lifecycle](<https://claude.com/blog/how-anthropic-secures-its-ai-native-software-development-lifecycle>): how automated review fits as one layer of Anthropic’s secure development process
modified
--- a/code-review.md +++ b/code-review.md @@ -10,8 +10,6 @@ * Troubleshooting failed runs and missing comments * Reviewing a diff locally with the `/code-review` command -To review a diff locally in your terminal without installing the GitHub App, run the `/code-review` command in any Claude Code session. See Review a diff locally. - ## ​ @@ -240,7 +238,7 @@ Feedback| Count of review comments that were auto-resolved because a developer addressed the issue Repository breakdown| Per-repo counts of PRs reviewed and comments resolved -The repositories table in admin settings also shows average cost per review for each repo. Dashboard cost figures are estimates for monitoring activity; for invoice-accurate spend, refer to your Anthropic bill. +Dashboard cost figures are estimates for monitoring activity. For invoice-accurate spend, refer to your Anthropic bill. ## @@ -312,6 +310,7 @@ * `--fix`: applies the findings to your working tree after the review * `--comment`: posts the findings as inline PR comments + * `--post`: on an `ultra` cloud review of a `github.com` pull request, preselects posting the finished findings to the PR in the launch dialog; see [Post findings to the pull request](</docs/en/ultrareview#post-findings-to-the-pull-request>). Requires Claude Code v2.1.227 or later 2 @@ -363,7 +362,27 @@ * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which launches the cloud review without waiting * You set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) to `1`, which also turns off every other background task feature -You can’t schedule the review: `/code-review` is marked [`disable-model-invocation`](</docs/en/skills#frontmatter-reference>), so if you set it as a [scheduled task](</docs/en/scheduled-tasks>)’s prompt, Claude reads it as plain text instead of running the review. +### + +​ + +Let Claude start the review + +Claude can start `/code-review` on its own. Ask it to review your changes in plain language and it can run the skill without you typing the command, and a [scheduled task](</docs/en/scheduled-tasks>) with `/code-review` as its prompt runs the review. Exceptions include the following sessions, where `/code-review` runs only when you type it yourself and a scheduled `/code-review` reaches Claude as plain text instead of running the review: + + * **Cloud providers** : sessions on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry, unless a host platform that embeds Claude Code sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) + * **Claude apps gateway** : sessions that connect through the [Claude apps gateway](</docs/en/claude-apps-gateway>) + * **Privacy environment variables** : sessions that opt out of telemetry or feature-flag fetching with [`DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK`](</docs/en/env-vars#variables>) + +A scheduled task never launches the cloud review, so schedule `/code-review` without the `ultra` argument. To stop both Claude and scheduled tasks from starting the review while keeping `/code-review` available for you to type, add a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to a [settings file](</docs/en/settings#settings-files>) such as `~/.claude/settings.json`: + + { + "skillOverrides": { + "code-review": "user-invocable-only" + } + } + +From v2.1.215 through v2.1.222, Claude never started `/code-review` on its own in any configuration. ### @@ -371,7 +390,7 @@ Escalate to ultrareview -`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. +`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. When the target is a `github.com` pull request, you can have Claude [post the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) as a comment from your GitHub account. Requires Claude Code v2.1.227 or later. Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. @@ -382,8 +401,6 @@ ​ Related resources - -Code Review is designed to work alongside the rest of Claude Code. If you want to run reviews locally before opening a PR, need a self-hosted setup, or want to go deeper on how `CLAUDE.md` shapes Claude’s behavior across tools, these pages are good next stops: * [Commands](</docs/en/commands>): run `/code-review` in a local Claude Code session to check a diff before pushing * [GitHub Actions](</docs/en/github-actions>): run Claude in your own GitHub Actions workflows for custom automation beyond code review
modified
--- a/code-review.md +++ b/code-review.md @@ -346,7 +346,7 @@ Tune effort and arguments -Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` broaden coverage and may include findings the review is less sure about. When you don’t type a level, the review reuses the last one you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: +Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` broaden coverage and may include findings the review is less sure about. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note.
modified
--- a/code-review.md +++ b/code-review.md @@ -298,7 +298,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs and reuse, simplification, and efficiency cleanups. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs and reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. 1 @@ -346,7 +346,7 @@ Tune effort and arguments -Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` cast a wider net and may include findings the review is less sure about. Without an effort argument, the review uses the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: +Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` broaden coverage and may include findings the review is less sure about. When you don’t type a level, the review reuses the last one you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note.
modified
--- a/code-review.md +++ b/code-review.md @@ -96,13 +96,7 @@ Install the Claude GitHub App -Follow the prompts to install the Claude GitHub App to your GitHub organization. The app requests these repository permissions: - - * **Contents** : read and write - * **Issues** : read and write - * **Pull requests** : read and write - -Code Review uses read access to contents and write access to pull requests. The broader permission set also supports [GitHub Actions](</docs/en/github-actions>) if you enable that later. +Follow the prompts to install the Claude GitHub App: pick the GitHub organization that owns the repositories you want reviewed, choose which repositories the app can access, and approve the requested permissions.To review a pull request, Claude reads your repository contents through the app’s read access, and posts comments and the check run through its write access to pull requests and checks. During installation, you grant a broader permission set shared by other Claude features, such as [GitHub Actions](</docs/en/github-actions>); see [GitHub App permissions](</docs/en/github-actions#github-app-permissions>) for the full list. 4
modified
--- a/code-review.md +++ b/code-review.md @@ -331,7 +331,12 @@ Ask Claude to fix what the review found. If you passed `--fix` or `--comment`, the review has already applied or posted its findings. -When the host application requests it, Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead of as text in its reply. Claude Code renders the report as a findings list, one entry per finding. Each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. In a terminal session, `/code-review` runs the review as a fork and reports the findings as text in the reply, and Claude reports as text in any `-p` run with text or JSON output, even when the host application requests the findings list. On v2.1.216 and v2.1.217, a terminal review at `medium` or higher effort reported the findings list instead. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the new list as fixed, skipped, or no change needed. +Claude reports the findings as text in the reply in both of these runs, even when a host application requests the findings list described below: + + * In a terminal session, where `/code-review` runs the review as a [forked subagent](</docs/en/skills#run-skills-in-a-subagent>) + * In a `-p` run with text or JSON output + +In a host application that requests the findings list, such as the [desktop app](</docs/en/desktop>), Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead. Claude Code renders the report as a findings list, and each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the updated findings list as fixed, skipped, or no change needed. ###
modified
--- a/code-review.md +++ b/code-review.md @@ -331,6 +331,8 @@ Ask Claude to fix what the review found. If you passed `--fix` or `--comment`, the review has already applied or posted its findings. +When the host application requests it, Claude reports the review’s findings through the [`ReportFindings` tool](</docs/en/tools-reference>) instead of as text in its reply. Claude Code renders the report as a findings list, one entry per finding. Each entry shows the file location, a one-sentence summary, and a category tag such as `correctness` when the finding carries one. A host request applies at every effort level and requires Claude Code v2.1.218 or later. In a terminal session, `/code-review` runs the review as a fork and reports the findings as text in the reply, and Claude reports as text in any `-p` run with text or JSON output, even when the host application requests the findings list. On v2.1.216 and v2.1.217, a terminal review at `medium` or higher effort reported the findings list instead. When Claude fixes reported findings later in the session, it reports them again, and Claude Code marks each finding in the new list as fixed, skipped, or no change needed. + ### ​
modified
--- a/code-review.md +++ b/code-review.md @@ -356,7 +356,7 @@ Run in the foreground -The review runs in the background by default; before v2.1.218, it ran inside your conversation. Three cases run it in the foreground instead: +The review runs in the background by default; before v2.1.218, it ran inside your conversation. It runs in the foreground instead in cases like these: * You run `/code-review` again while an earlier review is still in progress * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which launches the cloud review without waiting
modified
--- a/code-review.md +++ b/code-review.md @@ -304,7 +304,77 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups. By default the local review covers your branch’s commits ahead of its upstream plus any uncommitted changes in the working tree. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. The local command follows your `CLAUDE.md` like any Claude Code session, but it doesn’t read `REVIEW.md`. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. To review something other than the default diff, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`. The ref range form reviews the committed diff a pull request from `my-feature` into `main` would contain, regardless of how the branch’s upstream is configured. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs and reuse, simplification, and efficiency cleanups. + +1 + +Run /code-review + +From the session where you’re working, run the command: + + /code-review + +It reviews your branch’s commits ahead of its upstream plus any uncommitted changes, so it needs work on the branch or in the working tree to have something to report. To review something else, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`.You can also add flags: + + * `--fix`: applies the findings to your working tree after the review + * `--comment`: posts the findings as inline PR comments + +2 + +Keep working + +The review runs as a background [subagent](</docs/en/sub-agents>) with its own context window, so it doesn’t fill your conversation. The findings arrive in your conversation when the review completes. + +3 + +Act on the findings + +Ask Claude to fix what the review found. If you passed `--fix` or `--comment`, the review has already applied or posted its findings. + +### + +​ + +What the review reads and edits + +The review follows your `CLAUDE.md` like any Claude Code session, but it doesn’t read `REVIEW.md`. A background review applies its `--fix` edits outside your session’s [checkpoints](</docs/en/checkpointing#subagent-edits-not-restored>), so `/rewind` doesn’t undo them; use git to revert them. When the review runs in the foreground, it edits your working tree during your own turn, so `/rewind` restores its edits as usual. + +### + +​ + +Tune effort and arguments + +Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` cast a wider net and may include findings the review is less sure about. Without an effort argument, the review uses the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: + + * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. + * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note. + +### + +​ + +Run in the foreground + +The review runs in the background by default; before v2.1.218, it ran inside your conversation. Three cases run it in the foreground instead: + + * You run `/code-review` again while an earlier review is still in progress + * You run it in non-interactive mode, with the `-p` flag or the Agent SDK; Claude Code waits for the review and includes the findings in the response, except for `ultra`, which launches the cloud review without waiting + * You set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) to `1`, which also turns off every other background task feature + +You can’t schedule the review: `/code-review` is marked [`disable-model-invocation`](</docs/en/skills#frontmatter-reference>), so if you set it as a [scheduled task](</docs/en/scheduled-tasks>)’s prompt, Claude reads it as plain text instead of running the review. + +### + +​ + +Escalate to ultrareview + +`/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. + +Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. + +To start a cloud review from a script or CI, run `claude -p '/code-review ultra'`. Claude Code launches the review and prints a link for tracking it. Requires Claude Code v2.1.218 or later. When the review would bill [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), Claude Code stops before launching, because the billing confirmation needs an interactive session. Run the [`claude ultrareview` subcommand](</docs/en/ultrareview#run-ultrareview-non-interactively>) instead; by running it, you consent to the charge. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. ##
modified
Show diff (107 lines)
--- a/code-review.md +++ b/code-review.md @@ -1,10 +1,10 @@ -Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. +Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. On other plans, you can still review a diff locally with the `/code-review` command. Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers: * How reviews work * Setup - * Triggering reviews manually with `@claude review` and `@claude review once` + * Triggering reviews manually with `@claude review` and `@claude review always` * Customizing reviews with `CLAUDE.md` and `REVIEW.md` * Pricing * Troubleshooting failed runs and missing comments @@ -18,7 +18,7 @@ How reviews work -Once an Owner enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Owners can monitor review activity and spend via the analytics dashboard. +Once an Owner enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts a review on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Owners can monitor review activity and spend via the analytics dashboard. ### @@ -42,7 +42,7 @@ Rate and reply to findings -Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review once` as a top-level PR comment. +Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review` as a top-level PR comment. ### @@ -57,7 +57,7 @@ 🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active 🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input -Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. Annotations and the severity table are written to the check run independently of inline review comments, so they remain available even if GitHub rejects an inline comment on a line that moved. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq: +Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. Annotations and the severity table are written to the check run independently of inline review comments, so they remain available even if GitHub rejects an inline comment on a line that moved. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq. To find the check run ID, list the commit’s check runs with `gh api repos/OWNER/REPO/commits/<commit-sha>/check-runs --jq '.check_runs[] | {id, name}'` and take the `id` of the `Claude Code Review` run. Replace `OWNER`, `REPO`, and `CHECK_RUN_ID` with your repository owner, repository name, and that ID: gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID \ --jq '.output.text | split("bughunter-severity: ")[1] | split(" -->")[0] | fromjson' @@ -118,7 +118,7 @@ * **Once after PR creation** : review runs once when a PR is opened or marked ready for review * **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues - * **Manual** : reviews start only when someone comments `@claude review` or `@claude review once` on a PR; `@claude review` also subscribes the PR to reviews on subsequent pushes + * **Manual** : reviews start only when someone comments `@claude review` on a PR; `@claude review always` starts a review and subscribes the PR to reviews on subsequent pushes Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. @@ -130,17 +130,22 @@ Manually trigger reviews -Two comment commands start a review on demand. Both work regardless of the repository’s configured trigger, so you can use them to opt specific PRs into review in Manual mode or to get an immediate re-review in other modes. +Comment commands start a review on demand. They work regardless of the repository’s configured trigger, so you can use them to opt specific PRs into review in Manual mode or to get an immediate re-review in other modes. Command| What it does ---|--- -`@claude review`| Starts a review and subscribes the PR to push-triggered reviews going forward -`@claude review once`| Starts a single review without subscribing the PR to future pushes - -Use `@claude review once` when you want feedback on the current state of a PR but don’t want every subsequent push to incur a review. This is useful for long-running PRs with frequent pushes, or when you want a one-off second opinion without changing the PR’s review behavior. For either command to trigger a review: +`@claude review`| Starts a single review without subscribing the PR to future pushes +`@claude review always`| Starts a review and subscribes the PR to push-triggered reviews going forward +`@claude review once`| Same as `@claude review`: starts a single review without subscribing + +Use `@claude review always` when you want every subsequent push to the PR to start a fresh review, such as on a high-priority PR in a repository set to Manual mode. Because the bare command doesn’t subscribe the PR, you can request a one-off second opinion without changing whether later pushes trigger reviews. + +Before a July 2026 update, `@claude review` subscribed the PR to push-triggered reviews. If you relied on that behavior, comment `@claude review always` instead. `@claude review once` still works and behaves the same as the bare command. + +For any of these commands to trigger a review: * Post it as a top-level PR comment, not an inline comment on a diff line - * Put the command at the start of the comment, with `once` on the same line if you’re using the one-shot form + * Put the command at the start of the comment, with `once` or `always` on the same line as the rest of the command * You must have owner, member, or collaborator access to the repository * The PR must be open @@ -255,7 +260,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews until someone comments `@claude review` on a PR -In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ## @@ -271,7 +276,7 @@ Retrigger a failed or timed-out review -When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review once` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR is already subscribed to push-triggered reviews, pushing a new commit also starts a new review. The **Re-run** button in GitHub’s Checks tab does not retrigger Code Review. Use the comment command or a new push instead. +When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR is already subscribed to push-triggered reviews, pushing a new commit also starts a new review. The **Re-run** button in GitHub’s Checks tab does not retrigger Code Review. Use the comment command or a new push instead. ### @@ -299,7 +304,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups. By default the local review covers your branch’s commits ahead of its upstream plus any uncommitted changes in the working tree. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. To review something other than the default diff, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`. The ref range form reviews the committed diff a pull request from `my-feature` into `main` would contain, regardless of how the branch’s upstream is configured. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups. By default the local review covers your branch’s commits ahead of its upstream plus any uncommitted changes in the working tree. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. The local command follows your `CLAUDE.md` like any Claude Code session, but it doesn’t read `REVIEW.md`. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. To review something other than the default diff, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`. The ref range form reviews the committed diff a pull request from `my-feature` into `main` would contain, regardless of how the branch’s upstream is configured. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. Pass a branch name, such as `/code-review ultra develop`, to compare against a different base. Ultrareview requires authentication with a claude.ai account and is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or to organizations with Zero Data Retention enabled. When ultrareview is not available, `/code-review ultra` runs a local review in your session instead. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -255,7 +255,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews until someone comments `@claude review` on a PR -In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -18,7 +18,7 @@ How reviews work -Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. +Once an Owner enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Owners can monitor review activity and spend via the analytics dashboard. ### @@ -78,13 +78,13 @@ Set up Code Review -An admin enables Code Review once for the organization and selects which repositories to include. +An Owner enables Code Review once for the organization and selects which repositories to include. 1 Open Claude Code admin settings -Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and find the Code Review section. You need admin access to your Claude organization and permission to install GitHub Apps in your GitHub organization. +Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and find the Code Review section. You need the Owner or Primary Owner role in your Claude organization and permission to install GitHub Apps in your GitHub organization. 2
modified
--- a/code-review.md +++ b/code-review.md @@ -299,7 +299,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups in the current diff. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. Pass a path or PR reference to review a specific target instead of the current diff. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups. By default the local review covers your branch’s commits ahead of its upstream plus any uncommitted changes in the working tree. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. To review something other than the default diff, pass a target: a file path, a PR number, a branch name, or a ref range such as `main...my-feature`. The ref range form reviews the committed diff a pull request from `my-feature` into `main` would contain, regardless of how the branch’s upstream is configured. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. Ultrareview uses its own scope: your current branch against the repository’s default branch, plus any uncommitted and staged changes in the working tree. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers:
modified
--- a/code-review.md +++ b/code-review.md @@ -305,7 +305,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups in the current diff. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. Pass a path or PR reference to review a specific target instead of the current diff. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` still works and is equivalent to `/code-review --fix`. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups in the current diff. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. Pass a path or PR reference to review a specific target instead of the current diff. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. The command was named `/simplify` before v2.1.147, when it applied fixes by default. From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. If you scripted `/simplify` for bug-finding, switch to `/code-review --fix`, which is unchanged. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -14,8 +14,9 @@ * Customizing reviews with `CLAUDE.md` and `REVIEW.md` * Pricing * Troubleshooting failed runs and missing comments - -To review a diff locally in your terminal without installing the GitHub App, run the [`/code-review` command](</docs/en/commands>) in any Claude Code session. It reports correctness bugs in the current diff at a chosen effort level and can post findings as inline PR comments with `--comment`. The command was named `/simplify` before v2.1.147. + * Reviewing a diff locally with the `/code-review` command + +To review a diff locally in your terminal without installing the GitHub App, run the `/code-review` command in any Claude Code session. See Review a diff locally. ## @@ -302,6 +303,14 @@ ​ +Review a diff locally + +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. Run it in any Claude Code session: it reports correctness bugs and reuse, simplification, and efficiency cleanups in the current diff. Pass `--comment` to post findings as inline PR comments, or `--fix` to apply the findings to your working tree after the review. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. Pass a path or PR reference to review a specific target instead of the current diff. `/code-review ultra --fix` runs the deeper [ultrareview](</docs/en/ultrareview>) in the cloud, then applies its findings to your working tree when they arrive back in your session. The command was named `/simplify` before v2.1.147, when it applied fixes by default. `/simplify` still works and is equivalent to `/code-review --fix`. + +## + +​ + Related resources Code Review is designed to work alongside the rest of Claude Code. If you want to run reviews locally before opening a PR, need a self-hosted setup, or want to go deeper on how `CLAUDE.md` shapes Claude’s behavior across tools, these pages are good next stops:
modified
--- a/code-review.md +++ b/code-review.md @@ -15,6 +15,8 @@ * Pricing * Troubleshooting failed runs and missing comments +To review a diff locally in your terminal without installing the GitHub App, run the [`/code-review` command](</docs/en/commands>) in any Claude Code session. It reports correctness bugs in the current diff at a chosen effort level and can post findings as inline PR comments with `--comment`. The command was named `/simplify` before v2.1.147. + ## ​ @@ -304,7 +306,7 @@ Code Review is designed to work alongside the rest of Claude Code. If you want to run reviews locally before opening a PR, need a self-hosted setup, or want to go deeper on how `CLAUDE.md` shapes Claude’s behavior across tools, these pages are good next stops: - * [Plugins](</docs/en/discover-plugins>): browse the plugin marketplace, including a `code-review` plugin for running on-demand reviews locally before pushing + * [Commands](</docs/en/commands>): run `/code-review` in a local Claude Code session to check a diff before pushing * [GitHub Actions](</docs/en/github-actions>): run Claude in your own GitHub Actions workflows for custom automation beyond code review * [GitLab CI/CD](</docs/en/gitlab-ci-cd>): self-hosted Claude integration for GitLab pipelines * [Memory](</docs/en/memory>): how `CLAUDE.md` files work across Claude Code
modified
--- a/code-review.md +++ b/code-review.md @@ -21,7 +21,7 @@ How reviews work -Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Claude posts a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. +Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Code Review updates the GitHub check run to show that no issues were detected. Claude may also post a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. ### @@ -252,7 +252,7 @@ Pricing -Code Review is billed based on token usage. Each review averages $15-25 in cost, scaling with PR size, codebase complexity, and how many issues require verification. Code Review usage is billed separately through [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) and does not count against your plan’s included usage. The review trigger you choose affects total cost: +Code Review is billed based on token usage. Each review averages $15-25 in cost, scaling with PR size, codebase complexity, and how many issues require verification. Code Review usage is billed separately through [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) and does not count against your plan’s included usage. The review trigger you choose affects total cost: * **Once after PR creation** : runs once per PR * **After every push** : runs on each push, multiplying cost by the number of pushes
modified
--- a/code-review.md +++ b/code-review.md @@ -258,7 +258,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews until someone comments `@claude review` on a PR -In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ##
modified
--- a/code-review.md +++ b/code-review.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers:
modified
Show diff (143 lines)
--- a/code-review.md +++ b/code-review.md @@ -15,7 +15,7 @@ How reviews work -Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found. If no issues are found, Claude posts a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. +Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found, with a summary in the review body. If no issues are found, Claude posts a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. ### @@ -149,10 +149,10 @@ Customize reviews -Code Review reads two files from your repository to guide what it flags. Both are additive on top of the default correctness checks: - - * **`CLAUDE.md`** : shared project instructions that Claude Code uses for all tasks, not just reviews. Use it when guidance also applies to interactive Claude Code sessions. - * **`REVIEW.md`** : review-only guidance, read exclusively during code reviews. Use it for rules that are strictly about what to flag or skip during review and would clutter your general `CLAUDE.md`. +Code Review reads two files from your repository to guide what it flags. They differ in how strongly they influence the review: + + * **`CLAUDE.md`** : shared project instructions that Claude Code uses for all tasks, not just reviews. Code Review reads it as project context and flags newly introduced violations as nits. + * **`REVIEW.md`** : review-only instructions, injected directly into every agent in the review pipeline as highest priority. Use it to change what gets flagged, at what severity, and how findings are reported. ### @@ -160,7 +160,7 @@ CLAUDE.md -Code Review reads your repository’s `CLAUDE.md` files and treats newly-introduced violations as nit-level findings. This works bidirectionally: if your PR changes code in a way that makes a `CLAUDE.md` statement outdated, Claude flags that the docs need updating too. Claude reads `CLAUDE.md` files at every level of your directory hierarchy, so rules in a subdirectory’s `CLAUDE.md` apply only to files under that path. See the [memory documentation](</docs/en/memory>) for more on how `CLAUDE.md` works. For review-specific guidance that you don’t want applied to general Claude Code sessions, use `REVIEW.md` instead. +Code Review reads your repository’s `CLAUDE.md` files and treats newly introduced violations as nit-level findings. This works bidirectionally: if your PR changes code in a way that makes a `CLAUDE.md` statement outdated, Claude flags that the docs need updating too. Claude reads `CLAUDE.md` files at every level of your directory hierarchy, so rules in a subdirectory’s `CLAUDE.md` apply only to files under that path. See the [memory documentation](</docs/en/memory>) for more on how `CLAUDE.md` works. For review-specific guidance that you don’t want applied to general Claude Code sessions, use `REVIEW.md` instead. ### @@ -168,31 +168,60 @@ REVIEW.md -Add a `REVIEW.md` file to your repository root for review-specific rules. Use it to encode: - - * Company or team style guidelines: “prefer early returns over nested conditionals” - * Language- or framework-specific conventions not covered by linters - * Things Claude should always flag: “any new API route must have an integration test” - * Things Claude should skip: “don’t comment on formatting in generated code under `/gen/`” - -Example `REVIEW.md`: - - # Code Review Guidelines +`REVIEW.md` is a file at your repository root that overrides how Code Review behaves on your repo. Its contents are injected into the system prompt of every agent in the review pipeline as the highest-priority instruction block, taking precedence over the default review guidance. Because it’s pasted verbatim, `REVIEW.md` is plain instructions: [`@` import syntax](</docs/en/memory#import-additional-files>) is not expanded, and referenced files are not read into the prompt. Put the rules you want enforced directly in the file. + +#### + +​ + +What you can tune + +`REVIEW.md` is freeform markdown, so anything you can express as a review instruction is in scope. The patterns below have the most impact in practice. **Severity** : redefine what 🔴 Important means for your repo. The default calibration targets production code; a docs repo, a config repo, or a prototype might want a much narrower definition. State explicitly which classes of finding are Important and which are Nit at most. You can also escalate in the other direction, for example treating any `CLAUDE.md` violation as Important rather than the default nit. **Nit volume** : cap how many 🟡 Nit comments a single review posts. Prose and config files can be polished forever. A cap like “report at most five nits, mention the rest as a count in the summary” keeps reviews actionable. **Skip rules** : list paths, branch patterns, and finding categories where Claude should post no findings. Common candidates are generated code, lockfiles, vendored dependencies, and machine-authored branches, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead of skipping entirely: “in `scripts/`, only report if near-certain and severe.” **Repo-specific checks** : add rules you want flagged on every PR, like “new API routes must have an integration test.” Because `REVIEW.md` is injected as highest priority, these land more reliably than the same rules in a long `CLAUDE.md`. **Verification bar** : require evidence before a class of finding is posted. For example, “behavior claims need a `file:line` citation in the source, not an inference from naming” cuts false positives that would otherwise cost the author a round trip. **Re-review convergence** : tell Claude how to behave when a PR has already been reviewed. A rule like “after the first review, suppress new nits and post Important findings only” stops a one-line fix from reaching round seven on style alone. **Summary shape** : ask for the review body to open with a one-line tally such as `2 factual, 4 style`, and to lead with “no factual issues” when that’s the case. The author wants to know the shape of the work before the details. + +#### + +​ + +Example + +This `REVIEW.md` recalibrates severity for a backend service, caps nits, skips generated files, and adds repo-specific checks. + + # Review instructions + + ## What Important means here + + Reserve Important for findings that would break behavior, leak data, + or block a rollback: incorrect logic, unscoped database queries, PII + in logs or error messages, and migrations that aren't backward + compatible. Style, naming, and refactoring suggestions are Nit at + most. + + ## Cap the nits + + Report at most five Nits per review. If you found more, say "plus N + similar items" in the summary instead of posting them inline. If + everything you found is a Nit, lead the summary with "No blocking + issues." + + ## Do not report + + - Anything CI already enforces: lint, formatting, type errors + - Generated files under `src/gen/` and any `*.lock` file + - Test-only code that intentionally violates production rules ## Always check - - New API endpoints have corresponding integration tests - - Database migrations are backward-compatible - - Error messages don't leak internal details to users - - ## Style - - Prefer `match` statements over chained `isinstance` checks - - Use structured logging, not f-string interpolation in log calls - - ## Skip - - Generated files under `src/gen/` - - Formatting-only changes in `*.lock` files - -Claude auto-discovers `REVIEW.md` at the repository root. No configuration needed. + + - New API routes have an integration test + - Log lines don't include email addresses, user IDs, or request bodies + - Database queries are scoped to the caller's tenant + +#### + +​ + +Keep it focused + +Length has a cost: a long `REVIEW.md` dilutes the rules that matter most. Keep it to instructions that change review behavior, and leave general project context in `CLAUDE.md`. ## @@ -209,7 +238,7 @@ Feedback| Count of review comments that were auto-resolved because a developer addressed the issue Repository breakdown| Per-repo counts of PRs reviewed and comments resolved -The repositories table in admin settings also shows average cost per review for each repo. +The repositories table in admin settings also shows average cost per review for each repo. Dashboard cost figures are estimates for monitoring activity; for invoice-accurate spend, refer to your Anthropic bill. ## @@ -240,6 +269,14 @@ Retrigger a failed or timed-out review When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review once` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR is already subscribed to push-triggered reviews, pushing a new commit also starts a new review. The **Re-run** button in GitHub’s Checks tab does not retrigger Code Review. Use the comment command or a new push instead. + +### + +​ + +Review didn’t run and the PR shows a spend-cap message + +When your organization’s monthly spend cap is reached, Code Review posts a single comment on the PR explaining that the review was skipped. Reviews resume automatically at the start of the next billing period, or immediately when an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). ###
modified
--- a/code-review.md +++ b/code-review.md @@ -37,6 +37,14 @@ ​ +Rate and reply to findings + +Each review comment from Claude arrives with 👍 and 👎 already attached so both buttons appear in the GitHub UI for one-click rating. Click 👍 if the finding was useful or 👎 if it was wrong or noisy. Anthropic collects reaction counts after the PR merges and uses them to tune the reviewer. Reactions do not trigger a re-review or change anything on the PR. Replying to an inline comment does not prompt Claude to respond or update the PR. To act on a finding, fix the code and push. If the PR is subscribed to push-triggered reviews, the next run resolves the thread when the issue is fixed. To request a fresh review without pushing, comment `@claude review once` as a top-level PR comment. + +### + +​ + Check run output Beyond the inline review comments, each review populates the **Claude Code Review** check run that appears alongside your CI checks. Expand its **Details** link to see a summary of every finding in one place, sorted by severity:
modified
--- a/code-review.md +++ b/code-review.md @@ -1,4 +1,4 @@ -Code Review is in research preview, available for [Teams and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. +Code Review is in research preview, available for [Team and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers:
modified
--- a/code-review.md +++ b/code-review.md @@ -1,12 +1,13 @@ Code Review is in research preview, available for [Teams and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. -Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). This page covers: +Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For repositories on a self-hosted GitHub instance, see [GitHub Enterprise Server](</docs/en/github-enterprise-server>). This page covers: * How reviews work * Setup * Triggering reviews manually with `@claude review` and `@claude review once` * Customizing reviews with `CLAUDE.md` and `REVIEW.md` * Pricing + * Troubleshooting failed runs and missing comments ## @@ -45,7 +46,7 @@ 🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active 🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input -Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq: +Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. Annotations and the severity table are written to the check run independently of inline review comments, so they remain available even if GitHub rejects an inline comment on a line that moved. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq: gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID \ --jq '.output.text | split("bughunter-severity: ")[1] | split(" -->")[0] | fromjson' @@ -220,6 +221,34 @@ ​ +Troubleshooting + +Review runs are best-effort. A failed run never blocks your PR, but it also doesn’t retry on its own. This section covers how to recover from a failed run and where to look when the check run reports issues you can’t find. + +### + +​ + +Retrigger a failed or timed-out review + +When the review infrastructure hits an internal error or exceeds its time limit, the check run completes with a title of **Code review encountered an error** or **Code review timed out**. The conclusion is still neutral, so nothing blocks your merge, but no findings are posted. To run the review again, comment `@claude review once` on the PR. This starts a fresh review without subscribing the PR to future pushes. If the PR is already subscribed to push-triggered reviews, pushing a new commit also starts a new review. The **Re-run** button in GitHub’s Checks tab does not retrigger Code Review. Use the comment command or a new push instead. + +### + +​ + +Find issues that aren’t showing as inline comments + +If the check run title says issues were found but you don’t see inline review comments on the diff, look in these other locations where findings are surfaced: + + * **Check run Details** : click **Details** next to the Claude Code Review check in the Checks tab. The severity table lists every finding with its file, line, and summary regardless of whether the inline comment was accepted. + * **Files changed annotations** : open the **Files changed** tab on the PR. Findings render as annotations attached directly to the diff lines, separate from review comments. + * **Review body** : if you pushed to the PR while a review was running, some findings may reference lines that no longer exist in the current diff. Those appear under an **Additional findings** heading in the review body text rather than as inline comments. + +## + +​ + Related resources Code Review is designed to work alongside the rest of Claude Code. If you want to run reviews locally before opening a PR, need a self-hosted setup, or want to go deeper on how `CLAUDE.md` shapes Claude’s behavior across tools, these pages are good next stops:
modified
Show diff (101 lines)
--- a/code-review.md +++ b/code-review.md @@ -4,6 +4,7 @@ * How reviews work * Setup + * Triggering reviews manually with `@claude review` and `@claude review once` * Customizing reviews with `CLAUDE.md` and `REVIEW.md` * Pricing @@ -25,11 +26,31 @@ Marker| Severity| Meaning ---|---|--- -🔴| Normal| A bug that should be fixed before merging +🔴| Important| A bug that should be fixed before merging 🟡| Nit| A minor issue, worth fixing but not blocking 🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR Findings include a collapsible extended reasoning section you can expand to understand why Claude flagged the issue and how it verified the problem. + +### + +​ + +Check run output + +Beyond the inline review comments, each review populates the **Claude Code Review** check run that appears alongside your CI checks. Expand its **Details** link to see a summary of every finding in one place, sorted by severity: + +Severity| File:Line| Issue +---|---|--- +🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active +🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input + +Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq: + + gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID \ + --jq '.output.text | split("bughunter-severity: ")[1] | split(" -->")[0] | fromjson' + +This returns a JSON object with counts per severity, for example `{"normal": 2, "nit": 1, "pre_existing": 0}`. The `normal` key holds the count of Important findings; a non-zero value means Claude found at least one bug worth fixing before merge. ### @@ -85,7 +106,7 @@ * **Once after PR creation** : review runs once when a PR is opened or marked ready for review * **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues - * **Manual** : reviews start only when someone comments `@claude review` on a PR; subsequent pushes to that PR are then reviewed automatically + * **Manual** : reviews start only when someone comments `@claude review` or `@claude review once` on a PR; `@claude review` also subscribes the PR to reviews on subsequent pushes Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. @@ -97,14 +118,21 @@ Manually trigger reviews -Comment `@claude review` on a pull request to start a review and opt that PR into push-triggered reviews going forward. This works regardless of the repository’s configured trigger: use it to opt specific PRs into review in Manual mode, or to get an immediate re-review in other modes. Either way, pushes to that PR trigger reviews from then on. For the comment to trigger a review: +Two comment commands start a review on demand. Both work regardless of the repository’s configured trigger, so you can use them to opt specific PRs into review in Manual mode or to get an immediate re-review in other modes. + +Command| What it does +---|--- +`@claude review`| Starts a review and subscribes the PR to push-triggered reviews going forward +`@claude review once`| Starts a single review without subscribing the PR to future pushes + +Use `@claude review once` when you want feedback on the current state of a PR but don’t want every subsequent push to incur a review. This is useful for long-running PRs with frequent pushes, or when you want a one-off second opinion without changing the PR’s review behavior. For either command to trigger a review: * Post it as a top-level PR comment, not an inline comment on a diff line - * Put `@claude review` at the start of the comment + * Put the command at the start of the comment, with `once` on the same line if you’re using the one-shot form * You must have owner, member, or collaborator access to the repository - * The PR must be open and not a draft - -If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. + * The PR must be open + +Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. ## @@ -139,12 +167,6 @@ * Things Claude should skip: “don’t comment on formatting in generated code under `/gen/`” Example `REVIEW.md`: - -Report incorrect code - -Copy - -Ask AI # Code Review Guidelines @@ -192,7 +214,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews until someone comments `@claude review` on a PR -In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ##
added
Show diff (212 lines)
--- a/code-review.md +++ b/code-review.md @@ -0,0 +1,209 @@ +Code Review is in research preview, available for [Teams and Enterprise](<https://claude.ai/admin-settings/claude-code>) subscriptions. It is not available for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. + +Code Review analyzes your GitHub pull requests and posts findings as inline comments on the lines of code where it found issues. A fleet of specialized agents examine the code changes in the context of your full codebase, looking for logic errors, security vulnerabilities, broken edge cases, and subtle regressions. Findings are tagged by severity and don’t approve or block your PR, so existing review workflows stay intact. You can tune what Claude flags by adding a `CLAUDE.md` or `REVIEW.md` file to your repository. To run Claude in your own CI infrastructure instead of this managed service, see [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). This page covers: + + * How reviews work + * Setup + * Customizing reviews with `CLAUDE.md` and `REVIEW.md` + * Pricing + +## + +​ + +How reviews work + +Once an admin enables Code Review for your organization, reviews trigger when a PR opens, on every push, or when manually requested, depending on the repository’s configured behavior. Commenting `@claude review` starts reviews on a PR in any mode. When a review runs, multiple agents analyze the diff and surrounding code in parallel on Anthropic infrastructure. Each agent looks for a different class of issue, then a verification step checks candidates against actual code behavior to filter out false positives. The results are deduplicated, ranked by severity, and posted as inline comments on the specific lines where issues were found. If no issues are found, Claude posts a short confirmation comment on the PR. Reviews scale in cost with PR size and complexity, completing in 20 minutes on average. Admins can monitor review activity and spend via the analytics dashboard. + +### + +​ + +Severity levels + +Each finding is tagged with a severity level: + +Marker| Severity| Meaning +---|---|--- +🔴| Normal| A bug that should be fixed before merging +🟡| Nit| A minor issue, worth fixing but not blocking +🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR + +Findings include a collapsible extended reasoning section you can expand to understand why Claude flagged the issue and how it verified the problem. + +### + +​ + +What Code Review checks + +By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. You can expand what it checks by adding guidance files to your repository. + +## + +​ + +Set up Code Review + +An admin enables Code Review once for the organization and selects which repositories to include. + +1 + +Open Claude Code admin settings + +Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and find the Code Review section. You need admin access to your Claude organization and permission to install GitHub Apps in your GitHub organization. + +2 + +Start setup + +Click **Setup**. This begins the GitHub App installation flow. + +3 + +Install the Claude GitHub App + +Follow the prompts to install the Claude GitHub App to your GitHub organization. The app requests these repository permissions: + + * **Contents** : read and write + * **Issues** : read and write + * **Pull requests** : read and write + +Code Review uses read access to contents and write access to pull requests. The broader permission set also supports [GitHub Actions](</docs/en/github-actions>) if you enable that later. + +4 + +Select repositories + +Choose which repositories to enable for Code Review. If you don’t see a repository, make sure you gave the Claude GitHub App access to it during installation. You can add more repositories later. + +5 + +Set review triggers per repo + +After setup completes, the Code Review section shows your repositories in a table. For each repository, use the **Review Behavior** dropdown to choose when reviews run: + + * **Once after PR creation** : review runs once when a PR is opened or marked ready for review + * **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues + * **Manual** : reviews start only when someone comments `@claude review` on a PR; subsequent pushes to that PR are then reviewed automatically + +Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready. + +The repositories table also shows the average cost per review for each repo based on recent activity. Use the row actions menu to turn Code Review on or off per repository, or to remove a repository entirely. To verify setup, open a test PR. If you chose an automatic trigger, a check run named **Claude Code Review** appears within a few minutes. If you chose Manual, comment `@claude review` on the PR to start the first review. If no check run appears, confirm the repository is listed in your admin settings and the Claude GitHub App has access to it. + +## + +​ + +Manually trigger reviews + +Comment `@claude review` on a pull request to start a review and opt that PR into push-triggered reviews going forward. This works regardless of the repository’s configured trigger: use it to opt specific PRs into review in Manual mode, or to get an immediate re-review in other modes. Either way, pushes to that PR trigger reviews from then on. For the comment to trigger a review: + + * Post it as a top-level PR comment, not an inline comment on a diff line + * Put `@claude review` at the start of the comment + * You must have owner, member, or collaborator access to the repository + * The PR must be open and not a draft + +If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR. + +## + +​ + +Customize reviews + +Code Review reads two files from your repository to guide what it flags. Both are additive on top of the default correctness checks: + + * **`CLAUDE.md`** : shared project instructions that Claude Code uses for all tasks, not just reviews. Use it when guidance also applies to interactive Claude Code sessions. + * **`REVIEW.md`** : review-only guidance, read exclusively during code reviews. Use it for rules that are strictly about what to flag or skip during review and would clutter your general `CLAUDE.md`. + +### + +​ + +CLAUDE.md + +Code Review reads your repository’s `CLAUDE.md` files and treats newly-introduced violations as nit-level findings. This works bidirectionally: if your PR changes code in a way that makes a `CLAUDE.md` statement outdated, Claude flags that the docs need updating too. Claude reads `CLAUDE.md` files at every level of your directory hierarchy, so rules in a subdirectory’s `CLAUDE.md` apply only to files under that path. See the [memory documentation](</docs/en/memory>) for more on how `CLAUDE.md` works. For review-specific guidance that you don’t want applied to general Claude Code sessions, use `REVIEW.md` instead. + +### + +​ + +REVIEW.md + +Add a `REVIEW.md` file to your repository root for review-specific rules. Use it to encode: + + * Company or team style guidelines: “prefer early returns over nested conditionals” + * Language- or framework-specific conventions not covered by linters + * Things Claude should always flag: “any new API route must have an integration test” + * Things Claude should skip: “don’t comment on formatting in generated code under `/gen/`” + +Example `REVIEW.md`: + +Report incorrect code + +Copy + +Ask AI + + # Code Review Guidelines + + ## Always check + - New API endpoints have corresponding integration tests + - Database migrations are backward-compatible + - Error messages don't leak internal details to users + + ## Style + - Prefer `match` statements over chained `isinstance` checks + - Use structured logging, not f-string interpolation in log calls + + ## Skip + - Generated files under `src/gen/` + - Formatting-only changes in `*.lock` files + +Claude auto-discovers `REVIEW.md` at the repository root. No configuration needed. + +## + +​ + +View usage + +Go to [claude.ai/analytics/code-review](<https://claude.ai/analytics/code-review>) to see Code Review activity across your organization. The dashboard shows: + +Section| What it shows +---|--- +PRs reviewed| Daily count of pull requests reviewed over the selected time range +Cost weekly| Weekly spend on Code Review +Feedback| Count of review comments that were auto-resolved because a developer addressed the issue +Repository breakdown| Per-repo counts of PRs reviewed and comments resolved + +The repositories table in admin settings also shows average cost per review for each repo. + +## + +​ + +Pricing + +Code Review is billed based on token usage. Each review averages $15-25 in cost, scaling with PR size, codebase complexity, and how many issues require verification. Code Review usage is billed separately through [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) and does not count against your plan’s included usage. The review trigger you choose affects total cost: + + * **Once after PR creation** : runs once per PR + * **After every push** : runs on each push, multiplying cost by the number of pushes + * **Manual** : no reviews until someone comments `@claude review` on a PR + +In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. + +## + +​ + +Related resources + +Code Review is designed to work alongside the rest of Claude Code. If you want to run reviews locally before opening a PR, need a self-hosted setup, or want to go deeper on how `CLAUDE.md` shapes Claude’s behavior across tools, these pages are good next stops: + + * [Plugins](</docs/en/discover-plugins>): browse the plugin marketplace, including a `code-review` plugin for running on-demand reviews locally before pushing + * [GitHub Actions](</docs/en/github-actions>): run Claude in your own GitHub Actions workflows for custom automation beyond code review + * [GitLab CI/CD](</docs/en/gitlab-ci-cd>): self-hosted Claude integration for GitLab pipelines + * [Memory](</docs/en/memory>): how `CLAUDE.md` files work across Claude Code + * [Analytics](</docs/en/analytics>): track Claude Code usage beyond code review