Customize Code Review changedcode-review-customize
Upstream edited this page at 29 Nov 2026 00:06 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 29 Nov 2026 00:07 UTC.
Upstream edited
Recorded here
Lines+15added
Lines−15removed
From line
15
where the diff opens
First seen
15 Oct 2026
this site's first read of the page
Recorded edits10to this page, all time
The whole hunk
from line 15, old and new numbered
/
from line 15
1515
1616## Use CLAUDE.md for project-wide rules
1717
18Code Review reads your repository's `CLAUDE.md` files as project context. A change that violates one of their rules becomes a finding at whichever [severity level](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels) fits the issue.
18Put project-wide rules in your repository's `CLAUDE.md` files, which Code Review reads as project context. When a change clearly breaks one of their rules, Code Review can flag it at whichever [severity level](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels) fits the issue.
1919
2020A review reads the `CLAUDE.md` at your repository root and the `CLAUDE.md` files in the parent directories of each changed file. A subdirectory's `CLAUDE.md` is read when the pull request changes a file under that path.
2121
from line 51
5151* **Generated code**: `generated`
5252* **Third-party code**: `vendor`, `third_party`, `third-party`, `thirdparty`, `node_modules`, `bower_components`, `external`, `extern`, `deps`, `godeps`, `pods`, `carthage`, `site-packages`, `contrib`
5353
54Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory's `REVIEW.md` when neither that parent nor anything above it is on the list.
54Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory's `REVIEW.md` that Code Review reads.
5555
56The remaining subdirectory `REVIEW.md` files on the paths a pull request changes share a limit of 150,000 bytes, not counting the root file. If the [check run](https://code.claude.com/docs/en/code-review-pull-requests.md#check-run-output) reports that some of them didn't fit, shorten the files to fit that limit.
56For the paths a pull request changes, keep the subdirectory `REVIEW.md` files within 150,000 bytes in total, apart from the root file. If the [check run](https://code.claude.com/docs/en/code-review-pull-requests.md#check-run-output) reports that some of them didn't fit, shorten the files.
5757
5858### Example REVIEW\.md
5959
from line 89
8989
9090### Choose what to write in REVIEW\.md
9191
92`REVIEW.md` is freeform Markdown that changes what a review finds and reports. It doesn't change the format of the review. Find the problem you're seeing, then add an instruction like the one shown. The [example](#example-review-md) uses the first four.
92Write `REVIEW.md` in freeform Markdown to change what a review finds and reports. It doesn't change the format of the review. Find the problem you're seeing, then add an instruction like the one shown. The [example](#example-review-md) uses the first four.
9393
9494* **The wrong things are marked Important**: redefine what 🔴 Important means for your repository. The default calibration targets production code, and a docs repository, a config repository, or a prototype might want a much narrower definition. State which classes of finding are Important and which are Nit at most. You can also escalate, for example treating any `CLAUDE.md` violation as Important.
9595* **Too many nits**: cap how many 🟡 Nit comments a single review posts. A cap like "report at most five nits" keeps reviews actionable.
9696* **Comments on generated files or on what CI already checks**: list paths and finding categories where Claude should skip findings. Common candidates are generated code, lockfiles, and vendored dependencies, 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: "in `scripts/`, only report if near-certain and severe."
9797* **A team rule isn't being checked**: add rules you want flagged on every pull request, like "new API routes must have an integration test."
98* **Findings that turn out to be wrong**: 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.
98* **Findings that turn out to be wrong**: require evidence before a class of finding is posted. For example, write "behavior claims need a `file:line` citation in the source, not an inference from naming."
9999
100100Some of these instructions [need the root file on a protected default branch](#which-branch-review-md-is-read-from).
101101
from line 141
141141
142142### Include a skill file
143143
144To have reviews follow guidance you keep in a [skill](https://code.claude.com/docs/en/skills.md), include the skill's `SKILL.md` in your root `REVIEW.md`. Code Review doesn't run skills.
144To have reviews follow guidance you keep in a [skill](https://code.claude.com/docs/en/skills.md), include the skill's `SKILL.md` in your root `REVIEW.md`.
145145
146146Add `@` and the path to `SKILL.md`, in the form `.claude/skills/<folder>/SKILL.md`, on a line of its own:
147147
from line 161
161161
162162Use a folder name without spaces. A line with a space in its path stays in `REVIEW.md` as plain text, and the check run doesn't report it as a skipped include.
163163
164If the `@` line for a skill breaks one of the rules below, Code Review doesn't include the skill from that line:
164For Code Review to include the skill from an `@` line, follow these rules:
165165
166166* **Path**: write the path as `.claude/skills/<folder>/SKILL.md` from the repository root, with the skill's folder directly under `skills/`. Unlike a file name at the root, a path of this form that matches no file is skipped and counted.
167* **Source**: copy guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](https://code.claude.com/docs/en/skills.md#where-skills-live), into a file beside `REVIEW.md`. You can't include those directly.
168* **File**: commit `SKILL.md` as a regular text file. Code Review doesn't follow a symbolic link, whether the link is the file or a folder in its path.
167* **Source**: to use guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](https://code.claude.com/docs/en/skills.md#where-skills-live), copy it into a file beside `REVIEW.md`
168* **File**: commit `SKILL.md` as a regular text file. If the file or a folder in its path is a symbolic link, replace the link with a copy.
169169* **Size**: keep `SKILL.md` at 30,000 bytes or less, frontmatter included
170* **Count**: write at most eight skill lines. A repeated line counts again toward the eight.
170* **Count**: write at most eight skill lines. If you repeat a line, it counts again toward the eight.
171171* **Blocks in `REVIEW.md`**: keep the `@` line out of code fences. Close every HTML comment and every `<pre>`, `<script>`, `<style>`, or `<textarea>` block above it.
172172
173173When Code Review skips a skill line for breaking the File, Size, Count, or Blocks rule, the check run's [message about skipped include lines](https://code.claude.com/docs/en/code-review-troubleshooting.md#the-check-run-mentions-review-md) counts it. The message appears only when the review applies `REVIEW.md` from a protected branch.
from line 174
174174
175175#### Check what a review gets from a skill
176176
177When the skill is included, a review gets the body of `SKILL.md` and nothing else from the skill, so check the skill against the list below.
177Check your skill against the list below, because a review gets only the body of `SKILL.md` from an included skill.
178178
179179* **Frontmatter**: repeat in the body anything a review needs from the [frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference), for example the conditions that `description` gives for using the skill
180180* **Injected commands**: write out what a [`!` command](https://code.claude.com/docs/en/skills#inject-dynamic-context) would supply. Code Review doesn't run the command, and replaces the whole line or block that holds it with a placeholder.
181* **Substitutions**: replace `$ARGUMENTS` and other [substitutions](https://code.claude.com/docs/en/skills.md#available-string-substitutions) with fixed text, because a review passes no arguments and leaves them as written
182* **Supporting files**: copy what a review needs into `SKILL.md`, because Code Review doesn't load scripts, linked files, or `@file` references
181* **Substitutions**: replace `$ARGUMENTS` and other [substitutions](https://code.claude.com/docs/en/skills.md#available-string-substitutions) with fixed text, because a review leaves them as written
182* **Supporting files**: copy what a review needs from scripts, linked files, or `@file` references into `SKILL.md`
183183* **Exclusions and Nit caps**: write instructions that exclude findings or cap Nits in `REVIEW.md` or a file beside it, not in the skill. Code Review doesn't accept a skill's text as the reason for either.
184184* **Links to repository files**: state in words what a link or `@file` reference points to. The review sees the path as plain text or as a placeholder.
185185
from line 218
218218* **Default branch**: a classic branch protection rule or a ruleset
219219* **Any other branch**: a ruleset only
220220
221A ruleset counts when it restricts updates or requires pull requests with at least one approval. If it requires pull requests, it must also dismiss that approval on a new push or require the approval to come after the last push.
221For a ruleset to count, set it to restrict updates or to require pull requests with at least one approval. If you choose pull requests, also set it to dismiss that approval on a new push or require the approval to come after the last push.
222222
223223#### What a review reads for each branch setup
224224
No line in this hunk matches that.