Agent Loop for Openclaw

A structured Read-Plan-Execute-Verify-Report protocol that ensures AI agents never report success without verified evidence.

cycy2xxx
v1.0.0
Mar 4, 2026
0
878
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-loop

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-loop using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent Loop?

Agent Loop is a foundational protocol designed to bring industrial-grade reliability to AI coding agents and automated workflows. By enforcing a strict lifecycle of analysis and verification, it eliminates common agent failures such as blind retries, scope creep, and the dreaded hallucinated success. This skill transforms the agent from a reactive chat interface into a systematic engineer that provides hard evidence for every action taken.

Integrating this protocol into your Openclaw Skills library ensures that every file modification and shell command is preceded by a mandatory read phase and followed by a rigorous verification check. This systematic approach is critical for maintaining code integrity and ensuring that complex multi-step operations are executed exactly as planned without unintended side effects.

Agent Loop Use Cases

  • Performing complex file modifications across multiple directories where accuracy is paramount.
  • Executing shell commands or deployment scripts that have irreversible side effects on the system.
  • Managing long-running, multi-step operations that require persistent state tracking.
  • Debugging production issues by enforcing root-cause analysis instead of trial-and-error code changes.

How Agent Loop Works

  1. Trigger Check: The protocol automatically activates for any task involving file I/O, shell execution, or operations requiring three or more steps.
  2. Phase 1: Read: The agent must read the current state of files or command documentation in the current session; recalling from memory is strictly forbidden.
  3. Phase 2: Plan: A numbered execution plan is generated. For destructive actions, the agent must pause to request explicit user confirmation.
  4. Phase 3: Execute: Steps are performed one at a time, with progress recorded in persistent memory to handle potential interruptions.
  5. Phase 4: Verify: Success is confirmed through active evidence gathering, such as re-reading modified files or checking specific exit codes.
  6. Phase 5: Report: A final report is issued detailing what was done, the verification evidence, and any remaining caveats.

Agent Loop Setup

To deploy Agent Loop within your environment, ensure your agent has access to the standard memory directory for task tracking. Use the following commands to initialize the required persistent state files for Openclaw Skills:

mkdir -p memory
touch memory/tasks.md

Ensure that the agent's system prompt is configured to recognize the Agent Loop phases and that it has permission to call the agent-task-tracker and agent-step-sequencer for complex workflows.

Agent Loop Data Schema & Taxonomy

Agent Loop organizes its operational data using a combination of markdown-based tracking and state sequencers. This ensures high visibility into the agent's thought process.

Data Component Format Purpose
Task Plan Numbered List Defines the sequence of operations in memory/tasks.md
Progress Log Sequential Updates Records the completion or failure of each step
Verification Log Evidence Table Pairs actions with specific proof of success (e.g., exit codes, grep results)
Error Recovery Root-Cause Analysis Documents the failure reason before allowing an approach change

Agent Loop Advanced Features

  • Strict Scope Control: Automatically prevents the agent from fixing unrelated bugs or performing unauthorized refactors, keeping tasks focused.
  • Error Recovery Protocol: Limits retries to two attempts before forcing a stop and report, preventing infinite loops and wasted tokens.
  • State Persistence: Seamlessly integrates with agent-task-tracker to maintain progress even if the gateway resets during a long-running Openclaw Skills operation.
  • Evidence-Based Reporting: Enforces a mandatory verification step that forbids reporting done based solely on the absence of error messages.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*