By juliosaraiva
AI loop engineering for Claude Code: drive an autonomous act→verify→repeat loop that keeps working toward a goal until a configurable verify command passes, with iteration caps and no-progress detection as guardrails.
Plan a loop-engineering run without starting it — produce a plan, deterministically verifiable success criteria, and a recommended verify command.
Start an autonomous, verification-gated loop-engineering run. Claude works act→verify→repeat toward a goal until the verify command passes (or a guardrail stops it).
Show the current loop-engine state — status, iteration, last verification result, and history.
Cancel the active loop-engine run so Claude can stop normally.
Designs a loop-engineering run. Decomposes a goal into an ordered plan plus explicit, deterministically verifiable success criteria, and recommends a verify command (tests/lint/build) for the repo. Use before starting a loop or when /loop-engine:plan is invoked.
The verification gate for a loop-engineering run. Runs the verify command and inspects the working tree to judge whether each success criterion is met, then returns a concise, actionable diagnosis for the next iteration. Use to assess loop progress objectively.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A Claude Code plugin that turns Claude into a verification-gated autonomous loop: give it a goal and a way to check success, and it works act → verify → repeat until the check passes — bounded by an iteration cap and no-progress detection so it always terminates.
Marketplace + plugin. The plugin lives in
plugins/loop-engine.
Loop engineering is the practice of designing AI work as iterative cycles — act → observe → decide → repeat — that continue until a verifiable goal is met, rather than a single one-shot response. It is the successor discipline to prompt engineering and context engineering.
The problem it solves. Single-shot prompting hits a ceiling on real tasks. A one-shot agent can't catch runtime errors, can't adapt to environment-specific issues, and can't confirm its output actually works. A loop closes that feedback gap. For agentic coding, quality "usually isn't the base model — it's the loop design": how the agent handles errors, manages context across iterations, scopes the work, and verifies the result.
Anatomy of a good loop: a clear, testable goal; tool access (shell, tests, filesystem); context management (keep the goal + latest feedback in front of the model, read state from disk); termination logic (success / max-iterations / no-progress / human escalation); and error recovery (never retry an identical failed approach).
Guardrails — failure modes are routine, not edge cases: infinite loops, goal drift, context overflow, and token-cost blowups. Mitigate with hard iteration caps, no-progress detection, deterministic verification (tests/type-checks beat LLM self-assessment), and human checkpoints before irreversible actions.
This plugin builds on the Stop-hook loop pattern from Anthropic's official
ralph-wiggum
plugin and hardens it with planning, a deterministic verify gate, persisted state, and
no-progress detection.
A Stop hook drives the loop. Each time Claude finishes a turn, the hook:
completed and allow the stop.iteration ≥ max_iterations → mark failed, allow stop.git diff --stat) is identical
for N consecutive iterations → mark failed, allow stop.State is stored at .claude/loop-engine/state.json in your project (gitignored), one active
loop per project.
Try it locally (no install):
claude --plugin-dir ./plugins/loop-engine
Install from this repo as a marketplace:
/plugin marketplace add juliosaraiva/claude-code-loop-pluging
/plugin install loop-engine
Requirements: bash, jq, and git on your PATH. (jq drives the state file; the
SessionStart hook warns if it's missing.)
| Command | What it does |
|---|---|
/loop-engine:plan "<goal>" | Design a loop (plan + verifiable criteria + verify command) without starting it. |
/loop-engine:start "<goal>" --verify "<cmd>" [--max-iterations N] [--criteria "a||b"] [--completion-promise TEXT] | Start the loop. |
/loop-engine:status | Show status, iteration, and last verify result. |
/loop-engine:stop | Cancel the active loop. |
Example:
/loop-engine:start "make the test suite pass" --verify "npm test" --max-iterations 5
A runnable walkthrough lives in examples/fix-failing-test.
npx claudepluginhub juliosaraiva/claude-code-loop-pluging --plugin loop-engineHarness-native ECC operator layer - 67 agents, 271 skills, 92 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses
Superpowers Plus core skills library for Claude Code: planning, execution routing, TDD, debugging, and collaboration workflows
v9.44.1 — Patch release for Gemini environment/version detection and qwen auth gating. Run /octo:setup.
Unity Development Toolkit - Expert agents for scripting/refactoring/optimization, script templates, and Agent Skills for Unity C# development
Claude harness - A harness for solo developers (Vibecoders) to handle full-cycle contract development.
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques