Skip to content

Pull request code reviews

With reflow pr, your coding agent can publish its review directly onto a GitHub pull request as reflow-code-review[bot]. Every review body and inline comment is labeled as written by an AI agent for the engineer running it (using their Reflow name, never their email), pinned to the exact head commit, and updated in place on follow-up passes.

Reflow posts comment reviews only. Approvals, change requests, and resolving review threads stay exclusively with humans through their own GitHub accounts (gh pr review 42 --approve). reflow pr review refuses --approve and --request-changes locally without sending a request.

Each review summary and inline diff comment is clearly attributed to the engineer running the agent and updates in place on follow-up passes:

src/checkout/pricing.ts · line 48 (RIGHT)
──────────────────────────────────────────────────────────────────────────
reflow-code-review[bot] · Written by an AI agent (claude-sonnet-4-6) for Alex Rivera
Empty discount arrays throw `TypeError` before reaching the fallback branch.
Reproduced in `checkout-empty-discount` (step 2/3).
Evidence: https://app.reflow.io/acme/review-apps/pr-42-pricing
[key: null-guard-checkout · updates in place on re-run]
SurfacePosted byUpdates in placeCan approve / merge
reflow ci report --postreflow-code-review[bot]Yes (one PR summary comment)No
Review appHosted private/public linkYes (manage_review_apps update)No
reflow pr review / commentreflow-code-review[bot] (attributed to engineer)Yes (by comment key)No (comment-only)
gh pr review --approveHuman engineer’s GitHub accountManualYes

Agent PR publishing is off by default until a team owner or admin enables it:

  1. Open Code review in the Reflow dashboard.
  2. Install or connect the Reflow GitHub App (reflow-code-review[bot]) on the repositories you administer.
  3. Link each repository to its Reflow collection.
  4. Set let agents post reviews to automatically.

Run reflow pr review with the pull request number (or URL), the exact 40-character head commit SHA, a Markdown summary body, and optional inline diff comments:

