iterate-agent-harness

iterate-agent-harness is a skill for Claude Code from kensaurus/cursor-kenji. It costs 64 tokens per session (1,633 once invoked), scanned A, original, MIT.

A workflow for turning an agent failure into a lasting rule, guard, or automated check with a regression test. A regression test checks that a fixed problem does not return.

In plain words
What is it for?
It helps reproduce a failure, classify its cause, add a guard that catches it, apply the smallest durable fix, and test the guard.
Why use it?
It prevents the same class of failure—such as stopping early or claiming unfinished work is complete—from happening silently again.

Skill for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: mentions subagents.

Part of the cursor-kenji plugin — 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers shipped together

Good fit It helps reproduce a failure, classify its cause, add a guard that catches it, apply the smallest durable fix, and test the guard.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kensaurus/cursor-kenji/iterate-agent-harness
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 kensaurus/cursor-kenji --skill iterate-agent-harness
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 132 skills, 63 commands, 6 agents, 1 hook, 3 MCP servers.

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 iterate-agent-harness

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/iterate-agent-harness/github.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/iterate-agent-harness)
Your own site
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/iterate-agent-harness"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/iterate-agent-harness/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 iterate-agent-harness

Your own site · 80×15
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/iterate-agent-harness"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/iterate-agent-harness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 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.00064 $0.01633
Opus 5.5 $0.00026 $0.00653
Sonnet 5.5 $0.00013 $0.00327
Haiku 4.5 $0.00006 $0.00163

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

Security

Grade A, and why

iterate-agent-harness 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/iterate-agent-harness/SKILL.md · 138 lines

How it starts

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

iterate-agent-harness — Failure → Durable Guard

Degree of freedom: MIXED. Failure-class and smallest fix [HIGH freedom]; guard-fails-before-fix and the report shape [LOW freedom — run exactly].

When an agent run ends wrong, the fix is not just to redo the task — it is to change the harness so the whole class of failure cannot recur silently. This skill converts a single failure into a durable guard plus a regression check.

A failure you cannot reproduce, you cannot prove you fixed. Capture the failure mode, add a guard that fails on it, then make the guard pass with the smallest durable change.

How to reason

  1. Observe — happened vs should-have; transcript, state file, diff, CI
  2. Interpret — routing miss, missing guard, or a gate that passed wrongly
  3. Classify — premature stop / false completion / reward hacking / scope / handoff / context loss
  4. Guard — add a guard that fails on the unfixed behavior, then the smallest durable fix

Worked example

Observe: agent said complete-everything was done; .cursor/complete-everything-state.md still has 12 unchecked items. Interpret: false completion — no harness stopped the claim. Classify: false completion; gap is an unwired or skippable completion gate. Fix: add a hook test that fails while unchecked items remain; confirm it fails on this tree; then wire the hook. Do not delete the open items to go green.

Self-critique before reporting

  • Fail-then-pass — the new guard failed on the unfixed tree
  • Class, not incident — the same failure mode would now be caught
  • Guard not weakened — passing did not mean deleting or narrowing the check
  • Right owner — app bug → workflow-fix-and-ship; new SKILL.md from scratch → meta-skill-creator

Phase 0 — Capture the failure precisely [HIGH freedom]

  1. State what happened vs. what should have happened, in one sentence each.
  2. Classify the failure mode (borrow the taxonomy the toolkit already targets):
    • premature stop — quit with actionable work remaining. Shapes to guard: ends the turn with a plan or status report instead of the work; asks a question the repo could answer; stops after a subagent returns without integrating its result; wraps up early believing context is running out (compaction exists — it should not)
    • false completion — claimed done without evidence, including fabricated progress: a "ran", "checked", or "verified" with no matching tool result in the transcript
    • reward hacking — satisfied the check, not the intent (skipped test, narrowed assertion, @ts-ignore, blanket snapshot update)
    • scope boundary error — treated the plan/visible list as the full scope
    • broken handoff — a skill/command/subagent pointed at a missing or wrong target, or a phase transition dropped work
    • context loss — forgot earlier state after compaction
  3. Pull evidence from the agent transcript, .cursor/*-state.md files, git diff, and CI logs. Link the concrete artifacts.

Read the full file on GitHub · 138 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 Changed · +2 lines · -15 tokens per session 6dfab1a7b26c
  2. 1mo ago First seen · 136 lines · 79 tokens per session scan A 45042fe2b755

Subscribe to this mod's changes

iterate-agent-harness is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 25d ago), licensed MIT. It adds 64 tokens to every session and 1,633 once invoked, about $0.0003 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.