ReviewBot is a GitHub App that automatically performs AI-powered code review on pull requests. It fetches changed lines from each PR, asks Anthropic Claude to identify high-signal issues, and posts precise inline comments on the affected code.
When a pull request is opened or updated, GitHub sends a signed webhook event to ReviewBot. ReviewBot verifies the webhook signature, fetches the pull request diff through the GitHub API, parses the diff into changed files and added line numbers, sends those added lines to Claude for review, validates Claude's JSON response, and posts each issue as an inline pull request review comment on the exact file and line.
- Node.js
- TypeScript
- Express
- Octokit
- Anthropic Claude
- Railway
- Node.js 18+
- A GitHub account
- An Anthropic API key
git clone https://github.com/your-username/reviewbot.git
cd reviewbot
npm install- Go to github.com/settings/apps/new
- GitHub App name: ReviewBot (or any name)
- Homepage URL: your deployed URL (or http://localhost:3000 for now)
- Webhook URL: your deployed URL + /webhook
- Webhook secret: generate a random string, save it as GITHUB_WEBHOOK_SECRET
- Permissions needed — Repository permissions:
- Pull requests: Read & Write
- Contents: Read-only
- Subscribe to events: Pull request
- Where can this be installed: Only on this account
- Click Create GitHub App
- On the app page: note the App ID, save it as GITHUB_APP_ID
- Generate a private key, download the .pem file
- Convert it for the env var:
Save the output as GITHUB_PRIVATE_KEY
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' your-key.pem - Install the app on your own repositories
cp .env.example .envFill in all values in .env.
npm run devUse ngrok or smee.io to expose localhost:3000 to the internet for webhook delivery during development:
npx smee-client --url https://smee.io/your-channel --target http://localhost:3000/webhook- Push to GitHub
- Create new Railway project from repo
- Add environment variables
- Deploy — Railway auto-detects the Procfile
Open a PR on a repo where ReviewBot is installed. ReviewBot will automatically post inline comments within seconds.
[Security] eval() executes arbitrary code and is a critical security vulnerability. Replace with a safe alternative such as JSON.parse() for data or a proper expression parser library.
| Variable | Description | Where to find it |
|---|---|---|
| GITHUB_APP_ID | GitHub App ID used to authenticate as the app. | GitHub App settings page after app creation. |
| GITHUB_PRIVATE_KEY | GitHub App private key with newlines converted to \n. |
Download from the GitHub App settings page, then convert with the README command. |
| GITHUB_WEBHOOK_SECRET | Shared secret used to verify webhook signatures. | The random webhook secret you set while creating the GitHub App. |
| ANTHROPIC_API_KEY | API key used to call Claude. | Anthropic Console. |
| PORT | HTTP port for the Express server. | Set by Railway in production or use 3000 locally. |