Help humans review AI-generated code faster through comprehension aids
npm install reviewpalAI-powered code review for any language.
> Let Claude review your code changes and catch issues before your teammates do.
> š Detailed Guide: See INSTALL.md for a complete installation guide with troubleshooting.
1. Go to https://console.anthropic.com
2. Sign up or log in
3. Click "Get API Keys"
4. Click "Create Key"
5. Copy the key (starts with sk-ant-...)
> š” Tip: Keep this key secret! Don't commit it to your repo.
---
1. Go to your GitHub repo (e.g., github.com/yourname/yourrepo)
2. Click Settings (top right)
3. In the left sidebar, click Secrets and variables ā Actions
4. Click "New repository secret"
5. Name: ANTHROPIC_API_KEY
6. Value: Paste your API key from Step 1
7. Click "Add secret"
ā Your API key is now securely stored!
---
Option A: Quick Install (Terminal)
``bashNavigate to your repo
cd your-repo
Option B: Manual Setup (GitHub Web UI)
1. In your repo, click "Add file" ā "Create new file"
2. File path:
.github/workflows/reviewpal.yml
3. Paste this content:`yaml
name: ReviewPal
on:
pull_request:
types: [opened, synchronize]jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Arephan/reviewpal@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
`4. Click "Commit changes"
---
$3
1. Create a new branch:
git checkout -b test-reviewpal
2. Make some code changes
3. Commit and push: git push -u origin test-reviewpal
4. Create a Pull Request on GitHub
5. Wait ~30-60 seconds
6. ReviewPal will comment on your PR! š---
ā
That's It!
ReviewPal will now automatically review every PR in your repo.
Need help? Open an issue
---
What It Does
ReviewPal uses Claude AI to:
- ā
Detect the language automatically (Python, JS, Go, Rust, Java, etc.)
- ā
Find code quality issues - bugs, anti-patterns, security concerns
- ā
Spot AI-generated patterns - over-defensive code, verbose comments, over-abstraction
- ā
Give actionable suggestions - specific fixes, not vague advice
Language agnostic - works with any programming language!
---
Example Output
`markdown
š ReviewPal
$3
Lines 45-89
Language: TypeScript
Summary: Added user authentication with token validation and error handling.
Issues Found:
š” Excessive try-catch nesting (4 levels deep)
š” Fix: Use a single try-catch at the function boundary. Let errors bubble up naturally.
š” Missing input validation before database query
š” Fix: Add schema validation using zod or joi before the database call.
š¢ Consider using a constant for the token expiry time
š” Fix: Move magic number 3600 to a named constant: TOKEN_EXPIRY_SECONDS
`---
Installation
$3
`yaml
name: ReviewPal
on:
pull_request:
types: [opened, synchronize]jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ReviewPal
uses: Arephan/reviewpal@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
`$3
`bash
npm install -g reviewpalSet your API key
export ANTHROPIC_API_KEY=sk-ant-...Review staged changes
reviewpalReview a git range
reviewpal --git HEAD~3..HEADPipe from git
git diff main..feature | reviewpal -
`---
Configuration
$3
| Input | Description | Default |
|-------|-------------|---------|
|
anthropic_api_key | Required - Your Anthropic API key | - |
| max_hunks | Max code blocks to analyze | 20 |
| model | Claude model to use | claude-sonnet-4-20250514 |
| comment_on_pr | Post as PR comment | true |$3
`bash
reviewpal --helpOptions:
-g, --git Git diff range (e.g., HEAD~3..HEAD)
-f, --format Output: friendly, json
-m, --max-hunks Max hunks to analyze (default: 20)
--model Claude model (default: claude-sonnet-4-20250514)
-q, --quiet Minimal output
`---
Supported Languages
All of them! š
ReviewPal uses Claude AI to understand any programming language:
- JavaScript, TypeScript, Python, Java, Go, Rust, C++, C#, Ruby, PHP, Kotlin, Swift...
- Even SQL, YAML, Dockerfile, shell scripts, and more
Claude automatically detects the language and applies appropriate review standards.
---
How It Works
1. Parse the git diff into code changes
2. Send to Claude with context about the file and change
3. AI analyzes for:
- Language detection
- Code quality issues
- AI-generated patterns
- Improvement opportunities
4. Format results as friendly PR comments
---
Why ReviewPal?
Problem: AI-generated code is hard to review
- Over-defensive (try-catch everywhere)
- Over-verbose (obvious comments)
- Over-engineered (unnecessary abstractions)
Solution: Let AI review AI-generated code
- Catches patterns humans miss
- Works with any language
- Gives specific, actionable feedback
- Fast and consistent
---
š§ Troubleshooting
$3
Check 1: Is the workflow running?
- Go to your repo ā Actions tab
- Look for "ReviewPal" workflow runs
- Click on the latest run to see logs
Check 2: Is the API key set correctly?
- Go to repo Settings ā Secrets and variables ā Actions
- Verify
ANTHROPIC_API_KEY exists
- If not, add it (see Step 2 above)Check 3: Does the workflow file exist?
- Look for
.github/workflows/reviewpal.yml in your repo
- If missing, add it (see Step 3 above)Check 4: Are there code changes in the PR?
- ReviewPal only analyzes files with code changes
- Empty PRs or README-only changes won't trigger a review
---
$3
This means the API key is missing or invalid.
Fix:
1. Verify your API key at https://console.anthropic.com
2. Make sure it starts with
sk-ant-
3. Re-add it to GitHub Secrets (Settings ā Secrets ā Actions)
4. Close and reopen your PR to trigger a new run---
$3
Normal timing:
- Small PR (< 200 lines): 30-60 seconds
- Medium PR (500 lines): 1-2 minutes
- Large PR (1000+ lines): 2-5 minutes
If it's slower:
- Check GitHub Actions status page (status.github.com)
- Check Anthropic API status (status.anthropic.com)
- Reduce
max_hunks in the workflow to speed it up---
$3
Just change
@v1 to @v1.1.0 (or latest) in your workflow file:`yaml
- uses: Arephan/reviewpal@v1.1.0 # specific version
or
- uses: Arephan/reviewpal@v1 # auto-updates to latest v1.x
`Recommendation: Use
@v1 to get automatic updates.---
Development
`bash
Clone
git clone https://github.com/Arephan/reviewpal
cd reviewpalInstall
npm installBuild
npm run buildTest locally
export ANTHROPIC_API_KEY=sk-ant-...
node dist/index.js --git HEAD~1
`---
API Key Safety
Your
ANTHROPIC_API_KEY is:
- ā
Stored in GitHub Secrets (encrypted)
- ā
Only accessible to your workflows
- ā
Never logged or exposed in output
- ā
Can be rotated anytime at console.anthropic.com---
Cost
ReviewPal uses Claude Sonnet 4 by default (~$3 per million tokens).
Typical usage:
- Small PR (100 lines): ~$0.01
- Medium PR (500 lines): ~$0.05
- Large PR (2000 lines): ~$0.20
Set
max_hunks` to control costs on massive PRs.---
PRs welcome! Keep it:
1. Language agnostic
2. Actionable (not vague)
3. Friendly in tone
---
MIT
---
Made with Claude, for reviewing code written by Claude. š¤