Skip to content

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_review

Claude 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-feature

Branch selection

Since repos are shared and read-only, there is no “current branch” — you always specify which branches to compare.

Review branch

  1. If you pass an argument (e.g., /code_review my-feature), Claude searches remote branches matching that query.
  2. If you pass no argument, Claude asks you to type a branch name.
  3. Exact match — uses the branch directly.
  4. Multiple matches — shows matching branches as buttons for you to tap.
  5. 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:

  1. Fetches the latest remote refs from origin
  2. Diffs the review branch against the base (git diff origin/base...origin/review)
  3. Spawns a background sub-agent to analyze the diff
  4. Synthesizes the findings into a structured report
  5. 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-feature
Commit: a3f9c12 — feat: add new feature
Base Branch: master
Commit: 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:

  • VerdictAPPROVED, CONDITIONAL, or REJECT
  • Grade — A through F
  • Issues found — each with severity, file, category, CWE ID, and description
  • Action checklist — items required before merge

Grades and verdicts:

GradeMeaningVerdict
ANo issuesAPPROVED
BLow severity onlyAPPROVED
CAt least one Medium or HighCONDITIONAL
DAt least one CriticalREJECT
FTwo or more CriticalREJECT

Issue severity levels:

SeverityMeaning
CriticalAuth bypass, data loss, RCE — directly exploitable
HighLogic error with clear impact under realistic conditions
MediumDefensive coding gap or latent bug, no direct exploit
LowStyle 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 a3f9c12 on branch feature/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.md

Multiple 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