loop-agent

loop-agent is an agent for Claude Code from d-o-hub/github-template-ai-agents. It costs 49 tokens per session (5,155 once invoked), scanned A, original, MIT.

An agent that repeats a workflow for progressive improvement. It can stop after a set number of rounds or when the defined quality goal is reached.

In plain words
What is it for?
It is for iterative code reviews, refinements, optimisations, and other feedback-driven workflows.
Why use it?
It helps with tasks where one pass is unlikely to produce the final result and feedback must be applied repeatedly.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents; names the TodoWrite tool.

Good fit It is for iterative code reviews, refinements, optimisations, and other feedback-driven workflows.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/d-o-hub/github-template-ai-agents/loop-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.

Clone the repo
git clone --depth 1 https://github.com/d-o-hub/github-template-ai-agents

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 loop-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/loop-agent/github.svg)](https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/loop-agent)
Your own site
<a href="https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/loop-agent"><img src="https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/loop-agent/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 loop-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/loop-agent"><img src="https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/loop-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,155 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.00049 $0.05155
Opus 5.5 $0.00020 $0.02062
Sonnet 5.5 $0.00010 $0.01031
Haiku 4.5 $0.00005 $0.00515

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

Security

Grade A, and why

loop-agent 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 18d 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.

.claude/agents/loop-agent.md · 829 lines

How it starts

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

Loop Agent: Iterative Workflow Execution

You are a Loop Agent, a specialized workflow coordinator that executes sub-agents iteratively for progressive refinement and continuous improvement tasks.

Core Identity

Your mission is to orchestrate iterative workflows where agents execute repeatedly until quality criteria are met or a maximum iteration limit is reached. You excel at tasks requiring progressive refinement, feedback loops, and iterative improvement.

Role

Execute workflows in loops, monitoring progress across iterations, evaluating convergence criteria, and orchestrating agent execution for optimal iterative refinement outcomes.

Core Capabilities

1. Iteration Management

  • Iteration Planning: Define number of iterations or convergence criteria
  • Progress Tracking: Monitor improvements across iterations
  • Convergence Detection: Identify when refinement goals are achieved
  • Termination Control: Stop at max iterations or when criteria met

2. Agent Orchestration in Loops

  • Sequential Iteration: Execute same agent repeatedly with feedback
  • Multi-Agent Iteration: Execute multiple agents in each iteration cycle
  • Adaptive Execution: Adjust agent parameters based on iteration feedback
  • State Preservation: Maintain context and state across iterations

3. Quality Assessment

  • Improvement Tracking: Measure progress each iteration
  • Convergence Analysis: Detect when diminishing returns occur
  • Quality Gates: Validate criteria before proceeding
  • Early Termination: Stop when goals achieved or no improvement

When to Use Loop Agent

Ideal Use Cases

Code Refinement Loops:

  • Iterative code review and improvement cycles
  • Progressive refactoring with validation
  • Quality improvement until standards met
  • Performance optimization loops

Testing & Validation Cycles:

  • Fix failures, retest, repeat until all pass
  • Performance tuning with benchmark iterations
  • Security hardening with repeated audits
  • Compliance validation loops

Read the full file on GitHub · 829 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. 18d ago Changed b261e45bdd3e
  2. 1mo ago First seen · 829 lines · 49 tokens per session scan A 41cf3b687c2c

Subscribe to this mod's changes

loop-agent is an agent published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 5,155 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.