mirror of
https://github.com/anthropics/claude-code.git
synced 2026-01-30 04:02:03 +00:00
feat(code-review): Make local-only output the default behavior
Change default to output review to terminal only. Users must now pass --comment to post to GitHub PR. This is more convenient for local development where posting to PRs is usually not desired.
This commit is contained in:
@@ -26,25 +26,24 @@ Performs automated code review on a pull request using multiple specialized agen
|
||||
|
||||
**Usage:**
|
||||
```bash
|
||||
/code-review [--no-comment]
|
||||
/code-review [--comment]
|
||||
```
|
||||
|
||||
**Options:**
|
||||
- `--no-comment`: Skip posting the review to GitHub. Output the review to the terminal only. Useful for local review without creating PR comments.
|
||||
- `--comment`: Post the review as a PR comment on GitHub. By default, the review is output to the terminal only.
|
||||
|
||||
**Example workflow:**
|
||||
```bash
|
||||
# On a PR branch, run:
|
||||
# On a PR branch, run (outputs to terminal only):
|
||||
/code-review
|
||||
|
||||
# Claude will:
|
||||
# - Launch 4 review agents in parallel
|
||||
# - Score each issue for confidence
|
||||
# - Post comment with issues ≥80 confidence
|
||||
# - Skip posting if no high-confidence issues found
|
||||
# - Output review with issues ≥80 confidence to terminal
|
||||
|
||||
# For local-only review (no GitHub comment):
|
||||
/code-review --no-comment
|
||||
# To post review as a GitHub PR comment:
|
||||
/code-review --comment
|
||||
```
|
||||
|
||||
**Features:**
|
||||
@@ -55,7 +54,7 @@ Performs automated code review on a pull request using multiple specialized agen
|
||||
- Historical context analysis via git blame
|
||||
- Automatic skipping of closed, draft, or already-reviewed PRs
|
||||
- Links directly to code with full SHA and line ranges
|
||||
- Optional `--no-comment` flag for local-only review without posting to GitHub
|
||||
- Local-only output by default; use `--comment` flag to post to GitHub PR
|
||||
|
||||
**Review comment format:**
|
||||
```markdown
|
||||
@@ -203,7 +202,7 @@ https://github.com/owner/repo/blob/[full-sha]/path/file.ext#L[start]-L[end]
|
||||
- **Iterate on guidelines**: Update CLAUDE.md based on patterns
|
||||
- **Review automatically**: Set up as part of PR workflow
|
||||
- **Trust the filtering**: Threshold prevents noise
|
||||
- **Use `--no-comment` for local development**: Get review feedback without cluttering the PR
|
||||
- **Use `--comment` for CI/CD**: Post review to PR when running in automated workflows
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ description: Code review a pull request
|
||||
Provide a code review for the given pull request.
|
||||
|
||||
**Arguments:**
|
||||
- `--no-comment`: Skip posting the review as a PR comment. Instead, output the review to the terminal only. This is useful when running locally and you don't want to post to GitHub.
|
||||
- `--comment`: Post the review as a PR comment on GitHub. By default, the review is output to the terminal only.
|
||||
|
||||
To do this, follow these steps precisely:
|
||||
|
||||
@@ -56,8 +56,8 @@ Note: Still review Claude generated PR's.
|
||||
6. Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.
|
||||
|
||||
7. Finally, output the review:
|
||||
- If `--no-comment` was passed as an argument, output the review directly to the terminal (do NOT post to GitHub)
|
||||
- Otherwise, post the review as a comment on the pull request using `gh pr comment`
|
||||
- If `--comment` was passed as an argument, post the review as a comment on the pull request using `gh pr comment`
|
||||
- Otherwise, output the review directly to the terminal (do NOT post to GitHub)
|
||||
|
||||
When writing your review, follow these guidelines:
|
||||
a. Keep your output brief
|
||||
|
||||
Reference in New Issue
Block a user