Skip to content

Make the @claude PR review a panel of three independent reviewers - #24120

Merged
shoumikhin merged 1 commit into
pytorch:mainfrom
shoumikhin:claude-review-panel
Oct 23, 2026
Merged

shoumikhin merged 1 commit into
pytorch:mainfrom
shoumikhin:claude-review-panel

Conversation

@shoumikhin

@shoumikhin shoumikhin commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Today @claude /pr-review is one reviewer making one pass at the default effort level. One pass misses things and cannot tell real problems from noise.

This change turns the review into a small panel:

  1. Three reviewer sub-agents review the same diff with the same brief, without seeing each other's findings. Each reads the code itself, within about 15 tool calls, and does not search the whole git history.
  2. The main session merges duplicates, notes how many reviewers found each problem, checks every finding it would post against the code, drops the wrong ones, and marks the ones it cannot confirm as low confidence.
  3. It posts one review in the existing format.

For comments that start with @claude /pr-review, the workflow also passes --effort max. The reviewer sub-agents inherit it: in a local run, their requests carried the same max effort as the main session. Other @claude runs, such as questions, plain-language review requests and the automated CI fix attempts, keep the default effort.

Reviewers run in the foreground, because a non-interactive run stops background sub-agents when its turn ends. The skill also drops its extra investigation and fact-check sub-agents, which made a max-effort review far slower (see the test plan).

Test plan

Ran Claude Code locally with the tools, model (Opus 5.5) and settings the workflow passes, on two open PRs (a runtime change and an XNNPACK change), read only.

Runtime PR XNNPACK PR
Today 1 min 2 min
Today's skill at max effort 23 min, about 55x the tokens stopped after 30 min
This change 11 min, about 14x the tokens 21 min, about 17x the tokens

Both fit easily in the 60 minute job timeout, which stays as is.

Both panel reviews caught the main problems the single pass found and added real ones it missed: on the XNNPACK PR, the new test feeds the wrong input under the current Python bindings; on the runtime PR, a missing null check still crashes the load path the PR hardens. A single pass at max effort also found that null check, but took twice as long and about four times the tokens of the panel.

The workflow change itself only runs after merge, since @claude runs from main. The action also loads .claude/ from main, so every PR gets the new skill and the new effort setting together. The shared workflow pins Claude Code 2.1.280, which already supports --effort max.

@shoumikhin
shoumikhin requested a review from psiddh as a code owner October 23, 2026 16:35
Copilot AI balanced review requested due to automatic review settings October 23, 2026 16:35
@pytorch-bot

pytorch-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24120

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 1 Pending

As of commit c876784 with merge base 703a411 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Today @claude /pr-review is one reviewer making one pass at the default
effort level. A single pass misses things, and nothing separates real
problems from noise.

The review now runs three blind reviewer sub-agents with the same brief,
each reading the code itself within a small tool call budget. Each
reviewer names the changed files it did not reach, and the main session
reviews those itself or says they were not reviewed. The main session
merges their findings, notes how many reviewers found each one, checks
every finding it would post against the code, and posts one review in
the existing format. For comments that start with "@claude /pr-review"
the workflow passes --effort max, which the reviewer sub-agents inherit;
other @claude runs keep the default.

Reviewers run in the foreground, because background sub-agents are
stopped when a non-interactive run ends its turn. The skill no longer
asks for extra investigation or fact-check sub-agents, which made a
higher-effort review far slower and more expensive.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

uses: pytorch/test-infra/.github/workflows/_claude-code.yml@main
with:
additional_claude_args: --allowedTools Skill
additional_claude_args: --allowedTools Skill ${{ startsWith(github.event.comment.body, '@claude /pr-review') && '--effort max' || '' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atalman is effort max ok here? How do we watch budget of this

@shoumikhin
shoumikhin merged commit 8916832 into pytorch:main Oct 23, 2026
213 checks passed
shoumikhin added a commit to shoumikhin/executorch that referenced this pull request Oct 29, 2026
Review requests got --effort max only when the comment started with
"@claude /pr-review". This also gives max effort to comments that start
with "@claude review". It changes a choice pytorch#24120 made: that PR kept
plain-language review requests at the default effort, and measured max
effort reviews at 11 to 21 minutes and about 14 to 17 times the tokens,
against 1 to 2 minutes at default. The match is a case-insensitive prefix,
so "@claude please review" stays at the default. Every other request,
such as the pin bump's [ci-fix-attempt] runs, questions and new issues,
keeps the default effort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants