Skip to content

Add claude_review.yml: @claude review on PRs - #4

Merged
mbloechli merged 3 commits into
mainfrom
add-claude-review
Aug 5, 2026
Merged

Add claude_review.yml: @claude review on PRs#4
mbloechli merged 3 commits into
mainfrom
add-claude-review

Conversation

@mbloechli

Copy link
Copy Markdown
Contributor

Adds a second consumer-facing reusable workflow. Commenting @claude review on any open PR
in a repo that opts in runs a Claude code review of it, posting findings as inline comments
plus a summary.

It's the same reviewer as the /code-review command in the Claude Code CLI, so findings are
calibrated like the ones developers already see locally.

Deliberately minimal

  • No knobs. The comment takes no arguments; model is fixed to opus, review depth to
    medium effort. medium reports only findings the reviewer is confident in, so we start
    low-noise. Raising it later is a one-line change.
  • Never automatic. No PR-open trigger. A PR only costs something when someone asks.
  • Review-only, enforced twice. The job token gets contents: read, and --allowedTools
    omits Edit/Write/Bash. There is no path from a review to changed code, even if a PR
    description tries to talk Claude into one.

Cost visibility

Each run posts a collapsed Claude review run details comment containing whatever Claude
Code recorded for the run — cost, tokens, duration, turns — so the requester sees the price.
Also written to the job summary. Runs on if: always(), since a failed review still burned
tokens.

Runner behaviour

runner defaults to self-hosted, matching how product repos call ci_orchestrator.yml.
The trigger check sits in the job's if:, so ordinary PR comments never occupy one of the
4 ARC slots. A second @claude review on a PR cancels an in-flight review of it.

Merge order

  1. Merge this.
  2. Cut v1.4.0 via the Release workflow so @v1 picks it up.
  3. Then merge Duatic/duatic_duarover_autonomy#(caller PR) — it pins @v1 and won't resolve
    before step 2.

pre-commit run (incl. actionlint) passes on the new workflow and the README.

Unverified until the first real run

  • Whether ghcr.io/actions/actions-runner:latest egress to api.anthropic.com is open and
    git is present in the image. The workflow avoids gh entirely for this reason.
  • The exact field set Claude Code records for a run; the reporting step dumps whatever is
    there and degrades quietly if the file is missing or unparseable.

Runs a Claude code review on a PR when someone comments '@claude review'
on it. Same reviewer as the /code-review command in the Claude Code CLI.

Deliberately unconfigurable: no comment arguments, model fixed to opus and
review depth to medium effort. Reviews are never automatic, so a PR only
costs something when a developer explicitly asks for a review, and each run
posts back what Claude Code recorded for it (cost, tokens, duration) so the
requester sees the price.

Review-only by construction: the job token gets contents: read and Claude is
given no Edit/Write/Bash tools, so a review cannot touch the code.
claude_code_oauth_token (from 'claude setup-token', valid one year) lets
reviews draw on a Pro/Max/Team/Enterprise plan allowance instead of being
billed per token. Both secrets are optional and passed through; the empty
one is ignored.

Also note in the README that the cost figure the run-details block reports
is computed locally at list rates, so under subscription auth it's what the
review would have cost on the API rather than an actual charge.
@mbloechli mbloechli self-assigned this Aug 5, 2026
@mbloechli
mbloechli merged commit b1ab831 into main Aug 5, 2026
1 check passed
@mbloechli
mbloechli deleted the add-claude-review branch August 5, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant