Skip to content
Back to search

rewin0087

MarketplaceWorks with Claude CodeGitHub

Claude Code plugins by rewin0087

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rewin0087--claude-code-review/badge.svg)](/listings/rewin0087--claude-code-review)

HTML

<a href="/listings/rewin0087--claude-code-review"><img src="/api/listings/rewin0087--claude-code-review/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

As a Claude Code plugin (recommended)

In Claude Code (2.1.275 or later):

/plugin install branch-review --marketplace rewin0087/claude-code-review

Or in two steps, which works on any version with plugins:

/plugin marketplace add rewin0087/claude-code-review
/plugin install branch-review@rewin0087

From a shell: `claude plugin marketplace add rewin0087/claude-code-review && claude plugin install branch-review@rewin0087`.

Claude Code namespaces plugin commands, so you run the plugin as **`/branch-review:branch-review`**. Update it with `claude plugin update branch-review@rewin0087`.

As a standalone skill (plain `/branch-review`)

If you'd rather type `/branch-review`, clone it as a skill. For every project:

git clone https://github.com/rewin0087/claude-code-review.git ~/.claude/skills/branch-review

Or for one folder only (available when you start `claude` in that folder):

git clone https://github.com/rewin0087/claude-code-review.git <folder>/.claude/skills/branch-review

Update with `git -C ~/.claude/skills/branch-review pull`.

> Claude Code looks for project skills from the folder where you start it up to that repo's root. If the skill is in a parent folder that holds several repos, start `claude` in the parent folder and pass the repo name (see below), or install it globally.

**Requirements:** Claude Code, `git`, and Python 3.8+ (standard library only). Tested on macOS. Linux should work, and reports are welcome.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 24 lines
  1. {
  2. "name": "rewin0087",
  3. "owner": {
  4. "name": "rewin0087",
  5. "url": "https://github.com/rewin0087"
  6. },
  7. "description": "Claude Code plugins by rewin0087",
  8. "plugins": [
  9. {
  10. "name": "branch-review",
  11. "source": "./",
  12. "description": "AI code review of your branch's changes with an interactive HTML report.",
  13. "version": "2.0.0",
  14. "category": "development",
  15. "keywords": [
  16. "code-review",
  17. "branch-review",
  18. "ai-code-review",
  19. "pull-request",
  20. "git"
  21. ]
  22. }
  23. ]
  24. }
README.md · README · 364 lines
  1. # claude-code-review: AI code review for Claude Code
  2. [![Claude Code plugin](https://img.shields.io/badge/Claude%20Code-plugin-7c5cff)](https://github.com/rewin0087/claude-code-review#install)
  3. [![Version](https://img.shields.io/github/v/release/rewin0087/claude-code-review?sort=semver)](https://github.com/rewin0087/claude-code-review/releases)
  4. [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
  5. [![Website](https://img.shields.io/badge/docs-website-blue)](https://rewin0087.github.io/claude-code-review/)
  6. **`/branch-review` is an AI code review skill and plugin for [Claude Code](https://claude.com/claude-code).** It reviews **only the changes your git branch introduces**, or just the file, lines or editor selection you point it at, in **any tech stack**. It checks the code against **your requirements** (a ticket, spec, mockup, link or a few lines of text), validates the approach and business logic, finds **existing code to reuse**, runs **security and dependency scanners**, analyses **performance and memory** (with optional benchmarks), suggests better alternatives **backed by web references**, uses **git history** to see why existing code was written that way, and lists the **impact and caveats** of the change. It opens an **interactive HTML report** with every review comment shown on the diff line.
  7. It runs on your existing Claude Code session, in the terminal, VS Code or JetBrains. You don't need an API key, server or CI setup.
  8. ![The interactive code review report: a diff with inline AI review comments, severity badges and suggested fixes](docs/images/report-diff.png)
  9. ## Features
  10. - **Branch-only diff**: compares against the merge-base, so commits that landed on `main` after you branched are excluded. The base branch (`main`, `master`, `develop`, …) is detected automatically.
  11. - **Review a file, a line range or your editor selection**: highlight code in VS Code and run `/branch-review`, or pass `src/app.py:40-80`, folders or globs. Unchanged code is reviewed as it is.
  12. - **Any stack**: detects languages, frameworks and versions from the files and manifests, and fits its advice to the versions you use.
  13. - **Review against requirements**: pass a ticket, spec, PDF, Word doc, mockup image, link or plain text with `--req` (or after ` -- `). It turns them into a numbered checklist and marks each item met, partial, missing or contradicted, with evidence lines. It also checks that the mandated tools, APIs and data formats are used, and used correctly.
  14. - **Reuse and DRY**: searches the codebase for existing helpers, services and components that the change duplicates, and points to the code to reuse or extend.
  15. - **Automated checks**: a built-in secret detector, plus semgrep, bandit, npm audit and pip-audit when installed. Findings on the changed lines are separated from pre-existing ones, and secrets are redacted.
  16. - **Performance and memory**: static analysis of hot paths and a per-stack memory-leak checklist. When it matters, or with `--bench`, a throwaway benchmark runs in the output folder, never in your repo.
  17. - **Impact and caveats**: breaking changes, caveats, things to consider, affected areas and a rollout plan.
  18. - **Approach validation**: infers what the change is trying to do and rates the approach (sound / acceptable / questionable / flawed). It proposes alternative approaches with pros and cons and marks one as recommended.
  19. - **Reasoned comments**: each comment has a severity, category, confidence, a concrete failure scenario, its reasoning, a suggested fix with code, and alternatives.
  20. - **Web references**: every critical or major finding cites official docs, OWASP/CWE, RFCs or well-known open-source code. It may only cite links it actually opened, and its searches never include your code.
  21. - **Git history ("why is it like this?")**: blames the lines your branch removes or rewrites and finds the commits that introduced them. It flags past fixes, reverts and workarounds, and warns when a change could bring an old bug back. Every cited commit SHA is checked against the repo.
  22. - **Interactive report**: unified or side-by-side diff with inline comments, a file/comment sidebar, severity filters, search, resolve/viewed tracking, an "Open in VS Code" link, commit links to GitHub/GitLab, keyboard navigation, dark mode, and "Copy as Markdown" for PR descriptions.
  23. - **Results in the chat**: the verdict, the approach rating and a table of every finding, with a link to the report.
  24. - **Large diffs**: split across parallel sub-agents.
  25. ## How it compares
  26. Claude Code has its own **built-in `/code-review`**, and Anthropic's plugin marketplace has an official
  27. **`code-review` plugin**. This skill used to be called `/code-review` too, which hid the built-in one,
  28. so since 2.0.0 it's **`/branch-review`**. They work well side by side:
  29. | | Built-in `/code-review` | Official `code-review` plugin | **`/branch-review`** (this repo) |
  30. |---|---|---|---|
  31. | Install | ships with Claude Code | `claude-plugins-official` marketplace | plugin or skill from this repo |
  32. | What it reviews | current diff, a PR, a branch or a path | a GitHub pull request | the branch's own changes (merge-base), or a file, range or editor selection, including unchanged code as-is |
  33. | Focus | correctness bugs, plus reuse / simplification / efficiency cleanups | bugs, CLAUDE.md compliance, git-blame context | bugs, design and approach, requirements, reuse/DRY, security, performance and memory, tests, impact |
  34. | Depth control | effort levels `low` → `max`, `--max-findings` | fixed: 4 parallel agents | `--focus`, `--history`, `--bench`; large diffs split across sub-agents |
  35. | Noise filtering | effort level / max findings | confidence score, only ≥ 80 reported | severity levels (critical → nitpick, plus praise), and a confidence on each comment |
  36. | Requirements / ticket check | — | CLAUDE.md rules | `--req` tickets, specs, PDFs, mockups and links → met / partial / missing checklist |
  37. | Approach and alternatives | — | — | approach rating, plus alternatives with pros and cons |
  38. | Web references | — | — | required for critical / major findings (docs, OWASP / CWE, RFCs) |
  39. | Git history | — | blame-based agent | blame, `log -L` / `-S`, past fixes and reverts, cited SHAs verified |
  40. | Scanners | — | — | secret detector, plus semgrep, bandit, npm audit and pip-audit when installed |
  41. | Output | findings in the chat | terminal, or a PR comment | chat summary **plus an interactive HTML report** (diff, inline comments, filters, resolve tracking, Copy MD) |
  42. | Acts on findings | `--fix` applies them, `--comment` posts inline PR comments | `--comment` posts a PR comment | none: you fix, then copy the Markdown into your PR |
  43. | Cloud | `ultra`: a multi-agent review in the cloud (billed) | — | — (runs in your session) |
  44. A good combination: run **`/branch-review`** while you build, against the ticket, with the HTML report
  45. to work through. Then run the built-in **`/code-review`** (or `/code-review ultra`) on the PR for a
  46. second, independent pass that can post comments or apply fixes.
  47. ## Install
  48. ### As a Claude Code plugin (recommended)
  49. In Claude Code (2.1.275 or later):
  50. ```text
  51. /plugin install branch-review --marketplace rewin0087/claude-code-review
  52. ```
  53. Or in two steps, which works on any version with plugins:
  54. ```text
  55. /plugin marketplace add rewin0087/claude-code-review
  56. /plugin install branch-review@rewin0087
  57. ```
  58. From a shell: `claude plugin marketplace add rewin0087/claude-code-review && claude plugin install branch-review@rewin0087`.
  59. Claude Code namespaces plugin commands, so you run the plugin as **`/branch-review:branch-review`**. Update it with `claude plugin update branch-review@rewin0087`.
  60. ### As a standalone skill (plain `/branch-review`)
  61. If you'd rather type `/branch-review`, clone it as a skill. For every project:
  62. ```bash
  63. git clone https://github.com/rewin0087/claude-code-review.git ~/.claude/skills/branch-review
  64. ```
  65. Or for one folder only (available when you start `claude` in that folder):
  66. ```bash
  67. git clone https://github.com/rewin0087/claude-code-review.git <folder>/.claude/skills/branch-review
  68. ```
  69. Update with `git -C ~/.claude/skills/branch-review pull`.
  70. > Claude Code looks for project skills from the folder where you start it up to that repo's root. If the skill is in a parent folder that holds several repos, start `claude` in the parent folder and pass the repo name (see below), or install it globally.
  71. **Requirements:** Claude Code, `git`, and Python 3.8+ (standard library only). Tested on macOS. Linux should work, and reports are welcome.
  72. ## Usage
  73. Inside Claude Code. These examples use `/branch-review`; if you installed the plugin, type `/branch-review:branch-review` instead:
  74. ```text
  75. /branch-review # review the checked-out branch against its base
  76. /branch-review my-repo # review a repo inside the current folder
  77. /branch-review my-repo --head feat/login # review another branch without checking it out
  78. /branch-review develop # set the base branch yourself
  79. /branch-review --uncommitted # include staged and unstaged changes
  80. /branch-review --history # deep git-history investigation
  81. /branch-review --focus security # put more weight on one area
  82. /branch-review --bench # benchmark performance-sensitive changes
  83. /branch-review --no-scan # skip the automated scanners
  84. /branch-review --no-open # don't open the browser
  85. ```
  86. You can also ask in plain words, e.g. *"review this with history"*.
  87. ### Review against requirements, tickets and docs
  88. ```text
  89. /branch-review --req docs/INV-142.md # a spec or ticket export (md, txt, pdf, docx…)
  90. /branch-review --req mockups/checkout.png --req specs/api.pdf
  91. /branch-review --req https://github.com/org/repo/issues/42 # a link (fetched; private pages may need pasting)
  92. /branch-review -- Amounts must be in cents. Use the pdf-service API, not wkhtmltopdf.
  93. ```
  94. You can also paste a screenshot or ticket text into the chat and then run `/branch-review`. It uses those too. The report then shows a **Requirements** table with each item's status and evidence, plus the sources you gave.
  95. ### Review specific files, lines or the editor selection
  96. ```text
  97. /branch-review src/billing/charge.ts # one file
  98. /branch-review src/billing/charge.ts:40-80 # a line range (also :40 or #L40-L80)
  99. /branch-review src/billing/ 'src/**/*.sql' # folders and globs
  100. /branch-review @src/app.py # Claude Code @-mentions work too
  101. /branch-review --selection # the code highlighted in VS Code / JetBrains
  102. /branch-review --file # the file open in the editor
  103. /branch-review --all # ignore the editor; review the whole branch
  104. ```
  105. - In the IDE, **highlighted code is used automatically**: highlight lines, run `/branch-review`, and only that selection is reviewed. An open file with nothing highlighted is ignored unless you pass `--file` or say "review this file".
  106. - If the branch changed code inside the scope, those changes are reviewed. If it didn't (or you're on `main`), the **current code is reviewed as-is**. Mixed scopes do both, file by file. `--changes-only` / `--as-is` force one mode.
  107. - Scoped reviews include uncommitted edits, so line numbers match your editor. Each scope gets its own report folder, so it doesn't overwrite the full-branch report.
  108. When the review finishes, Claude posts a summary in the chat (terminal or VS Code): the verdict, the approach rating, the recommended alternative, history notes, a table of **every** finding with `file:line`, and a link to the full interactive report. The same summary is saved as `summary.md`.
  109. The report is written to `<repo>/.branch-review/<branch>/report.html`. That folder is added to the repo's local `.git/info/exclude`, so it never gets committed.
  110. ### Report keyboard shortcuts
  111. | Key | Action |
  112. |---|---|
  113. | `j` / `k` | next / previous comment |
  114. | `n` / `p` | next / previous file |
  115. | `r` | resolve / reopen the focused comment |
  116. | `x` | collapse / expand the focused comment |
  117. | `s` | toggle unified / split view |
  118. | `e` | collapse / expand all files |
  119. | `o` | jump to the overview |
  120. | `/` | filter |
  121. | `t` | toggle theme |
  122. | `?` | help |
  123. ## How it works
  124. ### Workflow: from input to outcome
  125. ```mermaid
  126. flowchart TD
  127. subgraph IN["1 - Input"]
  128. A1["Run /branch-review<br/>whole branch"]
  129. A2["Paths and ranges<br/>src/app.py:40-80, src/, globs"]
  130. A3["Editor selection or open file<br/>VS Code, JetBrains"]
  131. A4["Flags<br/>--head, --base, --history, --focus"]
  132. A5["Requirements<br/>--req files, images, links, text"]
  133. end
  134. subgraph COLLECT["2 - Collect: deterministic scripts"]
  135. B1["Resolve scope<br/>paths, then selection, then whole branch"]
  136. B2["Detect base branch<br/>main, master, develop ..."]
  137. B3["git diff merge-base..head<br/>only this branch's changes"]
  138. B4["Snapshot unchanged code<br/>to review it as-is"]
  139. B5[("diff.json + meta.json")]
  140. B6["context.py<br/>collect the requirement sources"]
  141. B7["scan.py<br/>secrets, semgrep, bandit,<br/>npm audit, pip-audit"]
  142. end
  143. subgraph AI["3 - AI review: Claude Code"]
  144. C1["Understand the change<br/>full files, callers, tests,<br/>stack and versions"]
  145. C8["Parallel subagents<br/>one per file group"]
  146. C2{"Existing code changed<br/>or --history?"}
  147. C3["Git history<br/>blame, log -L, log -S<br/>why the code exists"]
  148. C9["Requirements checklist<br/>R1, R2 ... from the sources"]
  149. C4["Review checklist<br/>requirements, business logic,<br/>reuse / DRY, security, memory,<br/>performance, design, tests"]
  150. C10["Benchmarks when needed<br/>throwaway, in the output folder"]
  151. C5["Validate the approach<br/>rate it, propose alternatives,<br/>impact and caveats"]
  152. C6["Web research<br/>official docs, OWASP / CWE,<br/>RFCs, open-source code"]
  153. C7[("review.json")]
  154. end
  155. subgraph RENDER["4 - Validate and render"]
  156. D1{"Anchors and cited<br/>commit SHAs valid?"}
  157. D2["report.html<br/>interactive diff + review"]
  158. D3["summary.md<br/>posted in the chat"]
  159. end
  160. subgraph OUT["5 - Outcome"]
  161. E1["Verdict<br/>requirements coverage,<br/>impact and caveats"]
  162. E2["Inline findings<br/>fix, reasoning, alternatives,<br/>references, history"]
  163. E3["You act<br/>fix code, resolve comments,<br/>Open in VS Code, Copy MD to the PR"]
  164. end
  165. A1 & A2 & A3 & A4 --> B1
  166. A5 --> B6 --> C9 --> C4
  167. B5 --> B7 --> C4
  168. C4 -. perf-sensitive .-> C10 -.-> C5
  169. B1 --> B2 --> B3 --> B5
  170. B1 --> B4 --> B5
  171. B5 --> C1
  172. C1 -. large diff .-> C8 -.-> C4
  173. C1 --> C2
  174. C2 -- yes --> C3 --> C4
  175. C2 -- no --> C4
  176. C4 --> C5 --> C6 --> C7
  177. C7 --> D1
  178. D1 -- no: fix review.json --> C7
  179. D1 -- yes --> D2 & D3
  180. D3 --> E1
  181. D2 --> E2
  182. E1 & E2 --> E3
  183. ```
  184. | Stage | Who does it | Output |
  185. |---|---|---|
  186. | **1. Input** | You: a command, paths, an editor selection, flags | what to review |
  187. | **2. Collect** | `collect_diff.py`, `context.py`, `scan.py`: deterministic, no AI | `diff.json`, `context.json`, `scan.json` |
  188. | **3. AI review** | Claude Code, guided by `SKILL.md` | `review.json` |
  189. | **4. Validate and render** | `render.py`: checks every line anchor and commit SHA | `report.html`, `summary.md` |
  190. | **5. Outcome** | You, in the chat and the browser | fixes, resolved comments, PR notes |
  191. The scripts handle the exact parts: which lines changed, line numbers, SHAs, rendering. Claude does the judgement: bugs, design, alternatives, research. Because `render.py` rejects anything that doesn't match the real diff or git history, the report can't point at lines or commits that don't exist.
  192. ### Step by step
  193. ```mermaid
  194. sequenceDiagram
  195. actor You
  196. participant CC as Claude Code
  197. participant S as Scripts
  198. participant G as Git
  199. participant W as Web
  200. participant R as HTML report
  201. You->>CC: /branch-review [paths] [flags], or highlight code first
  202. CC->>S: collect_diff.py
  203. S->>G: merge-base, diff, ls-files
  204. G-->>S: branch changes or current code
  205. S-->>CC: diff.json and an overview
  206. opt requirements given with --req, after --, or pasted
  207. CC->>S: context.py
  208. S-->>CC: ticket and spec text, images and links to open
  209. end
  210. CC->>S: scan.py
  211. S-->>CC: secrets and scanner findings on the change
  212. CC->>G: read changed files, callers and tests, search for reusable code
  213. opt existing code changed, or --history
  214. CC->>S: history.py
  215. S->>G: blame and log at the merge-base
  216. S-->>CC: who changed it, when and why
  217. end
  218. CC->>W: search docs, OWASP, open-source projects
  219. W-->>CC: references
  220. CC->>CC: requirements check, review, impact, write review.json
  221. CC->>S: render.py
  222. S-->>R: report.html
  223. S-->>CC: summary.md
  224. CC-->>You: verdict, findings table, link to the report
  225. You->>R: navigate, resolve, copy as Markdown
  226. ```
  227. ### The result
  228. You get two outputs: a summary in the chat (below), and the interactive report in your browser.
  229. ```text
  230. ## Code review: `feature/search` → `main` — **REQUEST CHANGES**
  231. Adds user search, but the query is SQL-injectable and the client doesn't encode input.
  232. 2 files, +13 / -0 · 1 commit(s) · 1 critical, 1 major, 1 minor, 1 suggestion, 1 praise
  233. **Approach — questionable:** String interpolation into SQL breaks the parameterised pattern ...
  234. **Recommended alternative:** Parameterised LIKE with escaped wildcards
  235. | # | Severity | Location | Issue | Suggested fix |
  236. | 1 | critical | users.py:11 | SQL injection in search_users | Use a placeholder. |
  237. | 2 | major | app.js:2 | Query param not URL-encoded | see code in report |
  238. **Full interactive review**: report.html
  239. ```
  240. **Report layout**
  241. ```text
  242. +--------------------------------------------------------------------------------+
  243. | repo branch -> base [scope] +13 -0 [REQUEST CHANGES] Unified|Split Copy MD |
  244. +-----------------------+--------------------------------------------------------+
  245. | Filter files/comments | REVIEW SUMMARY headline, stack, severity counts, |
  246. | (o) Critical (o) Major| "must address" list |
  247. | [ ] Hide resolved | APPROACH rating, analysis, alternatives with |
  248. | ####---- 2/5 resolved | pros / cons / references |
  249. | [Files] [Comments] | HISTORY timeline of the commits behind it |
  250. | | ------------------------------------------------------ |
  251. | app.js (1) +4 -0 | app.js |
  252. | users.py (4) +9 -0 | 2 + const res = await fetch('/api/users?name=' + ... |
  253. | | +- MAJOR Query param not URL-encoded ----------+ |
  254. | | | problem, reasoning, suggested fix (copy), | |
  255. | | | alternatives, references, history | |
  256. | | | [Resolve] [Copy as Markdown] [Open in VS Code]| |
  257. | | +-----------------------------------------------+ |
  258. +-----------------------+--------------------------------------------------------+
  259. ```
  260. | Review summary and approach | Diff with inline review |
  261. |---|---|
  262. | ![Review summary, severity counts and approach assessment](docs/images/report-overview.png) | ![Diff with inline review comments and suggested fixes](docs/images/report-diff.png) |
  263. ### Files
  264. ```
  265. SKILL.md instructions Claude follows (method, scope, history, references, output)
  266. references/review-schema.md the review.json format Claude writes
  267. templates/report.html the self-contained interactive report
  268. scripts/ thin command-line entry points
  269. collect_diff.py what to review -> diff.json / meta.json
  270. history.py git history digest -> history.json
  271. context.py requirement sources -> context/ + context.json
  272. scan.py secret detector + installed scanners -> scan.json
  273. render.py review.json -> report.html + summary.md
  274. scripts/codereview/ the logic (importable, raises ReviewError instead of exiting)
  275. gitcmd.py running git, resolving refs, repo housekeeping
  276. languages.py language detection, generated-file patterns
  277. diffparse.py unified diff -> files / hunks / lines
  278. branch.py base-branch detection
  279. scope.py file / range / glob scopes, "review as-is" snapshots
  280. collect.py ties the above together into the review input
  281. githistory.py blame / log analysis of the code under review
  282. context.py ingest tickets, specs, docs, images, links
  283. scan.py secret detection and scanner integrations
  284. review.py review.json validation, cited-commit checks
  285. summary.py the summary posted in the chat
  286. report.py HTML report generation
  287. ```
  288. Syntax highlighting loads highlight.js from cdnjs. Without internet the report still works, just without colours.
  289. ## Contributing
  290. Issues and pull requests are welcome. If `/branch-review` helped you catch a bug, a ⭐ on GitHub helps other developers find it.
  291. See [CHANGELOG.md](CHANGELOG.md) for release notes.
  292. ## License
  293. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.