agent-loop

agent-loop is a skill for Claude Code, Codex from SiluPanda/codex-agent-loop. It costs 50 tokens per session (566 once invoked), scanned A, original, MIT.

A bounded workflow for having an AI coding agent inspect files, make changes, run tests, and continue across several rounds.

In plain words
What is it for?
Use it for autonomous coding tasks that need an inspect-edit-test cycle, with optional approval before changes.
Why use it?
Some coding tasks need repeated checks and edits instead of one response. A turn or time limit keeps that work from running without an endpoint.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; reads ~/.codex paths; runs codex exec.

Good fit Use it for autonomous coding tasks that need an inspect-edit-test cycle, with optional approval before changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/silupanda/codex-agent-loop/agent-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.

Any agent
npx skills add SiluPanda/codex-agent-loop --skill agent-loop
Clone the repo
git clone --depth 1 https://github.com/SiluPanda/codex-agent-loop

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/silupanda/codex-agent-loop/agent-loop"><img src="https://agentmods.dev/badge/skills/silupanda/codex-agent-loop/agent-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 566 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.00050 $0.00566
Opus 5.5 $0.00020 $0.00226
Sonnet 5.5 $0.00010 $0.00113
Haiku 4.5 $0.00005 $0.00057

Measured 1mo ago against content hash 87f04fa29df9, 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 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.

skills/agent-loop/SKILL.md · 79 lines

How it starts

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

Agent Loop

Use this skill for multi-step coding tasks that need a bounded agent loop instead of a single local step.

When to use

  • The user says loop, agent loop, autonomous, keep iterating, or mentions Claude Code.
  • The work will likely require repeated inspect/edit/test cycles.
  • A turn cap or explicit approval boundary is useful.

Defaults

  • --max-turns 8
  • --approval-mode on-write
  • --model gpt-5.4
  • --reasoning-effort high

Important:

  • Agent Loop is bounded. It should stop when the task looks complete, when it hits its turn/time budget, when it pauses for approval, or when an error occurs.
  • In fallback mode without OPENAI_API_KEY, Agent Loop runs one codex exec session. That session may finish on the first turn for short read-only tasks.
  • A stop reason like completed_via_fallback means the task completed through the fallback backend; it does not mean the run failed.

Shorthand budgets are also supported:

  • 10m = 10 minutes
  • 1h = 1 hour
  • 5t = 5 turns

Invocation

Prefer invoking the bundled skill directly:

$agent-loop <task>

Or with a shorthand budget:

$agent-loop 10m <task>

Some Codex builds may also surface the plugin command definition. If yours does, the equivalent command is:

/agent-loop:run <task>

Onboarding helpers

  • --doctor checks that the plugin is installed and ready in Codex.
  • --demo runs a safe read-only first-run example and suggests next commands.
  • 10m, 1h, and 5t work as shorthand budgets before the task text.

Approval modes in plain English:

  • on-write = safe
  • never = hands-off
  • always = review-everything

Approval behavior

  • on-write auto-runs read-only shell inspection commands.
  • on-write pauses before write-like shell commands and all patches.
  • Use --resume <state-file> --approve-pending only after the user explicitly approves the paused action.

Run artifacts

The runner stores logs and resumable state under:

Read the full file on GitHub · 79 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 · 79 lines · 50 tokens per session scan A 87f04fa29df9

Subscribe to this mod's changes

agent-loop is a skill published in the GitHub repository SiluPanda/codex-agent-loop (4 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 566 once invoked, about $0.0002 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-31.