Blueprint · intermediate · 8 steps

Build a Code Review Bot

Create a GitHub Action that reviews pull requests with Claude — catches bugs and posts inline comments automatically.

← All blueprints
STEP 01Step 1: What We're BuildingA GitHub Action that uses Claude to automatically review pull requests — analyzing diffs, finding bugs, and posting inline comments directly on the PR.2 minSTEP 02Step 2: Project SetupInitialize the Node.js project, install the Anthropic SDK and Octokit, and configure TypeScript for building a GitHub Action.2 minSTEP 03Step 3: GitHub Action WorkflowCreate the YAML workflow file that triggers the code review bot whenever a pull request is opened or updated.2 minSTEP 04Step 4: Fetch PR DiffUse Octokit to fetch the pull request diff, extract changed files, and gather PR metadata for Claude to review.3 minSTEP 05Step 5: Analyze with ClaudeSend the PR diff to Claude with a carefully crafted system prompt for code review, and parse the response into structured feedback.4 minSTEP 06Step 6: Post Review CommentsPost Claude's structured feedback as GitHub PR review comments using the Octokit API, placing inline comments on the exact lines that need attention.4 minSTEP 07Step 7: Test and RefineTest the bot on a real pull request, tune the system prompt for better results, and handle edge cases like large diffs and binary files.4 minSTEP 08Step 8: What's NextExtend the bot with severity-based approvals, multi-language support, rate limiting, and smarter review strategies.4 min