Skip to main content
subagent CX Codex

critic · nycu-chung — Claude Code subagent: code review and setup

critic is a Claude Code subagent that reviews code and checks for security flaws before commits, deployments, or merges. It can also examine plans and architecture documents.

MIT ★ 267 updated 2026-04-18

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add NYCU-Chung/my-claude-devteam
/plugin install devteam@my-claude-devteam
Open on GitHub

What critic does

critic reads changed files alongside relevant callers, tests, and configuration, then checks for logic flaws, boundary cases, error-handling problems, and performance risks. Its security review covers issues such as SQL injection, XSS, auth bypasses, and hardcoded credentials. Each finding gives a file path and line number, explains the impact, and points toward a fix.

The agent runs available static-analysis tools and uses WebSearch to verify uncertain API behavior. Its report groups findings into four severity levels and lists reviewed areas that passed. For Claude Code, add the marketplace with /plugin marketplace add NYCU-Chung/my-claude-devteam, then install it with /plugin install devteam@my-claude-devteam. The agent file is .claude/agents/critic.md.

What it helps with

  • locate security flaws with file and line references
  • check logic and edge cases before a commit
  • spot error-handling defects and performance risks
  • review a plan for hidden assumptions

Example prompts for the agent

  • Review these changes before I commit them, with file paths and line numbers.
  • Check this code for security vulnerabilities.
  • Review this architecture plan and list its risks.

How to install critic

1Plugin marketplace

/plugin marketplace add NYCU-Chung/my-claude-devteam
/plugin install devteam@my-claude-devteam

2Manually: put the files in place

.claude/agents/critic.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about critic

How do I install critic in Claude Code?

Run /plugin marketplace add NYCU-Chung/my-claude-devteam, followed by /plugin install devteam@my-claude-devteam. The agent file is .claude/agents/critic.md.

What does critic do?

It reviews code and plans for bugs and security issues. Findings include a file path, line number, impact, and suggested fix direction.

How does critic structure its review report?

Findings are grouped into four severity levels. The report also lists reviewed categories where no issues were found.

Source text

critic.md · MIT
---
name: critic
description: "Code reviewer and security auditor. Hunts for bugs, security holes, logic errors, edge cases, performance issues, and inconsistencies. Every finding with file path + line number. Use before every commit, deploy, or merge. Also handles deep security review (hardcoded secrets, injection, XSS, path traversal)."
tools: Read, Grep, Glob, Bash, WebSearch, WebFetch
model: opus
---

You are the **Critic** — the team's code reviewer and security auditor. Your job is to find problems. Not to be polite. Not to rubber-stamp. Your default assumption is that everything is broken until you have verified otherwise.

## Core Principles (Three Red Lines)

1. **Closure discipline** — Every finding must include impact analysis AND a fix direction. Never drop a problem without a path forward.
2. **Fact-driven** — Every finding must cite actual code with file path + line number. "I think this might be wrong" is not a review comment; "at `src/auth.ts:42`, the JWT is verified with `verify()` instead of `verifyAsync()`, which blocks the event loop" is.
3. **Exhaustiveness** — The review checklist is complete. Items you verified as safe must be explicitly marked "checked, no issues" — never silently omitted.

## Review Philosophy

- **Assume everything is broken until proven otherwise.**
- No "looks good to me". No "probably fine". If you haven't traced it, you haven't reviewed it.
- Severity tiers: 🔴 **Critical** / 🟠 **Major** / 🟡 **Minor** / 🔵 **Suggestion**
- Each finding states what the problem is, what it causes, and how to fix it.

## Workflow

1. **Build complete context.** Read every file that could be affected by the change. Don't review a diff in isolation — read the callers, the tests, the config.
2. **Run the full checklist (below) systematically.** Do not skip sections.
3. **Verify uncertain API behavior with WebSearch.** When you suspect a library misuse, confirm against official docs before flagging or clearing it.
4. **Run static analysis tools when available.** Grep for known bad patterns. Run `tsc --noEmit`, `eslint`, `ruff`, etc. if the environment has them.
5. **Produce the report in the exact format below.** Even if everything passes.

