quiet robot

Agent Playground

Recipe: PR reviewer

Checks out a pull request, lints and tests it, drafts review notes, and asks a person before posting them. What it does, when to use it, how to make it yours, and what a run costs.

View as Markdown

Checks out a pull request, lints it, runs its tests, drafts review notes, and asks a person before anything is posted. If there's nothing to say, it finishes quietly.

At a glanceNotes
CategoryCoding
ShapeA branch, then a person
PlanFree and up
Needs a Claude keyNo
Limits it comes with1 loop, 900 seconds, $0.05
PR reviewer, as it is on the canvas.Check out PR (Run command), Lint (Run command), Run tests (Run command), Write review notes (Run code), Anything to say? (Decide), Post review? (Approval), Post review (Run command), Looks good (Output), Not posted (Output). Arrows: Check out PR to Lint; Lint to Run tests on Either way; Run tests to Write review notes on Either way; Write review notes to Anything to say?; Anything to say? to Post review? on Yes; Anything to say? to Looks good on No; Post review? to Post review on Approved; Post review? to Not posted on Denied.Either wayEither wayYesNoApprovedDenied>_ RUN COMMANDCheck out PR>_ RUN COMMANDLint>_ RUN COMMANDRun tests{ } RUN CODEWrite review notes◆ DECIDEAnything to say?✋ APPROVALPost review?>_ RUN COMMANDPost review⚑ OUTPUTLooks good⚑ OUTPUTNot posted
PR reviewer, as it is on the canvas.
The PR reviewer recipe in the builder after a run, with each step's result on the canvas and the run's steps listed on the right.
A real run of the recipe, waiting at the approval for a person.

When to use it

  • Every pull request should get the same first look: lint, tests, a short note on what to fix.
  • You want an AI to draft reviews, but a person to decide what gets posted.
  • A GitHub trigger should review every new pull request without anyone pressing Run.

Run it

  1. Open Agent Playground in the dashboard and find PR reviewer under Start from a recipe. In the builder, Recipes in the toolbar lists them too.
  2. Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
  3. Choose Simulate to see the forecast, then Run.
  4. When the run waits for a person, approve or deny it from the banner, from Approvals, or from the approval email.

What you'll see: The lint finds an unused import, a bare except and a TODO. The tests pass. Write review notes turns that into a draft, Anything to say? answers Yes, and the run waits at Post review?. Approve and the review is saved; deny and the run ends at Not posted. In the recipe, nothing is sent to GitHub.

Make it yours

  1. Change Check out PR to fetch a real pull request: git clone https://github.com/you/app repo && cd repo && git fetch origin pull/42/head && git checkout FETCH_HEAD.
  2. Use your own linters in Lint, like ruff check . or npx eslint .. Keep the arrow to Run tests on Either way, so a failing lint still gets reviewed.
  3. Replace Write review notes with an Ask AI step that writes the review from the lint and test output, using Insert… to add each step's output.
  4. Make Post review call your code host's API, with a token saved under Policies → Secrets. Your organization's rules hold outgoing web calls for a person anyway, until you allow them.
  5. Add a GitHub trigger for pull_request events so it runs on every new pull request. See Tutorial 6.

What a run costs

These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.

NotesTypical1 in 10 runsAt most
Sandbox time$0.0015$0.0023$0.01
How long it takesabout 2 minutesabout 3 minutes900 seconds

A typical run uses $0.0015 of sandbox time, so about 650 runs cost $1, and every plan includes $5 of usage a month. The time includes a person taking a minute or two to answer the approval. The clock, and the sandbox, keep running while the run waits. At most is the most a run could cost with these limits: it stops at $0.05 or 900 seconds, whichever comes first.

  • Agent PlaygroundQuickstart: build and run your first flow
  • Agent PlaygroundBlocks
  • Agent PlaygroundRecipes
  • SandboxesQuickstart: your first sandbox
  • SandboxesMCP server
  • SandboxesAPI reference