Auto-review PRs with Claude Code before merge.
## Claude Code PR Review Hook
Configure Claude Code hooks for automatic pr review actions.
### .claude/hooks/pr-review.json
```json
{
"hooks": {
"pr-review": {
"description": "Auto-review PRs with Claude Code before merge.",
"command": ".claude/scripts/pr-review.sh",
"timeout": 30000,
"enabled": true
}
}
}
```
### .claude/scripts/pr-review.sh
```bash
#!/bin/bash
set -e
echo "Running PR Review hook..."
# Step 1: Validate environment
if [ -z "$PROJECT_ROOT" ]; then
PROJECT_ROOT=$(git rev-parse --show-toplevel)
fi
# Step 2: Run checks
cd "$PROJECT_ROOT"
# Run linting
npm run lint --quiet 2>/dev/null || echo "Lint warnings found"
# Run type checking
npm run typecheck 2>/dev/null || echo "Type errors found"
# Step 3: Report results
echo "PR Review hook completed successfully"
```
### Setup
1. Create `.claude/hooks/` directory
2. Add the JSON config file
3. Create the shell script and make executable
4. Claude Code will run this automaticallyFree to copy and use. Compatible with Claude Code, Claude 4 Opus.
Copy this prompt into your Claude Code project. Customize bracketed variables for your specific setup.
Initial release
Sign in and download this prompt to leave a review.