New to Claude Skills? Learn how to install them →

Idanielmiessler on GitHub

Iterative Improvement Loop

Free

Refine your work through multiple algorithm cycles.

Get this skill

Free · Opens the source repo

What Iterative Improvement Loop does

The Iterative Improvement Loop skill allows users to run multiple full algorithm cycles on a specified target, enhancing it through iterative refinement. Each cycle builds upon the previous one, ensuring that insights gained from earlier iterations inform future ones. This process is particularly useful for tasks that require multiple passes to achieve a satisfactory outcome, such as refining prompts, diagrams, or written content. By maintaining a record of past attempts, the skill helps prevent users from retracing dead ends and encourages continuous improvement.

In practice, the skill operates by executing a series of algorithmic steps: OBSERVE, LEARN, THINK, PLAN, BUILD, EXECUTE, and VERIFY. Each iteration involves a human review, allowing for adjustments and redirection based on the results of the previous cycle. This human-in-the-loop approach ensures that the refinement process is guided and purposeful, rather than automated and potentially directionless.

For users who prefer a more hands-off approach, the skill also offers an autoresearch mode, allowing for autonomous iterations without human intervention. This feature can be particularly beneficial for long-running tasks where immediate human feedback is not feasible. However, users must be cautious to set clear exit conditions to avoid indefinite loops.

Overall, the Iterative Improvement Loop skill is designed for developers, designers, and anyone engaged in tasks that benefit from iterative enhancement. It provides a structured framework for refining outputs, ensuring that each iteration contributes meaningfully to the final result.

When to use it

Use this skill when you need to refine a target through several algorithm cycles, especially when human input is valuable between iterations.

When not to use it

Avoid using this skill for tasks that can be completed in a single pass or where human review is not necessary, as it may introduce unnecessary complexity.

What you can build with it

Refining Technical Diagrams

Use the skill to enhance the consistency and quality of technical diagrams over several iterations.

Improving Writing Prompts

Run multiple cycles to refine writing prompts, focusing on clarity and conciseness with each pass.

Enhancing Research Outputs

Apply the skill to improve the quality of research outputs, iterating on findings and insights from previous cycles.

How to install Iterative Improvement Loop

View source

1. Install with the skills CLI

npx skills add danielmiessler/lifeos/Loop --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by danielmiessler

/loop — Iterative Improvement

What It Does

/loop runs the Algorithm as a loop — multiple full Algorithm cycles on the same target, each iteration building on the last. By default a human reviews and redirects between iterations. Unlike /optimize (an autonomous mutation loop), /loop runs full Algorithm passes with that human review in the seam.

The Problem

Some work doesn't finish in one pass. A skill, a prompt, a diagram, a piece of writing gets meaningfully better each time you run a full cycle on it — but only if each cycle remembers what the last one learned and what it already tried. Run the cycles by hand and you lose that thread: you re-explore dead ends, forget which approaches got rejected, and have no record of whether the score actually moved. /loop carries ISC criteria and a dead-ends ledger across iterations so each pass starts from where the last one ended.

How It Works

Each iteration is a full Algorithm cycle (OBSERVE → LEARN). The LEARN phase of one cycle feeds the OBSERVE phase of the next, the ISA tracks iteration count and cumulative improvements, and a human approves or redirects between iterations unless autoresearch mode is enabled.

Invocation

/loop --target "path/to/target" --iterations 5
/loop --target "~/.claude/skills/Art/Workflows/TechnicalDiagrams.md" --goal "make diagrams more consistent"
/loop --resume       # Resume a previous loop
/loop --status       # Show iteration history

What Happens

Each iteration is a full Algorithm cycle (OBSERVE → THINK → PLAN → BUILD → EXECUTE → VERIFY → LEARN) with:

  • ISC criteria that evolve between iterations
  • Each cycle's LEARN phase informs the next cycle's OBSERVE
  • ISA tracks iteration count and cumulative improvements
  • Human approves/redirects between iterations

Arguments

ArgumentRequiredDefaultDescription
--target PATHyesWhat to improve (file, directory, skill)
--goal TEXTinferredWhat "better" means for this target
--iterations N3Maximum number of Algorithm cycles
--resumeResume a previous loop
--statusShow iteration history
--autoresearchoffOpt-in autonomous mode — see below

Algorithm Integration

The iteration field tracks cycle count. (mode: is retired — never write it.) Each cycle re-enters the Algorithm with accumulated context from prior iterations.

Autoresearch Mode (opt-in)

--autoresearch switches /loop from supervised multi-pass improvement to autonomous iteration, borrowing three patterns from pi-autoresearch (davebcn87, MIT):

  1. No human review between cycles — each iteration's LEARN feeds directly into the next OBSERVE. Cycle continues until --iterations reached, target met, or explicit interrupt.
  2. Dead-ends ledger — ISA maintains a ## Dead Ends section. Every failed iteration appends one line with the rejected approach and reason. Resumes read this to avoid retrying rejected paths.
  3. MAD confidence on iteration score — if the target has a measurable score, compute |delta|/MAD(iteration_scores) per cycle. Flag red (<1.0×) iterations as noise-floor and log marginal; do not update baseline. See LIFEOS/ALGORITHM/optimize-loop.md → Confidence Gating.

Invocation:

/loop --target "path" --goal "X" --iterations 20 --autoresearch

Default /loop behavior is unchanged — autoresearch is opt-in only. Intended for overnight runs on targets where human-in-the-loop review between cycles is too slow.

Examples

/loop --target "~/.claude/skills/Research" --goal "improve output quality" --iterations 5
/loop --target "prompts/summarize.md" --goal "more concise, less filler"

Gotchas

  • Loop runs multiple full Algorithm cycles. Each cycle is a complete OBSERVE→LEARN pass. This is expensive in time and tokens.
  • Set a clear exit condition. Without one, loops can run indefinitely.
  • Human review happens between cycles. Don't skip the review step — it's the feedback mechanism.

Frequently asked questions about Iterative Improvement Loop

Similar skills