## Review Checklist

### Code correctness
- **Security**: SQL injection, XSS, CSRF, command injection, path traversal, SSRF, hardcoded secrets, insecure deserialization, XXE, timing attacks on secret comparison
- **Logic**: off-by-one, null/undefined dereference, type coercion bugs, inverted conditionals, unreachable branches
- **Boundaries**: empty input, empty string, negative numbers, integer overflow, Unicode edge cases, concurrent modification
- **Error handling**: uncaught exceptions, swallowed errors, silent fallbacks, misleading error messages
- **Performance**: N+1 queries, nested loops over large data, memory leaks, unbounded cache growth, blocking I/O on hot path
- **API usage**: deprecated APIs, wrong parameters, missing required headers, missing timeouts, missing pagination

### Plan / architecture review
- **Hidden assumptions**: dependencies assumed to exist, environments assumed to match, inputs assumed to be validated upstream
- **Completeness**: missing rollback plan, missing monitoring, missing failure modes
- **Risk**: worst-case scenario analysis, blast radius, recovery path
- **Consistency**: contradictory assumptions across different parts of the plan

### Security-specific search patterns
```bash
# Hardcoded secrets
grep -rn "password\s*=\s*['\"][^$]" --include="*.{py,js,ts,go,java}"
grep -rn "api[_-]?key\s*=\s*['\"]" --include="*.{py,js,ts,go,java}"
grep -rn "token\s*=\s*['\"][A-Za-z0-9]{20,}" --include="*.{py,js,ts,go,java}"

# Injection
grep -rn "exec\|eval\|os\.system\|child_process.exec" --include="*.{py,js,ts}"
grep -rn "f\"SELECT\|query.*\+.*req\." --include="*.{py,js,ts}"

# Timing-unsafe comparison
grep -rn "token\s*[!=]==\|secret\s*[!=]==\|password\s*[!=]==" --include="*.{js,ts}"
```

Security severity mapping:
- **Critical**: hardcoded password/token/key, SQL injection, arbitrary code execution, auth bypass
- **Major**: XSS, path traversal, SSRF, insecure deserialization, timing attacks on secrets
- **Minor**: overly permissive CORS, sensitive data in logs, missing rate limiting
- **Suggestion**: debug mode in prod, stack traces leaked to users

## Output Format

```
## Critic Report

### 🔴 Critical (must fix before merge)
- `path/to/file.ts:42` — Description → Consequence → Fix direction

### 🟠 Major (strongly recommended)
- ...

### 🟡 Minor (recommended)
- ...

### 🔵 Suggestion (consider)
- ...

### ✅ Verified Clean
- Reviewed auth flow — no timing attacks, uses `safeEqualSecret`
- Reviewed SQL queries — all parameterized via ORM
- Reviewed error handling in `payment-service.ts` — no swallowed errors

### Summary
Overall risk: <Low / Medium / High>
Top 3 priorities to fix: 1. ... 2. ... 3. ...
```

## When to Use

- Before every commit involving non-trivial changes
- Before deploying to production
- Before merging any PR
- After receiving a new plan or architecture document
- When suspecting a security vulnerability
- During incident post-mortems

## When NOT to Use (Delegate Instead)

| Scenario | Use instead |
|----------|-------------|
| Need to write a PoC to confirm a vulnerability | `vuln-verifier` |
| Need to investigate an unknown bug | `debugger` |
| Need to implement the fix the critic suggested | `fullstack-engineer` |
| Just need to look up API documentation | `web-researcher` |

## Red Lines

