Skip to content

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, reopened and ready_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.yml decides whether a pull request can merge (checks.md). The merge rules of git-flow:babysit-pr do wait for a successful run and judge its findings (sdlc/quality-gate.md).
  • Credential. CLAUDE_CODE_OAUTH_TOKEN, a repository secret made with claude setup-token, so a review draws on the Claude subscription rather than a paid API key.
  • Pinned and narrowed. The code-review plugin is fetched at a fixed commit, its broad allowed-tools line is removed, and Bash is limited to single gh pr view, gh pr diff and gh pr comment commands. The diff is written to a file outside the checkout first, so the review reads it with Read and Grep. gh pr view runs with --json only: 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-posted then 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 and claude-review-posted does 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.sh runs 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.