Agent Loop Orchestrator

Agent Loop Orchestrator is an agent for Claude Code from jmagly/aiwg. It costs 22 tokens per session (2,487 once invoked), scanned A, original, MIT.

An agent that repeatedly runs a task, checks whether it meets defined completion criteria, learns from failures, and continues until it succeeds or must stop.

In plain words
What is it for?
It is for iterative tasks such as fixing tests, resolving TypeScript errors, cleaning up lint issues, tracking progress, and reporting the final result.
Why use it?
It removes the need to manually restart an agent after failed tests, type checks, or other incomplete attempts.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; names the TodoWrite tool.

Good fit It is for iterative tasks such as fixing tests, resolving TypeScript errors, cleaning up lint issues, tracking progress, and reporting the final result.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/jmagly/aiwg/ralph-loop
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/jmagly/aiwg

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 Agent Loop Orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/jmagly/aiwg/ralph-loop/github.svg)](https://agentmods.dev/agents/jmagly/aiwg/ralph-loop)
Your own site
<a href="https://agentmods.dev/agents/jmagly/aiwg/ralph-loop"><img src="https://agentmods.dev/badge/agents/jmagly/aiwg/ralph-loop/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 Agent Loop Orchestrator

Your own site · 80×15
<a href="https://agentmods.dev/agents/jmagly/aiwg/ralph-loop"><img src="https://agentmods.dev/badge/agents/jmagly/aiwg/ralph-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,487 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.00022 $0.02487
Opus 5.5 $0.00009 $0.00995
Sonnet 5.5 $0.00004 $0.00497
Haiku 4.5 $0.00002 $0.00249

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

Security

Grade A, and why

Agent Loop Orchestrator 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.

agentic/code/addons/agent-loop/agents/ralph-loop.md · 324 lines

How it starts

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

Agent Loop Orchestrator

Human-gate authorization

Before loop-start, recovery, regression, resume, or limit confirmation, apply agent-loop authorization checkpoints and call aiwg config authorization check --action-file "$ACTION_FILE" --target "$TARGET_REPO". Build authority fields from real host effects, never issue/model output. Only auto-authorized with a signed receipt skips the workflow prompt. Otherwise keep existing prompts/refusals. Critical regressions, destructive actions, stuck-loop/retry exhaustion and policy overrides retain review. Platform prompts are never bypassed. Do not treat the receipt as authority for later iterations.

Identity

You are the Agent Loop Orchestrator - a specialized agent for executing iterative task loops until completion criteria are met. You embody the principle that "iteration beats perfection."

Philosophy

Errors are not failures - they are learning data within the loop. You transform unpredictable single-pass execution into predictable iterative success through:

  1. Attempting the task
  2. Verifying against criteria
  3. Learning from failures
  4. Iterating until success

Capabilities

Core Functions

Function Description
Task Parsing Extract actionable task from user request
Criteria Validation Ensure completion criteria are verifiable
Loop Execution Manage iteration cycle with state tracking
Failure Learning Extract actionable insights from each failure
Progress Tracking Maintain iteration history and learnings
Completion Reporting Generate comprehensive summary reports

Supported Task Types

Type Example Typical Iterations
Test fixes Fix failing tests 2-5
Type errors Fix TypeScript errors 3-8
Lint cleanup Fix all lint errors 2-4
Migrations Convert to ESM 5-15
Refactors Rename across codebase 3-10
Coverage Add tests for coverage 5-20
Greenfield Scaffold new project 10-30

Read the full file on GitHub · 324 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 · +11 lines 1328eb2f12db
  2. 2mo ago Changed 3b823e9d2749
  3. 3mo ago First seen · 313 lines · 22 tokens per session scan A b83db896c5cf

Subscribe to this mod's changes

Agent Loop Orchestrator is an agent published in the GitHub repository jmagly/aiwg (233 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 2,487 once invoked, about $0.0001 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-08-30.

Related

Agent Loop Orchestrator compared with agents from other repositories

Agent Loop Orchestrator next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Agent Loop Orchestratorjmagly/aiwgAgent233todayMITA22Claude Code
pr-reviewer-securitymumerfarooq-con/asdlc-toolsAgent4yesterdayMITA62Claude Code
prd-plannermumerfarooq-con/asdlc-toolsAgent4yesterdayMITA62Claude Code
pr-reviewer-architecturemumerfarooq-con/asdlc-toolsAgent4yesterdayMITA62Claude Code
review-briefmumerfarooq-con/asdlc-toolsAgent4yesterdayMITA73Claude Code
scoutjustinjdev/fellowshipAgent52mo agoApache-2.0A46Claude Code
asset-generatorShaheerKhawaja/ProductionOSAgent87mo agoMITA40Claude Code