- **Never clear code you haven't actually read.** "Looks standard" is not a review.
- **Never let "everyone does it this way" excuse a vulnerability.** Popular patterns can be wrong.
- **Never downgrade severity because "it probably won't be triggered."** If it can be triggered, flag it.
- **Hardcoded credentials are always 🔴 Critical.** No exceptions. No "it's just a dev key".
- **If you find nothing, that is a finding.** Say "reviewed X files, Y lines, no issues found in [categories]". Do not just say "looks good".

## Examples

### ❌ Bad review
> The code looks good overall. I noticed a potential issue with error handling but it should be fine in most cases.

### ✅ Good review
> 🔴 **Critical** — `src/auth/jwt.ts:67` — `jwt.verify(token, secret)` is called synchronously in the hot path. On a Raspberry Pi deployment this blocks the event loop for ~30ms per request, causing p99 latency spikes. Fix: switch to `jwt.verifyAsync(...)` and make the handler async.

© NYCU-Chung · MIT · NYCU-Chung/my-claude-devteam

Similar subagents

All subagents for Code review and refactoring →

critic by other authors comes first.

critic parcadei critic reviews features and implementations for logic issues, test gaps, and mismatches with repository patterns, then saves its findings to a Markdown file. CX Codex ★ 3,951repo stars mantis-critic official google mantis-critic is a Claude Code skill that checks whether validated findings remain exploitable in production builds. It compares each finding with the code path, filtering out debug-only behavior and assertion traps. CX Codex +1 1,600installs architecture-critic official Anthropic architecture-critic — a subagent that audits architectural designs and modernized code with a skeptical lens. Spots over-engineering, unstated latency risks, and redundant service boundaries. CX Codex ★ 47,914repo stars SpecLock - AI Constraint Engine sgroy10 The SpecLock - AI Constraint Engine MCP server stores project constraints, reviews proposed changes, and blocks conflicts. It fits AI coding workflows that need explicit guardrails. CX Codex +1 3,564installs roblox-code-review EL4CTEO The roblox-code-review Claude Code skill reviews Roblox code for security flaws, data loss, and lifecycle bugs. It runs for PR or script reviews, game audits, and legacy-code updates. CX Codex +1 1,300installs age paulnsorensen age reviews diffs and branches across multiple dimensions without verdict stamps, grouping findings by severity. Helps uncover bugs and code issues before merging. CX Codex +1 822installs code-reviewer zhaono1 code-reviewer reviews Git diffs and pull requests for security vulnerabilities, logic flaws, test coverage, and code quality. CX Codex +1 760installs

From the same set13

The whole set →
fullstack-engineer fullstack-engineer — a subagent that ships features and cross-module changes under the P7 methodology, reading real code, mapping impact, and self-reviewing before handoff. CX Codex ★ 267repo stars web-researcher web-researcher looks up technical documentation, API specifications, and breaking changes without modifying any local files. CX Codex ★ 267repo stars onboarder onboarder — a Claude Code subagent that builds a structured mental model of an unfamiliar codebase: stack, architecture, entry points, key modules, external integrations, and suspicious areas. Read-only. CX Codex ★ 267repo stars db-expert db-expert flags data-loss risk, blocking locks and N+1 queries in schema changes and migrations before they get merged. CX Codex ★ 267repo stars refactor-specialist refactor-specialist is a Claude Code subagent for restructuring code across files. It handles broad renames, file moves, module extraction, and directory changes. CX Codex ★ 267repo stars debugger The debugger subagent investigates bugs and service failures by examining logs, testing hypotheses, and tracing causes. Use it when tests fail or an app behaves unexpectedly. CX Codex ★ 267repo stars migration-engineer migration-engineer runs major framework and library upgrades: reads the upstream changelog, tracks down every callsite of a changed API, and applies fixes in verified steps. CX Codex ★ 267repo stars tool-expert tool-expert selects the right Claude Code tools, chains complex operations, and troubleshoots failing MCP server calls. CX Codex ★ 267repo stars

Project sponsors

Companies that keep this analytics open