agent-loop

Run iterative agent loops with guardrails and gate.py scoring.

Updated May 16, 2026
One-click install
npx skills add https://github.com/ramboz/servo --skill agent-loop-ramboz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-loop
Source: https://github.com/ramboz/servo/tree/main/hosts/codex/plugins/servo/skills/agent-loop
Command: npx skills add https://github.com/ramboz/servo --skill agent-loop-ramboz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires claude, gate.py, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps run a headless agent loop with hard guardrails, providing an evaluation and iterative feedback mechanism to converge on a target goal.

Core Features & Use Cases

  • Headless Agent Loop: Runs subprocesses against a target N iterations under hard guardrails, such as iteration cap, cumulative cost ceiling, context-fill refusal, oracle-score plateau detection, and cleanup on SIGINT/SIGTERM.
  • State Checkpointing: Saves state to a file for interrupted or capped runs to be resumed.
  • Evaluation Components: Utilizes gate.py for post-iteration scoring and decision-making whether to iterate again.
  • Use Case: Ideal for projects requiring iterative testing and evaluation, such as automated software development cycles where you want to ensure that the implementation is reaching the desired level of quality.

Quick Start

Run the agent loop for a target with a prompt, such as: python3 ${PLUGIN_ROOT}/skills/agent-loop/loop.py /path/to/target --prompt "fix the failing tests"

Frequently Asked Questions about agent-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an automated agent loop for iterative software evaluation?

An iterative agent loop runs subprocesses against a target multiple times under hard guardrails like iteration caps and cost ceilings. It provides evaluation and iterative feedback mechanisms to converge on a target goal in automated software development cycles.

How does headless agent iteration handle interruptions and state checkpointing?

Headless agent iteration handles interruptions by saving state to a checkpoint file, allowing interrupted or capped runs to be resumed. It also performs automatic cleanup when receiving SIGINT or SIGTERM signals during the evaluation loop.

Do I need claude and gate.py to run automated evaluation workflows?

Yes, you need claude and gate.py to run automated evaluation workflows. The loop requires executing `claude -p --agent` for iteration and `gate.py --json` for post-iteration scoring and deciding whether to iterate again.

What are the guardrails for managing cumulative cost and context-fill in an agent loop?

Guardrails for managing agent loops include iteration caps, cumulative cost ceilings, context-fill refusal, and oracle-score plateau detection. These hard limits prevent runaway processes during automated software evaluation and iterative testing.

When should I use a model-judged evaluation loop instead of standard automated testing?

Use a model-judged evaluation loop when projects require iterative testing with deterministic and model-judged scoring to converge on a target goal. It is ideal for automated software development cycles ensuring implementations reach desired quality levels.