code-review

An automated review of changed code or individual files for bugs, security problems, style issues, and possible improvements.

In plain words
What is it for?
Use it to review local code changes or GitHub pull requests and produce findings about correctness, security, and maintainability.
Why use it?
It helps catch problems before code is merged or released, including issues that may be easy to miss during a manual review.

Skill for Claude CodeCodex

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 skills/initializ/forge/code-review
Any agent
npx skills add initializ/forge --skill code-review
Clone the repo
git clone --depth 1 https://github.com/initializ/forge

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00017 $0.03058
Opus 5 $0.00009 $0.01529
Sonnet 5 $0.00003 $0.00612
Haiku 4.5 $0.00002 $0.00306

Measured yesterday against content hash a6ab4f738025, 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 1 finding 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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/code-review-diff.sh, scripts/code-review-file.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- curl
forge-skills/local/embedded/code-review/SKILL.md · 249 lines

How it starts

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

Code Review Skill

AI-powered code review that analyzes diffs and individual files for bugs, security issues, style violations, and improvement opportunities. Supports both local git diffs and GitHub pull requests.

Authentication

Set at least one LLM API key:

# Option A: Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."

# Option B: OpenAI or any OpenAI-compatible provider (Together, OpenRouter, Groq, ...)
export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.together.ai/v1"   # only when not using openai.com

# Optional: override the model (defaults: claude-sonnet-4-20250514 / gpt-4o)
export REVIEW_MODEL="moonshotai/Kimi-K2.6"

# Optional: force a specific provider when both keys are set
export REVIEW_PROVIDER="openai"   # or "anthropic"

Provider selection (auto-detected when REVIEW_PROVIDER is unset):

  1. If REVIEW_PROVIDER is set, it wins.
  2. Else if REVIEW_MODEL starts with claude- or anthropic/, use Anthropic.
  3. Else if only one API key is set, use that provider.
  4. Else (both keys, no model hint): use OpenAI.

This precedence fixes the common deployment where both ANTHROPIC_API_KEY and OPENAI_API_KEY live in .forge/secrets.enc (one is stale or for a different skill). Pre-fix the skill always preferred Anthropic and returned 401 against the stale key.

For GitHub PR review, also set:

export GH_TOKEN="ghp_..."

The token needs read-only access:

Scope (classic PAT) Fine-grained permission Why
repo (or public_repo for public repos) Contents: Read Fetch PR diff and file contents

This skill only reads diffs — it never posts comments, applies labels, or merges. For write operations, see the code-review-github skill.

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY one-of Anthropic API key
OPENAI_API_KEY one-of OpenAI or OpenAI-compatible (Together, OpenRouter, Groq, ...) API key
REVIEW_PROVIDER no Explicit provider override: anthropic or openai. When unset, auto-detected from REVIEW_MODEL prefix, then by which key is set. Prefers openai when both keys exist and no model hint disambiguates
REVIEW_MODEL no Override LLM model name. Default: claude-sonnet-4-20250514 (anthropic) / gpt-5.4 (openai)
REVIEW_MAX_DIFF_BYTES no Max diff size before truncation (default: 100000)
GH_TOKEN no GitHub token for PR diffs — read-only access is sufficient
FORGE_REVIEW_STANDARDS_DIR no Path to .forge-review/standards/ directory for custom rules
OPENAI_BASE_URL no Base URL for OpenAI-compatible providers (default: https://api.openai.com/v1). Always uses /chat/completions — see OPENAI_USE_RESPONSES_API for the proprietary Responses API
OPENAI_USE_RESPONSES_API no Set to 1 to use OpenAI's proprietary /responses endpoint (Codex/OAuth flow). Default off. Only relevant when OPENAI_BASE_URL points at api.openai.com

Read the full file on GitHub · 249 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 249 lines · 17 tokens per session scan A a6ab4f738025

Subscribe to this mod's changes

code-review is a skill published in the GitHub repository initializ/forge (156 stars, last pushed 4d ago), licensed Apache-2.0. It adds 17 tokens to every session and 3,058 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.