code-review

An automated review of changed code, such as staged files or the difference between a branch and the main branch. It checks code quality, security, performance, and other common review concerns.

In plain words
What is it for?
Use it to review staged changes or a feature branch before opening or merging a pull request.
Why use it?
It helps find problems before code is merged, including unsafe input handling, exposed secrets, inefficient database use, and missing error handling.

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/alphaaiservice/cortex/code-review
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 32 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,052 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.00032 $0.01052
Opus 5 $0.00016 $0.00526
Sonnet 5 $0.00006 $0.00210
Haiku 4.5 $0.00003 $0.00105

Measured yesterday against content hash 3c36d01efe60, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-review 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 yesterday.

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.

commands/code-review.md · 131 lines

How it starts

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

Automated Code Review

You are a senior code reviewer performing a thorough review. Analyze: $ARGUMENTS

Step 1: Identify Changes

# If --staged or no args, review staged changes
git diff --cached --name-only 2>/dev/null || git diff --name-only HEAD~1

# If branch name provided, compare against main
git diff main...$ARGUMENTS --name-only 2>/dev/null

Read every changed file completely.

Step 2: Multi-Dimensional Review

Use Agent tool (mode = "bypassPermissions") to run 5 parallel review agents:

Agent 1: Code Quality

  • Clean code principles (SRP, DRY, KISS)
  • Function/method length and complexity
  • Naming conventions consistency
  • Magic numbers and hardcoded values
  • Dead code or unused imports
  • Proper error handling
  • Resource cleanup (connections, file handles)

Agent 2: Security Analysis

  • SQL injection vectors
  • XSS vulnerabilities
  • Authentication/authorization gaps
  • Sensitive data exposure (API keys, passwords)
  • Input validation completeness
  • CORS configuration
  • Dependency vulnerabilities (check package versions)

Agent 3: Performance Review

  • N+1 query patterns
  • Missing database indexes (if schema changes)
  • Unnecessary re-renders (React)
  • Memory leaks (event listeners, subscriptions)
  • Unbounded data fetching
  • Missing pagination
  • Caching opportunities

Agent 4: Testing Assessment

  • Test coverage for new code
  • Edge case coverage
  • Mock appropriateness
  • Test isolation
  • Missing negative test cases
  • Integration test gaps

Agent 5: Architecture & Standards

  • Consistent with existing patterns
  • CLAUDE.md / STANDARDS.md compliance
  • API contract changes (breaking changes?)
  • Proper abstraction layers
  • Dependency direction (no circular deps)
  • Documentation updates needed

Agent Teams Review Mode (When Enabled)

When CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set, upgrade to Agent Teams review mode where the 5 reviewers become real teammates who debate and challenge each other's findings.

Team Creation:

Read the full file on GitHub · 131 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. yesterday First seen · 131 lines · 32 tokens per session scan A 3c36d01efe60

Subscribe to this mod's changes

code-review is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 25d ago), licensed MIT. It adds 32 tokens to every session and 1,052 once invoked, about $0.0002 per session on Opus 5. 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-31.