I’ve been using Claude Code as my daily driver when it comes to coding with AI (along with Cursor).
Recently, I’ve installed the Code Review Github Action for reviews on my PRs, but I was not a fan of the default prompt.
It was too verbose and a nit picky when it came to review.
While this might be helpful for others, it became review overload. I decided to write a simpler prompt.
It also provides a basic summary, identifies critical issues/bugs and provides a basic emoji on if it should pass/fail code review.
This has been a great part of my workflow - especially to identify and resolve any issues before a human reviews!
Prompt
Please analyze the changes in this PR and focus on identifying critical issues related to:
- Potential bugs or issues
- Performance
- Security
- Correctness
If critical issues are found, list them in a few short bullet points. If no critical issues are found, provide a simple approval.
Sign off with a checkbox emoji: (approved) or (issues found).
Keep your response concise. Only highlight critical issues that must be addressed before merging. Skip detailed style or minor suggestions unless they impact performance, security, or correctness.
Full claude-code-review.yml
I did run into some issues when setting this up.
I had to update the claude-code-review.yml
permissions and include my github_token
.
claude-code-review.yml
:
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
direct_prompt: |
Please analyze the changes in this PR and focus on identifying critical issues related to:
- Potential bugs or issues
- Performance
- Security
- Correctness
If critical issues are found, list them in a few short bullet points. If no critical issues are found, provide a simple approval.
Sign off with a checkbox emoji: (approved) or (issues found).
Keep your response concise. Only highlight critical issues that must be addressed before merging. Skip detailed style or minor suggestions unless they impact performance, security, or correctness.
Conclusion
Let me know what you think or if you have any suggestions on how to improve the prompt.
For what its worth - I still recommend human reviewers to review your code.
This action just helps the feedback cycle be a bit faster.