Modify CLAUDE code review workflow settings#1261
Conversation
Updated CLAUDE code review workflow to modify max turns and refine prompt instructions.
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Claude code review workflow is updated to increase agent turns from 30 to 60, refine allowed tools by removing PR commands, prioritize reading local guidance files (CLAUDE.md and .claude/rules/), restructure output format requirements, and simplify comment posting to a single top-level summary. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Pull request overview
This PR refines the CLAUDE code review workflow configuration to optimize tool usage and improve prompt clarity. The changes aim to reduce tool call overhead while maintaining security by restricting file access to only necessary documentation files.
Changes:
- Increased max-turns from 30 to 60 to allow more comprehensive reviews
- Restricted tool allowlist by removing
gh pr list,gh pr status,gh issue comment, and limitingcatto specific documentation paths - Refined prompt instructions with explicit step-by-step guidance and modified output format requirements
| --allowedTools | ||
| "Bash(gh pr view:*)" | ||
| "Bash(gh pr diff:*)" | ||
| "Bash(gh pr comment:*)" |
There was a problem hiding this comment.
The removal of gh pr list, gh pr status, and gh issue comment from the allowed tools reduces flexibility. If the Claude reviewer needs to list PRs for context or check PR status, it will be unable to do so. Consider whether these capabilities are genuinely unnecessary or if they might be useful for comprehensive reviews.
| "Bash(gh pr comment:*)" | |
| "Bash(gh pr comment:*)" | |
| "Bash(gh pr list:*)" | |
| "Bash(gh pr status:*)" | |
| "Bash(gh issue comment:*)" |
| "Bash(cat CLAUDE.md:*)" | ||
| "Bash(cat .claude/rules/*:*)" |
There was a problem hiding this comment.
The restricted cat tool permissions (from "Bash(cat:)" to "Bash(cat CLAUDE.md:)" and "Bash(cat .claude/rules/:)") improve security by preventing arbitrary file reads. However, this might be too restrictive if the reviewer needs to examine other documentation files or configuration files (like .github/workflows/*.yml for context). Verify that these restrictions won't hinder the reviewer's ability to gather necessary context.
| Post ONE top-level PR comment titled "Claude Code Review". | ||
| If posting a PR comment is blocked, write the full review to the GitHub Actions job summary instead. | ||
| Then stop. |
There was a problem hiding this comment.
The removal of the fallback instruction "If posting a PR comment is blocked, write the full review to the GitHub Actions job summary instead" eliminates a useful error handling mechanism. If the gh pr comment command fails due to permissions issues or API errors, the review results will be lost. Consider keeping this fallback to ensure review feedback is always captured somewhere.
| - If issues: include file + line numbers when possible | ||
| - If no issues: at least 3 concrete improvement opportunities with file paths | ||
| - Findings with file + line numbers when possible | ||
| - If no issues: 0–3 improvement opportunities (only if confident) |
There was a problem hiding this comment.
The instruction "If no issues: 0–3 improvement opportunities (only if confident)" is ambiguous. The range "0–3" suggests the reviewer can choose to provide zero improvement opportunities, but the parenthetical "(only if confident)" could be interpreted as applying only when providing opportunities or as a general qualifier. Consider clarifying this to "If no issues: provide 0–3 improvement opportunities (only suggest if confident they would be valuable)" or similar wording.
| - If no issues: 0–3 improvement opportunities (only if confident) | |
| - If no issues: provide 0–3 improvement opportunities (only suggest if confident they would be valuable) |
| @@ -15,7 +15,6 @@ jobs: | |||
| id-token: write | |||
|
|
|||
| steps: | |||
There was a problem hiding this comment.
The removed comment "# IMPORTANT: checkout BASE repo only (safe on forks)" provided valuable security context for why this step is safe in pull_request_target workflows. Removing it makes the workflow less self-documenting. Consider keeping this comment as it explains a critical security consideration.
| steps: | |
| steps: | |
| # IMPORTANT: checkout BASE repo only (safe on forks) |
User description
Updated CLAUDE code review workflow to modify max turns and refine prompt instructions.
CodeAnt-AI Description
Limit Claude review scope, tighten tool access, and extend max turns to 60
What Changed
Impact
✅ Fewer accidental reads of forked PR code✅ Clearer, single-comment review summaries✅ Longer, more thorough automated review sessions💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit