Skip to main content
skill CX Codex official · Anthropic

code-review · anthropics — Claude Code skill: review code before you merge

The skill reviews diffs and pull requests for security, performance and correctness. Useful when a change needs a look before merging.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add anthropics/knowledge-work-plugins --skill code-review -a claude-code
Open on GitHub

What code-review does

code-review inspects code changes along four axes. Security covers SQL injection, XSS, CSRF, auth flaws, secrets in code, insecure deserialization, path traversal and SSRF. Performance looks for N+1 queries, unnecessary allocations, quadratic complexity in hot paths, missing indexes, unbounded queries and resource leaks. Correctness checks empty input, null, overflow, race conditions, error propagation and off-by-one errors. Maintainability covers naming, single responsibility, duplication and test coverage.

You invoke it as /code-review with a PR URL, a diff or a file path. Pass nothing and it asks what to review. The output is a markdown report: a short summary, a table of critical issues with file, line and severity, categorised suggestions, a section on what looks good, and a verdict — approve, request changes or needs discussion.

It works standalone: paste a diff or point at files and you get the full review. Connect source control and it pulls the PR diff itself and checks CI status. Connect a project tracker and findings get linked to tickets; connect a knowledge base and changes are checked against team coding standards. Without those connectors you handle those steps by hand.

What it helps with

  • check a pull request for injection risks and leaked secrets
  • spot N+1 queries in new code
  • catch race conditions and unhandled errors before merge
  • compare changes against team coding standards
  • get a list of fixes with code examples

Example prompts for the agent

  • Run /code-review on this diff before I merge
  • Review this PR URL with /code-review, focus on security
  • Use /code-review on src/api/orders.ts, check the error handling

How to install code-review

1Skills CLI (Vercel)

npx skills add anthropics/knowledge-work-plugins --skill code-review -a claude-code

2Manually: put the files in place

~/.claude/skills/code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about code-review

How do I install code-review in Claude Code?

Run npx skills add anthropics/knowledge-work-plugins --skill code-review -a claude-code. The skill lands at ~/.claude/skills/code-review/SKILL.md.

What does code-review do?

It reviews code changes for security, performance, correctness and maintainability, then returns a report with critical issues, suggestions and a verdict.

What do I need for it to pull the PR diff automatically?

A connected source control tool. With it, the skill fetches the diff from the URL and checks CI status. Otherwise paste the diff or file paths yourself.

Source text

SKILL.md · Apache-2.0
---
name: code-review
description: Review code changes for security, performance, and correctness. Trigger with a PR URL or diff, "review this before I merge", "is this code safe?", or when checking a change for N+1 queries, injection risks, missing edge cases, or error handling gaps.
argument-hint: "<PR URL, diff, or file path>"
---

# /code-review

> If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](../../CONNECTORS.md).

Review code changes with a structured lens on security, performance, correctness, and maintainability.

## Usage

```
/code-review <PR URL or file path>
```

Review the provided code changes: @$1

If no specific file or URL is provided, ask what to review.

## How It Works

```
┌─────────────────────────────────────────────────────────────────┐
│                      CODE REVIEW                                   │
├─────────────────────────────────────────────────────────────────┤
│  STANDALONE (always works)                                       │
│  ✓ Paste a diff, PR URL, or point to files                      │
│  ✓ Security audit (OWASP top 10, injection, auth)               │
│  ✓ Performance review (N+1, memory leaks, complexity)           │
│  ✓ Correctness (edge cases, error handling, race conditions)    │
│  ✓ Style (naming, structure, readability)                        │
│  ✓ Actionable suggestions with code examples                    │
├─────────────────────────────────────────────────────────────────┤
│  SUPERCHARGED (when you connect your tools)                      │
│  + Source control: Pull PR diff automatically                    │
│  + Project tracker: Link findings to tickets                     │
│  + Knowledge base: Check against team coding standards           │
└─────────────────────────────────────────────────────────────────┘
```

