Claude review¶
.github/workflows/claude-review.yml has Claude review the diff of every pull request into main
and post its findings as inline comments, or one "No issues found" comment. The workflow file holds
the reasoning for each step; this page is the summary.
- When. On
opened,reopenedandready_for_review—not on every push: a pull request gets one Claude review in its life. Drafts are reviewed once they are marked ready; Dependabot's pull requests are skipped because they run without the repository's secrets. - Advice, not a gate. It needs the network and a credential, and two runs on the same diff do
not say the same thing. It must never become a required check;
check.ymldecides whether a pull request can merge (checks.md). The merge rules ofgit-flow:babysit-prdo wait for a successful run and judge its findings (sdlc/quality-gate.md). - Credential.
CLAUDE_CODE_OAUTH_TOKEN, a repository secret made withclaude setup-token, so a review draws on the Claude subscription rather than a paid API key. - Pinned and narrowed. The
code-reviewplugin is fetched at a fixed commit, its broadallowed-toolsline is removed, and Bash is limited to singlegh pr view,gh pr diffandgh pr commentcommands. The diff is written to a file outside the checkout first, so the review reads it with Read and Grep.gh pr viewruns with--jsononly: without it, it also reads the status checks, which the action's token cannot. - A skip is posted. When the plugin decides a pull request needs no review (a trivial change,
say), it posts one "Code review skipped:
" comment. claude-review-postedthen passes, and still fails a run that posted nothing at all. - Only Claude's own comment stops it. Before the review, a step asks GitHub whether
claude[bot], the app the review posts as, has posted a comment, review or inline comment on the pull request; if so the review is skipped with a notice andclaude-review-posteddoes not run. The plugin's own "Claude has already commented" condition is removed: its model took a worker session's comment from the bot account for Claude's and posted nothing (#846).scripts/tests/claude-review-earlier-test.shruns both steps offline. - Changing it. A pull request that changes the workflow file is not reviewed—the action
refuses unless the workflow equals the one on
main—so a change is seen working only on the next pull request after it merges.