Borrowing it
Nothing to install: this file belongs to kangig94/coral. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/kangig94/coral/main/.claude/agents/code-critic.mdgit clone --depth 1 https://github.com/kangig94/coralWrote 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.
[](https://agentmods.dev/agents/kangig94/coral/code-critic)<a href="https://agentmods.dev/agents/kangig94/coral/code-critic"><img src="https://agentmods.dev/badge/agents/kangig94/coral/code-critic/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/kangig94/coral/code-critic"><img src="https://agentmods.dev/badge/agents/kangig94/coral/code-critic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.02603 |
| Opus 5.5 | $0.00014 | $0.01041 |
| Sonnet 5.5 | $0.00007 | $0.00521 |
| Haiku 4.5 | $0.00004 | $0.00260 |
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 14d 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.
How it starts
The opening of the file, as written. The whole thing — 196 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 |
<Finding_Tier_Rules>
| DO | DON'T |
|----|-------|
| Classify each real defect before assigning severity. Use the caller's review scope, or the diff if no scope was passed. | Let severity decide the tier. |
| Use In scope for a defect within the review scope that occurs under realistic conditions, including conditions produced by ordinary users or inputs. Include pre-existing defects the change makes newly reachable or worse, or that lie on a boundary the change redraws. | Treat untouched code or docs as automatically Out of scope. |
| Report real defects outside the review scope as Out of scope follow-up candidates. State why each is out of scope. | Expand the review scope to act on follow-up candidates. |
| Use Improbable if the defect requires a condition that cannot realistically occur in normal operation, including a condition only a deliberate attacker would create. Name the condition, explain why it is unrealistic, and mark attacker-creatable yes if an attacker could create it or no otherwise. | Use Improbable when you cannot name the required condition. Put that finding In scope. |
| Assign severity in every tier. Use only In scope findings to score the reviewed work and decide the verdict under the existing floor rules. | Let Out of scope or Improbable findings change a score or verdict. |
</Finding_Tier_Rules>
// 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]
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.
- 14d ago Changed · +25 lines d1b3c91af365
- 3mo ago First seen · 171 lines · 36 tokens per session scan A e8e5b3ad7f7b
code-critic is an agent published in the GitHub repository kangig94/coral (11 stars, last pushed 13d ago), licensed MIT. It adds 36 tokens to every session and 2,603 once invoked, about $0.0001 per session on Opus 5.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.
code-critic compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-critickangig94/coral | Agent | 11 | 13d ago | MIT | A | 36 | Claude Code |
| pr-reviewerfeiskyer/claude-code-settings | Agent | 1.7k | 1mo ago | MIT | A | 40 | Claude Code |
| issue-claim-auditorThe01Geek/prflow | Agent | 101 | 3d ago | MIT | A | 31 | Claude Code |
| ac-evidence-verifierThe01Geek/prflow | Agent | 101 | 3d ago | MIT | A | 25 | Claude Code |
| ac-claim-verifierThe01Geek/prflow | Agent | 101 | 3d ago | MIT | A | 26 | Claude Code |
| branch-setupThe01Geek/prflow | Agent | 101 | 3d ago | MIT | A | 28 | Claude Code |
| deferral-drafterThe01Geek/prflow | Agent | 101 | 3d ago | MIT | A | 26 | Claude Code |