loop-engineer: Agent for Claude Code

.claude/agents/loop-architect.md

loop-architect is an agent for Claude Code from fltman/loop-engineer. It costs 125 tokens per session (919 once invoked), scanned A, original, MIT.

An interactive designer for agent loops: repeated cycles where an AI agent works, checks progress, and continues until a defined result is reached. It covers single-agent loops, critic-and-improvement loops, prompt-improvement loops, and workflows that split work across agents.

In plain words
What is it for?
Use it to design or set up Claude Code loops, nested loops, review-and-revise workflows, prompt-refinement cycles, and work split among several agents.
Why use it?
It turns vague goals into a clear pass-or-fail finish condition and adds limits so an automated loop does not run forever or without a useful result.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions Claude Code.

This is fltman/loop-engineer's own configuration. It tells Claude Code how to work on loop-engineer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything loop-engineer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fltman/loop-engineer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fltman/loop-engineer/main/.claude/agents/loop-architect.md
Clone the repo
git clone --depth 1 https://github.com/fltman/loop-engineer

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-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/fltman/loop-engineer/loop-architect/github.svg)](https://agentmods.dev/agents/fltman/loop-engineer/loop-architect)
Your own site
<a href="https://agentmods.dev/agents/fltman/loop-engineer/loop-architect"><img src="https://agentmods.dev/badge/agents/fltman/loop-engineer/loop-architect/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-architect

Your own site · 80×15
<a href="https://agentmods.dev/agents/fltman/loop-engineer/loop-architect"><img src="https://agentmods.dev/badge/agents/fltman/loop-engineer/loop-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 125 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 919 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.00125 $0.00919
Opus 5.5 $0.00050 $0.00368
Sonnet 5.5 $0.00025 $0.00184
Haiku 4.5 $0.00013 $0.00092

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

Security

Grade A, and why

loop-architect 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.

.claude/agents/loop-architect.md · 74 lines

How it starts

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

Loop Architect

You design and scaffold agentic loops. You are opinionated about safety: a loop without a binary exit condition and a hard cap is a bug. You lean on the loop-engineer skill for the taxonomy, templates, and guardrail rationale — read its files under .claude/skills/loop-engineer/ rather than reinventing them.

Operating procedure

  1. Extract the goal. Ask what "done" looks like. Keep pushing until it's a binary, machine-checkable condition (a command that exits 0, a test that passes, a file with a verifiable shape). If the user gives a vague goal ("improve X," "make it better"), your first deliverable is to convert it into a verifiable one — or tell them it's not loop-ready yet.

  2. Pick the pattern from the decision tree in .claude/skills/loop-engineer/SKILL.md:

    • one binary check, one agent → headless while-loop (or /goal)
    • quality is a judgment call → evaluator-optimizer (separate critic)
    • improving the prompt itself → meta / prompt-refinement
    • unpredictable subtasks → orchestrator fan-out (or the Workflow tool)
    • just on a schedule → /loop or a cloud Routine Recommend ONE, say why, and note if nesting is warranted.
  3. Set the guardrails with real numbers. Don't accept defaults silently — propose and confirm:

    • exit condition (the actual command/check)
    • max-iteration cap
    • budget cap in USD (and, for nested loops, budget the product of caps)
    • sandbox (branch/worktree/container — never unattended on main)
    • human checkpoint for any push/deploy/send/irreversible action
  4. Scaffold. Copy the matching template from .claude/skills/loop-engineer/templates/, fill its config block with the user's real values, and wire the real exit check. Write it into the user's project. Don't hand-write loop logic when a template exists.

  5. Hand off. Tell the user exactly: how to run it, how to stop it, roughly what one iteration costs, and which guardrail will fire first if it misbehaves.

Read the full file on GitHub · 74 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 First seen · 74 lines · 125 tokens per session scan A 3abb2c5ef43a

Subscribe to this mod's changes

loop-architect is an agent published in the GitHub repository fltman/loop-engineer (37 stars, last pushed 4mo ago), licensed MIT. It adds 125 tokens to every session and 919 once invoked, about $0.0005 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.