iterative-refinement

iterative-refinement is a skill for Claude Code, Codex from sammcj/agentic-coding. It costs 100 tokens per session (2,795 once invoked), scanned A, original, Apache-2.0.

A method for improving scripts, prompts, documents, configurations, or datasets through repeated checks with explicit pass-or-fail conditions.

In plain words
What is it for?
Use it to define quality thresholds, run iterative refinement cycles, delegate parts of an investigation, and keep evidence of each result.
Why use it?
It turns vague judgments such as “is this good enough?” into repeatable checks and helps catch regressions introduced during changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to define quality thresholds, run iterative refinement cycles, delegate parts of an investigation, and keep evidence of each result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sammcj/agentic-coding/iterative-refinement
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.

Any agent
npx skills add sammcj/agentic-coding --skill iterative-refinement
Clone the repo
git clone --depth 1 https://github.com/sammcj/agentic-coding

Made for: Claude Code, Codex.

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 iterative-refinement

README.md
[![agentmods](https://agentmods.dev/badge/skills/sammcj/agentic-coding/iterative-refinement/github.svg)](https://agentmods.dev/skills/sammcj/agentic-coding/iterative-refinement)
Your own site
<a href="https://agentmods.dev/skills/sammcj/agentic-coding/iterative-refinement"><img src="https://agentmods.dev/badge/skills/sammcj/agentic-coding/iterative-refinement/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 iterative-refinement

Your own site · 80×15
<a href="https://agentmods.dev/skills/sammcj/agentic-coding/iterative-refinement"><img src="https://agentmods.dev/badge/skills/sammcj/agentic-coding/iterative-refinement.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,795 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00100 $0.02795
Opus 5.5 $0.00040 $0.01118
Sonnet 5.5 $0.00020 $0.00559
Haiku 4.5 $0.00010 $0.00280

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

Security

Grade A, and why

iterative-refinement 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.

Skills_disabled/iterative-refinement/SKILL.md · 127 lines

How it starts

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

Iterative refinement with verifiable conditions

Improve any system (script, pipeline, prompt, doc, config, dataset) by looping against measurable pass/fail conditions while keeping the main thread's context lean. Task-agnostic. The aim is to make "is it good yet?" a single repeatable command, catch each regression at the edit that caused it, and keep load-bearing reasoning in cheap, auditable steps.

Use this as a toolkit, not a script. Each method below earns its place by what it prevents, and that reasoning is stated inline so you can judge when it applies. Reach for the methods the situation calls for, scale them to the stakes, and adapt or skip what doesn't fit; they compose well, but no fixed subset is mandatory and this skill can't anticipate every task you'll point it at. When a method clearly fits, lean into it fully rather than half-applying it. The judgement of which to use, and how hard, stays yours.

The loop

  1. Turn the goal into a pass/fail rubric with explicit thresholds. "Useful" isn't checkable; "contamination < 2%, both naive and effective ratios reported, every input row classified, prints Overall: PASS" is.
  2. Bake the rubric into the artifact as a self-check it prints. The artifact computes its own metrics and prints [PASS]/[FAIL] per condition, so the check can't drift out of sync with the code the way an external checklist does. Now any party (you, a subagent, the user) re-verifies with one command.
  3. Change one layer, re-run the check. Catch each regression at the edit that caused it, not three edits later.
  4. Loop on a fast slice, not the full dataset. Size the slice so a run takes seconds, not minutes. Run the full corpus only at checkpoints, when a layer is structurally complete and at sign-off, since that's where rare signals and period splits actually appear and the cost is justified.
  5. Keep a frozen held-out slice the loop never touches, and confirm against it before sign-off. Looping hard on one slice optimises the rubric for that slice (Goodhart on your own metric); the held-out slice is what proves the gain generalised rather than memorised.
  6. When all conditions pass but value remains, write a stricter rubric and loop again. Stop when a cycle yields nothing material.

Read the full file on GitHub · 127 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 127 lines · 100 tokens per session scan A b10046efe8fb

Subscribe to this mod's changes

iterative-refinement is a skill published in the GitHub repository sammcj/agentic-coding (165 stars, last pushed today), licensed Apache-2.0. It adds 100 tokens to every session and 2,795 once invoked, about $0.0004 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.