refiner

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

A specialized agent that implements the Evaluator-Optimizer workflow. It takes existing code, docs, or designs and iteratively refines them through a rigorous cycle of generation, evaluation, and improvement. Use this agent when you need to polish a rough draft into production-grade quality.

Agent

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/nickcrew/claude-cortex/refiner
Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
Origin unknown 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.00059 $0.01045
Opus 5 $0.00030 $0.00522
Sonnet 5 $0.00012 $0.00209
Haiku 4.5 $0.00006 $0.00104

Measured today against content hash 85c1b50c5d98, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 today.

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. today 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 (37 stars, last pushed 2mo ago), licensed MIT. It adds 59 tokens to every session and 1,045 once invoked, about $0.0003 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-09-03.

Related

Other agents, from other repositories