Learn: General
November 22, 2025

Our Setup for Automated Github PR Reviews with Claude Code

Cover Image
Daniel Lopes
Daniel Lopes

There's nothing more wasteful than watching PRs pile up while expensive programmers argue about formatting and miss the big architectural problems.

At GrowthX, we try to shift that work earlier. Planning and architecture ideally should happen before coding. When the PR comes, humans review what matters: business logic, product decisions, the hard stuff. Not syntax. Not subjective style preferences. Not whether someone used any instead of unknown or you missed an N+1 query.

We use Claude Code to handle the mechanical review automatically. It catches basic architectural issues, anti-patterns, common violations, and more. Within minutes. Every time. Against our exact standards.

Now we can focus on the hard stuff. and codebase stays consistent.

Here's our exact setup:

Setup

Create .github/workflows/claude-code-review.yml:

name: Claude Code Review on: pull_request: types: [opened, synchronize, ready_for_review, reopened] jobs: review: runs-on: ubuntu-latest permissions: contents: read pull-requests: write id-token: write steps: - name: Check if review should be skipped id: skip-check run: | if [[ "${{ github.event.pull_request.title }}" == *"[skip-claude]"* ]]; then echo "skip=true" >> $GITHUB_OUTPUT echo "PR title contains [skip-claude], skipping Claude code review" else echo "skip=false" >> $GITHUB_OUTPUT echo "PR title does not contain [skip-claude], proceeding with review" fi - name: Skip review if magic string found if: steps.skip-check.outputs.skip == 'true' run: | echo "Skipping Claude code review due to [skip-claude] in PR title" exit 0 - uses: actions/checkout@v6 if: steps.skip-check.outputs.skip == 'false' with: fetch-depth: 1 - uses: anthropics/claude-code-action@v1 if: steps.skip-check.outputs.skip == 'false' with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY}} track_progress: true # ✨ Enables tracking comments prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} IMPORTANT: Do not make comments on anything that is already good. We only care about things to improve. IMPORTANT: Only comment on things we high level of confidence. Include your reasoning and confidence level on your comment first before we sharing. # Review Guidelines Review this pull request against our project standards and conventions. ## Primary Sources (Read these files first) 1. **Project Guidelines**: `CLAUDE.md` - Main development guide consolidating all standards 3. **Claude Agents**: `.claude/agents/` - Specialized review patterns: - `rails-routes-controller-auditor.md` - RESTful routing & controller standards - `design-engineer-reviewer.md` - Frontend review methodology ## Review Checklist ### Architecture & Conventions (CRITICAL) - [ ] Follows Rails RESTful conventions (7 standard actions, resource-based routing) as much as possible (exceptions are okay) - [ ] Uses Inertia.js for routing (NO React Router) - [ ] Files use kebab-case naming (e.g., `workflow-search.tsx` not `WorkflowSearch.tsx`) - [ ] Pages mirror Rails controller structure (`ControllerName/ActionName.tsx`) - [ ] Resource-based organization (NOT feature-based directories) - [ ] Follows monolith naming specificity (avoid generic names like `sync_controller.rb`) ### Rails Backend - [ ] Controllers use `render inertia:` (NOT JSON responses - though there may be exceptions) - [ ] Strong parameters used in all controllers - [ ] Database indexes on foreign keys AND frequently queried columns - [ ] Query optimization (includes, joins, select when possible) ### TypeScript & React - [ ] Rails uses snake_case, TypeScript uses camelCase (Inertia converts automatically) - [ ] No `any` types (use `unknown` if needed) - [ ] Functional React components with hooks (NO class components) - [ ] Workspace actions wrapped in `useMemo` - [ ] Proper memoization (React.memo, useMemo, useCallback) - [ ] Error boundaries implemented ### UI & Styling - [ ] Shadcn components used when available - [ ] Zinc theme applied consistently - [ ] Tailwind utility-first approach - [ ] Dark mode support included - [ ] Mobile-first responsive design - [ ] Accessibility (semantic HTML, ARIA, keyboard nav) ### Security & Performance - [ ] No secrets or credentials in code - [ ] XSS, CSRF, SQL injection protection - [ ] Proper CORS configuration - [ ] Database query optimization - [ ] Bundle size optimization ### Testing & Code Quality - [ ] Tests use Rails default test suite (Minitest, NOT RSpec) ## Review Instructions 1. Read the relevant guideline files above before starting review 2. Check against all applicable checklist items 3. Provide inline comments for specific violations with file references 4. Reference specific guideline documents in feedback (e.g., "Violates rule file X on line 312") 5. Include code examples showing correct patterns from our guidelines 6. Flag any anti-patterns listed in CLAUDE.md 7. For Rails controllers, verify against rails-routes-controller-auditor.md principles 8. For frontend code, verify against frontend-*.md best practices Provide detailed, actionable feedback using inline comments. claude_args: | --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"

Required Setup

  1. Add API key: Go to GitHub repo settings → Secrets → Add ANTHROPIC_API_KEY
  2. Create guidelines: Add a CLAUDE.md file with your project conventions
  3. Test it: Open a PR and watch Claude review it automatically

Tips

  • Add [skip-claude] to PR titles when you don't need review
  • Keep your CLAUDE.md updated with evolving standards
  • Use specific, actionable guidelines in your prompt
  • Reference guideline files Claude should read first

Result of a reivewResult of a reivew

Inline commentsInline comments