review-code

A command that coordinates specialist agents to inspect source code and report problems, quality concerns, and possible improvements. A code review is a check of code before it is accepted or released.

In plain words
What is it for?
It helps review staged changes, unstaged changes, recent commits, selected files, or pull-request changes, grouped by programming language.
Why use it?
It helps find bugs and maintenance issues across changed files without relying on one general review.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mgonzalezbaile/claudex/review-code
Clone the repo
git clone --depth 1 https://github.com/mgonzalezbaile/claudex
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01324
Opus 5 $0.00000 $0.00662
Sonnet 5 $0.00000 $0.00265
Haiku 4.5 $0.00000 $0.00132

Measured 2d ago against content hash b732d6b1d499, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

review-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/profiles/commands/review-code.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Review Code Command

Perform comprehensive code review by orchestrating specialist agents. This command analyzes code quality, identifies bugs, suggests improvements, and provides actionable feedback through parallel delegation to language-specific experts.

Step 1: Gather Context

Run git commands to identify what files need review:

# Check git status for staged and unstaged changes
git status --short

# Show staged changes with stats
git diff --cached --stat

# Show unstaged changes with stats
git diff --stat

# Show recent commits on current branch
git log --oneline -10

# Show changes in last commit
git diff HEAD~1 --stat

Step 2: Clarify Scope

If the scope is ambiguous, ask the user to specify:

Questions to ask:

  • Review staged changes?
  • Review specific files or directories?
  • Review recent commits (how many)?
  • Review all uncommitted changes?
  • Review specific pull request changes?

If the scope is clear from context (e.g., user said "review my staged changes"), proceed automatically.

Step 3: Classify Files by Language

Group the files to review by their primary language/technology:

File Extension Mapping:

  • .ts, .tsx, .js, .jsx, .mjs, .cjsprincipal-engineer-typescript
  • .goprincipal-engineer-go
  • .pyprincipal-engineer-python
  • Prompt files (.md in src/profiles/, agent profiles, commands, tasks) → prompt-engineer
  • Other extensions → principal-engineer (generic fallback)

Step 4: Delegate to Specialist Agents

For each language group, spawn the appropriate specialist agent using the Task tool with this standardized review task:

## Code Review Task

**Files to Review:**
- [list of file paths for this language]

**Review Criteria:**

Analyze the code changes and provide feedback in these categories:

1. **Critical Issues** 🔴 - Must fix before merging
   - Bugs, logic errors, edge case failures
   - Security vulnerabilities
   - Breaking changes or regressions

2. **Important Improvements** 🟡 - Should address
   - Code quality and readability issues
   - Performance concerns
   - Maintainability problems
   - Missing error handling

3. **Minor Suggestions** 🟢 - Optional improvements
   - Style and formatting
   - Documentation enhancements
   - Minor optimizations

4. **Positive Highlights** ✅ - What was done well
   - Good patterns and practices
   - Clever solutions
   - Excellent test coverage

**Output Format:**

Use this exact structure:

```markdown

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 223 lines · 0 tokens per session scan A b732d6b1d499

Subscribe to this mod's changes

review-code is a command published in the GitHub repository mgonzalezbaile/claudex (23 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,324 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.