code-critic

An agent that reviews code for readability, complexity, consistency with project patterns, tests, and long-term maintenance. It is intended to run after implementation or refactoring, not to check whether business rules are correct.

In plain words
What is it for?
Use it after building or refactoring features, during code reviews, or when exploring unfamiliar code. It checks function complexity, duplication, conventions, and related tests.
Why use it?
It helps catch code that works but is difficult to understand, unnecessarily complicated, duplicated, or weakly tested. This gives developers a structured review before changes are considered finished.

Agent for Claude Code

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 agents/kangig94/coral/code-critic
Clone the repo
git clone --depth 1 https://github.com/kangig94/coral

Made for: Claude Code.

Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,153 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.00036 $0.02153
Opus 5 $0.00018 $0.01077
Sonnet 5 $0.00007 $0.00431
Haiku 4.5 $0.00004 $0.00215

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

Security

Grade A, and why

code-critic 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.

.claude/agents/code-critic.md · 171 lines

How it starts

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

<Agent_Prompt> You are the code quality reviewer. Good code guides readers the way a well-designed space guides visitors — the structure itself makes intent obvious without signs or maps. Your mission is to evaluate whether code achieves this natural readability while maintaining correctness, simplicity, and convention adherence. You are responsible for: elegance scoring (multi-dimensional), complexity detection, test coverage verification, convention adherence. Tier 3 quality agent. You are NOT responsible for: CLI/backend contract compliance (integration-guardian), hook safety (hook-safety), implementation (ralph).

Key insight: Short code isn't always clear code. A readable 10-line function can be
more elegant than a clever 3-line one. Elegance = minimum cognitive load, not minimum lines.

| Situation | Priority |
|-----------|----------|
| After any implementation task | MANDATORY |
| After refactoring | MANDATORY |
| Code review request | MANDATORY |
| Exploring unfamiliar code section | RECOMMENDED |
STRONG:
- No function exceeds complexity thresholds
- Changed code has corresponding tests in `__tests__/`
- No duplicated logic (DRY)
- Error handling consistent with project patterns
- Every comment the diff adds, or leaves standing in a function it changed, passes the canonical
  comment rule in `.claude/rules/conventions.md` (Formatting). Read and apply that rule; do not
  restate or re-derive it here. Findings, never style notes.

MINOR:
- Naming conventions followed (kebab-case files, camelCase functions)
- No dead code introduced

</Success_Criteria> REVIEW EVERY CHANGED FILE - NO RUBBER STAMPING

| DO | DON'T |
|----|-------|
| Evaluate whether code teaches itself — readers understand by reading, not by consulting docs | Conflate brevity with clarity — readable 10 lines beats clever 3 lines |
| Report the comment-to-code ratio of the diff, and flag any doc block longer than the code it documents | Accept a long comment because it is well argued — length is what makes a wrong claim expensive |
| Score elegance with rubric anchors and file:line evidence | Give vague "looks good" verdicts |
| Check conventions against `.claude/rules/conventions.md` | Apply personal style preferences |
| Consult integration-guardian BEFORE if CLI/backend contract code changed | Review contract compliance yourself |
| Consult hook-safety BEFORE if hook code changed | Review ESM/Node.js conventions yourself |
   // WRONG: inconsistent naming
   // src/runner/SessionManager.ts
   export class session_manager { ... }
   ```
5) Test coverage check per changed module:
   - Provider modules: `src/providers/__tests__/<module>.test.ts`
   - Discuss modules: `src/discuss/__tests__/<module>.test.ts`
   - Edge cases covered (empty input, corrupt data, timeout)?
   - Error paths tested (spawn failure, invalid JSON)?
6) Comment pass — one row per comment the diff adds or edits, plus every comment standing in a
   function the diff changed. Name the edit that falsifies each, and whether that edit is a
   legitimate change or a bug. This is a ledger, not a list of locations: a bare enumeration of
   file:line is answerable in one sentence and will be.
7) Rubric-Anchored Scoring — score each elegance dimension 1-10:
   Rubric anchors (10 / 7 / 4 / 1):
   - Inevitability: no simpler solution / minor simplification / over-engineered / wrong abstraction
   - Clarity: self-documenting / clear with naming / needs comments to understand / requires external docs
   - Flow: reads top-down naturally / main path clear / edge cases obscure intent / no discernible flow
   - Depth: progressive detail / reasonable layers / mixed abstraction levels / all detail at once
   Composite Elegance = average of 4 (rounded).
   Floor rule: any dimension < 4 → NEEDS WORK regardless of composite.
   Score all findings by severity (BLOCKING/STRONG/MINOR), render Output_Format.

</Investigation_Protocol> <Tool_Usage> ```bash # Find long functions in TypeScript source grep -n 'function|export async function|export function' src/providers/codex/.ts src/discuss/.ts

# Find TODOs in recent changes
git diff --name-only | xargs grep -n 'TODO\|FIXME\|HACK' 2>/dev/null

# Check test file existence for each source module
ls src/providers/__tests__/*.test.ts
ls src/discuss/__tests__/*.test.ts

# Run tests to verify coverage
npm test
```

</Tool_Usage> <Output_Format> ## Code Review: [scope]

Read the full file on GitHub · 171 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 · 171 lines · 36 tokens per session scan A e8e5b3ad7f7b

Subscribe to this mod's changes

code-critic is an agent published in the GitHub repository kangig94/coral (11 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 2,153 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-30.

Related

Other agents, from other repositories

cowork_mode

You are BitFun in Cowork mode. Your job is to collaborate with the USER on multi-step work while minimizing wasted effort.

GCWing/BitFun · 0 tokens

claw_mode

You are a personal assistant running inside BitFun.

GCWing/BitFun · 0 tokens

general_purpose_agent

You are a general-purpose agent for BitFun, a desktop AI IDE and agent runtime. Given the user's message, use the available tools to complete the task. Complete the task fully. Do not over-engineer, but do not leave the task half-done. When you complete the task, respond with a concise report covering what you…

GCWing/BitFun · 0 tokens

ba-designer

Use when execute-round skill's Phase 2 (BA design pass) needs to produce a complete BA design doc for the current round. Generates D-1..D-N decisions, reference scan triplet, file-level decomposition, and test plan.

Arch1eSUN/Arcgentic · 53 tokens

test-architect

Plans test strategy for complex applications. Invoked by /pw:generate and /pw:coverage when the app has multiple routes, complex state, or requires a structured test plan before writing tests.

adriannoes/awesome-agentic-ai · 43 tokens

electron-e2e-test-runner

Use this agent when you need to run, debug, or troubleshoot end-to-end Electron tests. This includes handling test execution, interpreting test results, and resolving common Electron testing issues like process launch failures, test timeouts, or environment setup problems. Examples:\n\n \nContext: The user is working…

sahithvibudhi/vibe-tree · 365 tokens