Code Review
The /code_review command runs a structured, multi-phase code review between two branches and delivers the results directly to your Telegram chat.
Basic usage
/code_reviewClaude will ask you to select a review branch and a base branch interactively.
To skip the review branch prompt, pass the branch name (or a search query) as an argument:
/code_review feature/my-featureBranch selection
Since repos are shared and read-only, there is no “current branch” — you always specify which branches to compare.
Review branch
- If you pass an argument (e.g.,
/code_review my-feature), Claude searches remote branches matching that query. - If you pass no argument, Claude asks you to type a branch name.
- Exact match — uses the branch directly.
- Multiple matches — shows matching branches as buttons for you to tap.
- No matches — reports an error and stops.
Base branch
After selecting the review branch, Claude asks you to choose a base branch:
- master (default) — tap to use master
- Custom base branch — type a branch name, then select from matches (same flow as above)
What it does
When you run /code_review, Claude:
- Fetches the latest remote refs from origin
- Diffs the review branch against the base (
git diff origin/base...origin/review) - Spawns a background sub-agent to analyze the diff
- Synthesizes the findings into a structured report
- Delivers a summary to your Telegram chat and attaches the full report as a document
Initialization message
Once both branches are confirmed, Claude sends a confirmation message:
Code Review Initialization
Review Branch: feature/my-featureCommit: a3f9c12 — feat: add new feature
Base Branch: masterCommit: b1d2e34 — chore: release v1.2.0
Processing...This operation may take several minutes.You will be notified upon completion.Review output
When the review finishes, Claude sends a Telegram summary with:
- Verdict —
APPROVED,CONDITIONAL, orREJECT - Grade — A through F
- Issues found — each with severity, file, category, CWE ID, and description
- Action checklist — items required before merge
Grades and verdicts:
| Grade | Meaning | Verdict |
|---|---|---|
| A | No issues | APPROVED |
| B | Low severity only | APPROVED |
| C | At least one Medium or High | CONDITIONAL |
| D | At least one Critical | REJECT |
| F | Two or more Critical | REJECT |
Issue severity levels:
| Severity | Meaning |
|---|---|
| Critical | Auth bypass, data loss, RCE — directly exploitable |
| High | Logic error with clear impact under realistic conditions |
| Medium | Defensive coding gap or latent bug, no direct exploit |
| Low | Style or consistency issue, no functional impact |
Each issue is classified with a CWE (Common Weakness Enumeration) ID when applicable, linking to the standardized weakness definition. Non-security style issues are marked as N/A.
If issues are found, the full report is also sent as a document (.md file) with detailed descriptions, CWE references, code snippets, and suggested fixes for every issue.
Existing report detection
If a report already exists for the current commit, Claude asks:
A report already exists for commit
a3f9c12on branchfeature/my-feature.
- Send existing report
- Re-review code
Choose Send existing report to retrieve the cached result instantly, or Re-review code to run a fresh analysis (useful after making fixes).
Report history
Reports are saved inside the shared repository under:
.code-review-reports/<branch-name>/<commit-hash>_#<n>_<datetime>_code_review_report.mdMultiple reviews for the same commit are numbered (#0, #1, #2, …) so you can track how the quality changed between fix attempts.
Requirements
- An active session with a cloned repository (
/repo clone+/start) - Both branches must exist on the remote
- The review branch must have commits that differ from the base