chore: claude-review - add stacked PR context#2325
Conversation
Graphite Automations"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (03/05/26)2 reviewers were added to this PR based on Anton Bykov's automation. |
There was a problem hiding this comment.
Pull request overview
Updates the Claude Code Review GitHub Actions workflow to include stacked-PR ancestry context in the prompt so the reviewer can optionally pull parent diffs for background.
Changes:
- Fetch full git history in checkout (
fetch-depth: 0). - Add a step that uses
gh pr list+jqto build a “Stacked PR Context” section and exports it viaGITHUB_ENV. - Extend the Claude prompt and allowed tools to support stacked-context lookup and editing an empty PR description.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
bc30d30 to
6c8fdf0
Compare
6c8fdf0 to
521a274
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
9c67b50 to
5b1f862
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
5b1f862 to
06c2f21
Compare
06c2f21 to
be7e761
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
be7e761 to
6559818
Compare
Merge activity
|

When review runs vs. skips
Job 1:
optimize_ci— stack position checkRuns first on every PR event. Decides
should_review:claude-reviewlabelGoal: avoid running Claude review on every PR in a stack — only the top PR gets reviewed.
Job 2:
claude-review— actual reviewOnly runs when:
should_review == true(from above)Additionally guarded by the
targets_maincheck inside the job:main→ run reviewBuild PR stack context (step)
When a PR does not directly target
main, this step walks the stack upward to find all parent PRs.Algorithm:
base_refof the current PRgh pr list --head <branch>to find the PR whose head is that branchPR #N: <title>for each parentmainor hitting a missing PR or the 20-iteration safety limittargets_main=trueif the walk reachesmainOutput:
targets_main— gates whether the review step runs at allstack_section— a formatted markdown block injected into the Claude promptHow Claude uses stack context:
The
stack_sectionis appended to the review prompt with instructions to:gh pr diff <number>This gives Claude enough context to understand what code is new in the current PR vs. inherited from parent stack PRs.