## Review Dimensions

### Security
- SQL injection, XSS, CSRF
- Authentication and authorization flaws
- Secrets or credentials in code
- Insecure deserialization
- Path traversal
- SSRF

### Performance
- N+1 queries
- Unnecessary memory allocations
- Algorithmic complexity (O(n²) in hot paths)
- Missing database indexes
- Unbounded queries or loops
- Resource leaks

### Correctness
- Edge cases (empty input, null, overflow)
- Race conditions and concurrency issues
- Error handling and propagation
- Off-by-one errors
- Type safety

### Maintainability
- Naming clarity
- Single responsibility
- Duplication
- Test coverage
- Documentation for non-obvious logic

## Output

```markdown
## Code Review: [PR title or file]

### Summary
[1-2 sentence overview of the changes and overall quality]

### Critical Issues
| # | File | Line | Issue | Severity |
|---|------|------|-------|----------|
| 1 | [file] | [line] | [description] | 🔴 Critical |

### Suggestions
| # | File | Line | Suggestion | Category |
|---|------|------|------------|----------|
| 1 | [file] | [line] | [description] | Performance |

### What Looks Good
- [Positive observations]

### Verdict
[Approve / Request Changes / Needs Discussion]
```

## If Connectors Available

If **~~source control** is connected:
- Pull the PR diff automatically from the URL
- Check CI status and test results

If **~~project tracker** is connected:
- Link findings to related tickets
- Verify the PR addresses the stated requirements

If **~~knowledge base** is connected:
- Check changes against team coding standards and style guides

## Tips

1. **Provide context** — "This is a hot path" or "This handles PII" helps me focus.
2. **Specify concerns** — "Focus on security" narrows the review.
3. **Include tests** — I'll check test coverage and quality too.

© anthropics · Apache-2.0 · anthropics/knowledge-work-plugins

Similar skills

Everything for Code review and refactoring →

code-review by other authors comes first.

code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. 789,521installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. CX Codex 30,193installs gesture-review official Aaron Powell The plugin lets you review pull requests through a live camera feed, approving or rejecting changes with thumbs-up or thumbs-down gestures. ★ 40,418repo stars threat-model-analyst official github Runs STRIDE-A threat modeling for a repository or system. It can also update an earlier report against the current code or a chosen commit. 1,500installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. 990,453installs codebase-design Matt Pocock This skill helps design modules with small interfaces and hidden complexity. Use it when refactoring code, choosing a seam, or making tests easier to write. 850,344installs

From the same set159

The whole set →
data-visualization Selects chart types based on data structure and produces Python visualization code in matplotlib, seaborn, and plotly. Useful for reports and research figures. CX Codex +1 13,800installs documentation A skill for technical writing that drafts READMEs, API references, runbooks, architecture docs and onboarding guides. Useful when the code exists but the description does not. CX Codex +1 10,300installs build-dashboard Builds a self-contained HTML dashboard with Chart.js charts, KPI cards, and filterable tables. Useful for turning raw data or queries into a standalone browser report. CX Codex +1 9,100installs system-design Walks you through designing services and systems: requirements, components, trade-offs. Useful when you need to decide how to split a service into parts. CX Codex +1 7,500installs memory-management This skill organizes workplace shorthand, names, and project details into files an agent can consult. It fits projects where requests rely on an internal vocabulary and shared context. CX Codex +1 7,400installs task-management Tracks commitments, active work, and follow-ups in a local TASKS.md file. Useful when managing project to-dos directly from the AI coding chat. CX Codex +1 7,200installs architecture Writes an Architecture Decision Record or reviews a system design: options, trade-offs, consequences. Useful when you have to pick between technologies. CX Codex +1 6,700installs tech-debt Sorts technical debt into categories and scores each item so you know what to fix first. Useful when the backlog feels endless. CX Codex +1 6,500installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor