---
title: Recipe: PR reviewer · Agent Playground docs
description: 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.
url: https://www.quietrobot.ai/docs/playground/recipes/pr-reviewer
---

# 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.

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 glance | |
|---|---|
| **Category** | Coding |
| **Shape** | A branch, then a person |
| **Plan** | Free and up |
| **Needs a Claude key** | No |
| **Limits it comes with** | 1 loop, 900 seconds, $0.05 |

```flow
{"title": "PR reviewer, as it is on the canvas.", "nodes": [["checkout", "run", "Check out PR"], ["lint", "run", "Lint"], ["test", "run", "Run tests"], ["notes", "code", "Write review notes"], ["any", "branch", "Anything to say?"], ["approve", "approval", "Post review?"], ["post", "run", "Post review"], ["clean", "end", "Looks good"], ["held", "end", "Not posted"]], "edges": [["checkout", "lint"], ["lint", "test", "Either way"], ["test", "notes", "Either way"], ["notes", "any"], ["any", "approve", "Yes"], ["any", "clean", "No"], ["approve", "post", "Approved"], ["approve", "held", "Denied"]]}
```

<figure class="shot">
  <img class="art-light" src="/docs/playground/recipes/pr-reviewer-light.webp" alt="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." width="1440" height="900" loading="lazy">
  <img class="art-dark" src="/docs/playground/recipes/pr-reviewer-dark.webp" alt="" width="1440" height="900" loading="lazy">
  <figcaption>A real run of the recipe, waiting at the approval for a person.</figcaption>
</figure>

## 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](https://www.quietrobot.ai/docs/playground/tutorials/triggers).

## 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.

| | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| **Sandbox time** | $0.0015 | $0.0023 | $0.01 |
| **How long it takes** | about 2 minutes | about 3 minutes | 900 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.

## Related

* [Tutorial 6: Run a flow on its own](https://www.quietrobot.ai/docs/playground/tutorials/triggers)
* [Fix, review, ship](https://www.quietrobot.ai/docs/playground/recipes/fix-review-ship)
* [Coding recipes](https://www.quietrobot.ai/docs/playground/recipes/coding)
* [All recipes](https://www.quietrobot.ai/docs/playground/recipes)
