Code.Review

Code.Review is a command for Claude Code, Cursor from redhat-community-ai-tools/UnifAI. It costs 0 tokens per session (671 once invoked), scanned A, original, Apache-2.0.

A detailed checklist and task definition for reviewing source code on a target branch. It examines duplication, unused code, abstractions, architecture, maintainability, and performance.

In plain words
What is it for?
Use it for deep code reviews that identify duplicated validation or mapping, dead code, repeated business rules, unnecessary abstractions, and specific refactoring opportunities.
Why use it?
It helps reviewers find concrete structural problems instead of giving vague advice. It requires repeated logic and inefficient code to be located, explained, and assigned a severity.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md).

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/redhat-community-ai-tools/unifai/code.review
Clone the repo
git clone --depth 1 https://github.com/redhat-community-ai-tools/UnifAI

Made for: Claude Code, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Code.Review

README.md
[![agentmods](https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/code.review.svg)](https://agentmods.dev/commands/redhat-community-ai-tools/unifai/code.review)
Your own site
<a href="https://agentmods.dev/commands/redhat-community-ai-tools/unifai/code.review"><img src="https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/code.review.svg" alt="Measured on agentmods" height="20"></a>
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 671 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.1 $0.00000 $0.00671
Opus 5 $0.00000 $0.00336
Sonnet 5 $0.00000 $0.00134
Haiku 4.5 $0.00000 $0.00067

Measured 6d ago against content hash f4f3bff3989c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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.

.cursor/commands/Code.Review.md · 142 lines

What it actually says

Your task is to perform a deep, non-superficial code review on the target branch.

You must focus on: Code duplication Dead / unused code Reusability opportunities Smart abstraction usage Over-engineering Clean architecture alignment Maintainability and efficiency You are NOT allowed to provide generic comments.

🎯 Primary Review Goals

Detect duplicated logic (explicit or subtle) Detect dead / unreachable / unused code Detect similar implementations that should be unified Identify opportunities to reuse existing utilities or services Detect unnecessary abstractions Detect performance inefficiencies Validate consistency with project patterns

🔍 Duplication Detection (STRICT)

You MUST check for: Repeated validation logic Repeated mapping logic Repeated error handling blocks Repeated logging patterns Similar helper methods implemented in multiple places Copy-paste logic with small variations Duplicate business rules across services For each duplication: Show where it appears Explain why it is duplication Suggest how to refactor (reuse existing component or extract shared logic) Mark severity: MAJOR → duplicated business logic MINOR → duplicated structural or helper code

🧟 Dead Code Detection (STRICT)

You MUST detect: Unused imports Unused variables Unused parameters Unused functions Unused classes Commented-out legacy code Unreachable branches Always-true / always-false conditions Redundant null checks Deprecated code not used anymore For each issue: Explain why it is dead or redundant Recommend safe removal strategy Mark severity: MAJOR → unused logic that affects clarity MINOR → cosmetic cleanup

♻️ Reusability & Smart Design Check

Before suggesting new abstractions, you MUST: Check if similar logic already exists Check if existing utilities can be reused Check if existing base classes or services can be leveraged Check if shared mappers already exist Check if common error handling mechanism is already implemented If new logic duplicates existing patterns → mark as ALIGNMENT ISSUE If reusable logic exists but is not used → mark as MAJOR

🧠 Architecture Awareness

While reviewing, ensure: No business logic in controllers No business logic in repositories No cross-layer leakage Clear separation of responsibilities SRP respected No tight coupling introduced Flag architectural side effects if found.

🚫 Forbidden Review Behavior

Do NOT give generic suggestions like “improve readability” Do NOT suggest rewriting everything Do NOT recommend adding abstractions unless justified Do NOT approve if major duplication exists Do NOT ignore subtle duplication patterns Every claim must be justified.

📊 Required Output Format 1️⃣ Code Duplication Issues

Location Description Severity Refactor recommendation

2️⃣ Dead Code Issues

Location Why it is dead/unnecessary Severity Removal recommendation

3️⃣ Reusability Improvements

Existing reusable component found

Where it should be used Why it improves maintainability

4️⃣ Efficiency & Clean Code Concerns

Issue Risk Suggested improvement

5️⃣ Overall Code Health Score (0–10) Explain reasoning.

6️⃣ Final Verdict CLEAN NEEDS REFACTORING MAJOR CLEANUP REQUIRED Explain clearly.

🎯 Review Mindset

You are reviewing production-grade code. Optimize for: Maintainability Reusability Clarity Scalability Long-term sustainability

Be strict. Be precise. Be constructive. Be architectural.

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. 6d ago First seen · 142 lines · 0 tokens per session scan A f4f3bff3989c

Subscribe to this mod's changes

Code.Review is a command published in the GitHub repository redhat-community-ai-tools/UnifAI (44 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 671 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.