Recipes / Guides / AI code review agents / How-to

Step by step · from the official Claude and Codex actions

How to set up AI PR review on GitHub

Last updated · by Thomas, editor · How we verify

Anthropic and OpenAI each publish a GitHub Action that reviews pull requests. Here's the setup from the two official repos, plus the permission rules teams add so the bot comments and a person merges.

What you need

Set it up, step by step

  1. Add the API key as a repository secret. (recipe)
  2. Copy the workflow: the Claude action's quick start, or the review workflow in the Codex README. (recipe)
  3. Lock permissions. Give the workflow contents: read so only the comment step can write; for the Claude action, limit tools so it comments rather than pushes. (recipe)
  4. Paste a review prompt (below), then add your repo's own rules. Ask for real problems only, ranked by risk. (recipe)
  5. Pick the trigger: every new PR on a quiet repo, an @claude mention or a label on a busy one. (recipe)
  6. Protect the default branch and require CI, so “humans merge” holds even if a bot ignores its prompt. (recipe)
  7. Open a test PR and read the comments before you rely on it. (recipe)

Starter prompt: OpenAI's codex-action README example

This is PR #${{ github.event.pull_request.number }} for ${{ github.repository }}. Review ONLY the changes introduced by the PR, so consider: git log --oneline ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} Suggest any improvements, potential bugs, or issues. Be concise and specific in your feedback. Pull request title and body: ---- ${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}

Approval and safety rules

Real examples

Each one links to the recipe and its original source.

Compare more setups: AI code review agents: all 7 recipes →

Common questions

Is there an official GitHub Action for AI code review?

Yes, two: anthropics/claude-code-action and openai/codex-action. Each runs in a GitHub Actions workflow with your own API key.

How much does AI PR review cost?

Both recipes list API usage and state no figure. The Claude action's failure list warns costs grow on busy repos, so trigger on mention there.

Can the AI reviewer merge or push?

Not in these setups. The Codex workflow is read-only except for the comment step, the Claude recipe limits tools so it comments rather than pushes, and humans merge.

Get the next money recipe. Free.

New recipes every week, plus the top 10 agent setups pack. One email, no spam.

Unsubscribe anytime. Privacy

More guides: Make money with AI agents · AI voice agent business · AI agent agency ideas · Claude Code use cases · Grok Bot use cases · Claude Code vs Codex · AI agents for small business · AI email agents · AI code review agents · Parallel coding agents · AI agents that save you money · Autonomous agents that made money