AI-powered PR review agent using Claude Code CLI.
- GitHub CLI (
gh) — authenticated - Claude Code CLI (
claude) — with valid API key - Python 3.10+
# Review a PR (prints to stdout)
python3 claude_review.py --pr https://github.com/owner/repo/pull/123
# Save to file
python3 claude_review.py --pr https://github.com/owner/repo/pull/123 -o review.mdThe tool produces structured Markdown with:
- Summary — 2-3 sentences describing the change
- Identified Risks — potential bugs, security issues, or concerns
- Improvement Suggestions — actionable recommendations
- Confidence Score — Low / Medium / High based on diff complexity
The included workflow (.github/workflows/pr-review.yml) automatically reviews PRs when opened or updated.
- Add
ANTHROPIC_API_KEYto your repo's secrets (Settings → Secrets → Actions) - The workflow uses
GITHUB_TOKENautomatically forghCLI access
On every PR open/sync:
- Checks out the code
- Installs Claude Code CLI
- Runs
claude_review.pyagainst the PR - Posts the review as a PR comment
See examples/ for sample outputs from real PRs.
MIT