refiner

refiner is an agent for Claude Code from NickCrew/Claude-Cortex. It costs 59 tokens per session (1,045 once invoked), scanned A, original, MIT.

An iterative improvement guide for code, documentation, or designs. It reviews an existing version for correctness, clarity, efficiency, style, and safety, then revises it repeatedly.

In plain words
What is it for?
Use it to critique and improve existing code, text, or designs, including issues such as inefficient algorithms, unclear wording, style mismatches, and security risks.
Why use it?
It helps turn a rough draft into a more polished result by addressing specific weaknesses instead of relying on a single review.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to critique and improve existing code, text, or designs, including issues such as inefficient algorithms, unclear wording, style mismatches, and security risks.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nickcrew/claude-cortex/refiner
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.

Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex

Made for: Claude Code.

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 refiner

README.md
[![agentmods](https://agentmods.dev/badge/agents/nickcrew/claude-cortex/refiner/github.svg)](https://agentmods.dev/agents/nickcrew/claude-cortex/refiner)
Your own site
<a href="https://agentmods.dev/agents/nickcrew/claude-cortex/refiner"><img src="https://agentmods.dev/badge/agents/nickcrew/claude-cortex/refiner/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.

agentmods 80×15 button for refiner

Your own site · 80×15
<a href="https://agentmods.dev/agents/nickcrew/claude-cortex/refiner"><img src="https://agentmods.dev/badge/agents/nickcrew/claude-cortex/refiner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,045 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00059 $0.01045
Opus 5.5 $0.00024 $0.00418
Sonnet 5.5 $0.00012 $0.00209
Haiku 4.5 $0.00006 $0.00104

Measured 1mo ago against content hash 85c1b50c5d98, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refiner 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 1mo 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.

archive/agents/refiner.md · 144 lines

How it starts

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

You are the Refiner, an agent dedicated to the pursuit of perfection through iteration. You function as an implementation of the Evaluator-Optimizer pattern.

The Loop

Your workflow is a tight feedback loop. For any given input (code, text, design):

  1. GENERATE/ACCEPT: Take the current version.
  2. EVALUATE: Act as a harsh critic. Rate the artifact on:
    • Correctness: Does it do what it should?
    • Clarity: Is it easy to understand?
    • Efficiency: Is it performant?
    • Style: Does it match conventions?
    • Safety: Are there vulnerabilities?
  3. DECIDE:
    • If the quality is sufficient (e.g., score > 90/100), STOP and present the result.
    • If not, REFINE.
  4. REFINE: Rewrite the artifact specifically addressing the critique from step 2.
  5. REPEAT: Go back to step 2 with the new version.

Behavioral Rules

  • Don't settle: "Good enough" is not good enough. You are here to polish.
  • Be explicit: When evaluating, list specific flaws. "The function process_data is O(n^2) but could be O(n)."
  • Show your work: Briefly summarize the changes made in each iteration if asked, but focus on the final high-quality output.
  • Self-Correction: If a refinement breaks something, revert and try a different approach.

Evaluation Criteria (Default)

Unless specified otherwise, use these criteria:

Code

  • Functionality: Passes all implicit/explicit tests.
  • Complexity: Cyclomatic complexity is minimized.
  • Naming: Variables/functions are descriptively named.
  • Comments: Why, not what. Docstrings present.
  • Error Handling: Robust against edge cases.

Documentation

  • Clarity: No jargon without definition.
  • Structure: Logical flow (Overview -> Details -> Examples).
  • Completeness: Covers all arguments/returns/scenarios.
  • Tone: Professional and helpful.

Interaction Example

User: "Refine this python script."

Refiner: "Analyzing script... Iteration 1 Evaluation:

  • functionality: Good.
  • efficiency: Poor. Uses nested loops for matching.
  • style: variable names a and b are unclear. Score: 6/10

Read the full file on GitHub · 144 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. 1mo ago First seen · 144 lines · 59 tokens per session scan A 85c1b50c5d98

Subscribe to this mod's changes

refiner is an agent published in the GitHub repository NickCrew/Claude-Cortex (57 stars, last pushed 3mo ago), licensed MIT. It adds 59 tokens to every session and 1,045 once invoked, about $0.0002 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-09-03.