Terminal window
reflow pr review 42 \
--head "$(gh pr view 42 --json headRefOid -q .headRefOid)" \
-F review.md \
--comments-file comments.json \
--model claude-sonnet-4-6
  • Pull request target: Pass a PR number (42) or full URL (https://github.com/OWNER/REPO/pull/42).
  • Repository resolution: With a PR URL or -R OWNER/REPO, Reflow resolves the collection linked to that repository on the Code review page (if --collection is also passed, it must match). Without either flag, Reflow uses --collection or the workspace’s configured collection (from .reflow/app.yml or profile) and checks that its linked repository matches the checkout’s GitHub remote.
  • Cross-repo protection: If the collection is linked to a different repository, the command refuses before sending anything (wrong_repository) so a review cannot land on the wrong pull request.
FlagPurpose
--head <sha>Required exact 40-character head commit SHA. If the PR has moved to another commit, nothing is posted.
-b <text> / -F <file>Review summary body in Markdown (-F - reads from stdin).
--comments-file <path>Optional JSON file of inline diff comments.
--model <name>Model identifier displayed in the agent attribution label.
-R <OWNER/REPO>Explicit GitHub repository when running outside a matching checkout.
--jsonEmit one structured JSON result object.

reflow code-review post provides an equivalent interface with --pr, --body-file, and --repo <checkout-path>:

Terminal window
reflow code-review post --pr 42 --head <head-sha> --body-file review.md

Pass a JSON array to --comments-file to attach inline comments to lines in the pull request diff:

[
{
"key": "null-guard-checkout",
"path": "src/checkout/pricing.ts",
"line": 48,
"side": "RIGHT",
"body": "Empty discount arrays throw `TypeError` before reaching the fallback branch."
},
{
"key": "retry-window",
"path": "src/checkout/retry.ts",
"start_line": 12,
"line": 19,
"body": "Retry backoff exceeds the 15s request timeout on attempt 3."
}
]
FieldRequiredDescription
pathYesRepository-relative file path in the PR diff.
lineYesDiff line number where the comment attaches. A line outside the diff causes GitHub to reject the review.
bodyYesMarkdown comment body.
sideNoRIGHT (default, head side) or LEFT (base side).
start_lineNoStarting line above line for a multi-line comment range.
keyNoStable logical identifier for idempotent updates across re-runs. Defaults to (path, side, line).

Running reflow pr review again on the same pull request updates the existing agent review rather than stacking duplicate reviews:

  • Matching key with changed text updates the inline comment in place.
  • New keys are created as new inline comments.
  • Omitted keys are deleted automatically unless a human has replied to the thread, preserving ongoing discussions.

Use reflow pr comment for targeted follow-ups under the same team setting. Each invocation performs one action:

Terminal window
# Reply in any review thread on the pull request
reflow pr comment 42 \
--reply-to https://github.com/OWNER/REPO/pull/42#discussion_r123 \
-b "Fixed in abc1234 — verified with the checkout flow."
# Post, update, or remove the agent's PR conversation comment
reflow pr comment 42 -b "Summary of the fixes."
reflow pr comment 42 --edit-last --create-if-none -F status.md
reflow pr comment 42 --delete-last --yes
# Edit or delete one specific agent comment by key or link
reflow pr comment 42 --edit key:null-guard-checkout -b "Still open: null array case."
reflow pr comment 42 --delete https://github.com/OWNER/REPO/pull/42#issuecomment-456 --yes
  • Target an existing comment by URL (#discussion_r... for a review comment, #issuecomment-... for a conversation comment), by numeric review comment ID, or by key:<name> for a keyed inline comment.
  • Edits and deletes operate strictly on Reflow’s own agent comments—never on a human comment or the CI summary comment. Deleting requires --yes.
  • Replies deduplicate by --key (defaulting to the thread plus comment text) so repeated calls do not post twice.
  • --head is optional on reflow pr comment; when supplied, nothing is written if the PR head has advanced.

Deterministic output and rate-limit recovery

Section titled “Deterministic output and rate-limit recovery”

Human output prints Posted the review: <url> with counts of inline comments created, updated, deleted, and unchanged; Partly posted: <why> if a partial write stopped mid-way; or Not posted: <why>.

With --json, reflow pr review emits:

{
"outcome": "posted",
"reason": null,
"say": "...",
"review_url": "https://github.com/OWNER/REPO/pull/42#pullrequestreview-123",
"comments": { "created": 2, "updated": 1, "deleted": 0, "unchanged": 0 },
"not_done": null,
"retry_after_seconds": null
}

Reflow sends each request once and never hides rate limits behind silent retries. When GitHub limits requests or stops a multi-comment update part-way, comments reports what landed, not_done (create, update, delete, review_body) reports what remains, retry_after_seconds reports GitHub’s requested wait time, and say gives a clear status line. Re-running the same reflow pr review command after waiting finishes only the remaining writes without duplicating anything.

Exit code 0 means the review landed completely. Uncertain writes report outcome: "uncertain" and exit non-zero.

Human output prints Posted the comment: <url>, Edited the comment: <url>, Deleted the comment., Nothing to change: <url>, or Not posted: <why> (Not changed: <why> for edits and deletes).

With --json, it emits {outcome, reason, say, comment_url, comment_id, changed, retry_after_seconds}. It exits 0 only on outcome: "posted" and 2 on local usage errors before any network contact.

Pair PR reviews with Review Apps and CI summaries

Section titled “Pair PR reviews with Review Apps and CI summaries”

The cleanest review workflow pairs all three surfaces without duplicating evidence:

  1. Automated CI summary (reflow ci report --post): Keeps one bot comment updated on every push with flow pass/fail transitions, snapshot diffs, and a private CI review page.
  2. Curated walkthrough (Review apps): Publishes an interactive HTML/Markdown page with <reflow-compare> visual sliders and <reflow-run> / <reflow-flow> embeds for human reviewers.
  3. Targeted code review (reflow pr review): Posts the review app URL in the summary body and places keyed inline comments only on the exact diff lines that need attention.

To post directly from your personal GitHub account instead of reflow-code-review[bot], use the gh CLI (covered by the pr-publishing skill).

Every limit is checked locally before contacting Reflow or GitHub:

  • Review event: Comment-only (--approve and --request-changes are always refused).
  • Review body: Up to 60,000 characters.
  • Inline comments: Up to 100 comments, 20,000 characters each.
  • Total payload: Up to 500,000 bytes across body and comments.
  • Reserved marker: Text cannot contain <!-- reflow-.
  • Head commit lock: --head must be a full 40-character hexadecimal SHA matching the PR’s current head.