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.
What an agent review looks like
Section titled “What an agent review looks like”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]| Surface | Posted by | Updates in place | Can approve / merge |
|---|---|---|---|
reflow ci report --post | reflow-code-review[bot] | Yes (one PR summary comment) | No |
| Review app | Hosted private/public link | Yes (manage_review_apps update) | No |
reflow pr review / comment | reflow-code-review[bot] (attributed to engineer) | Yes (by comment key) | No (comment-only) |
gh pr review --approve | Human engineer’s GitHub account | Manual | Yes |
Enable agent reviews
Section titled “Enable agent reviews”Agent PR publishing is off by default until a team owner or admin enables it:
- Open Code review in the Reflow dashboard.
- Install or connect the Reflow GitHub App (
reflow-code-review[bot]) on the repositories you administer. - Link each repository to its Reflow collection.
- Set let agents post reviews to automatically.
Post and update a review
Section titled “Post and update a review”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:
reflow pr review 42 \ --head "$(gh pr view 42 --json headRefOid -q .headRefOid)" \ -F review.md \ --comments-file comments.json \ --model claude-sonnet-4-6Target selection and repository guard
Section titled “Target selection and repository guard”- 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--collectionis also passed, it must match). Without either flag, Reflow uses--collectionor the workspace’s configured collection (from.reflow/app.ymlor 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.
Key flags
Section titled “Key flags”| Flag | Purpose |
|---|---|
--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. |
--json | Emit one structured JSON result object. |
reflow code-review post provides an equivalent interface with --pr, --body-file, and --repo <checkout-path>:
reflow code-review post --pr 42 --head <head-sha> --body-file review.mdKeyed inline diff comments
Section titled “Keyed inline diff comments”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." }]| Field | Required | Description |
|---|---|---|
path | Yes | Repository-relative file path in the PR diff. |
line | Yes | Diff line number where the comment attaches. A line outside the diff causes GitHub to reject the review. |
body | Yes | Markdown comment body. |
side | No | RIGHT (default, head side) or LEFT (base side). |
start_line | No | Starting line above line for a multi-line comment range. |
key | No | Stable logical identifier for idempotent updates across re-runs. Defaults to (path, side, line). |
Idempotent updates on re-post
Section titled “Idempotent updates on re-post”Running reflow pr review again on the same pull request updates the existing agent review rather than stacking duplicate reviews:
- Matching
keywith 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.
Replies and single comments
Section titled “Replies and single comments”Use reflow pr comment for targeted follow-ups under the same team setting. Each invocation performs one action:
# Reply in any review thread on the pull requestreflow 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 commentreflow pr comment 42 -b "Summary of the fixes."reflow pr comment 42 --edit-last --create-if-none -F status.mdreflow pr comment 42 --delete-last --yes
# Edit or delete one specific agent comment by key or linkreflow 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 bykey:<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. --headis optional onreflow 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”reflow pr review
Section titled “reflow pr review”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.
reflow pr comment
Section titled “reflow pr comment”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:
- 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. - Curated walkthrough (Review apps): Publishes an interactive HTML/Markdown page with
<reflow-compare>visual sliders and<reflow-run>/<reflow-flow>embeds for human reviewers. - 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).
Safety boundaries and limits
Section titled “Safety boundaries and limits”Every limit is checked locally before contacting Reflow or GitHub:
- Review event: Comment-only (
--approveand--request-changesare 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:
--headmust be a full 40-character hexadecimal SHA matching the PR’s current head.