agent-loop

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

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.

agentmods
npx agentmods add skills/silupanda/codex-agent-loop/agent-loop
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.

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. Scan, not verified.
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 $0.00050 $0.00566
Opus 5 $0.00025 $0.00283
Sonnet 5 $0.00010 $0.00113
Haiku 4.5 $0.00005 $0.00057

Measured yesterday against content hash 87f04fa29df9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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. yesterday 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 4mo ago), licensed MIT. It adds 50 tokens to every session and 566 once invoked, about $0.0003 per session on Opus 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.

Related

Other skills, from other repositories

ralphex-adopt

Convert plans from various source formats (OpenSpec, spec-kit, GitHub/GitLab issues with checklists, generic task-lists, free-form markdown) into ralphex-format plans in docs/plans/. Triggers on "ralphex-adopt", "adopt plan", "convert plan to ralphex", "import plan as ralphex".

umputun/ralphex · 74 tokens

ralphex

Run ralphex autonomous plan execution with progress monitoring.

umputun/ralphex · 10 tokens

reviewable-design-doc

要求・設計・アーキテクチャ・未決事項を整理し、レビュー可能な設計資料HTMLを作りたい時に使う。Use this skill to structure requirements, design, architecture, alternatives, decisions, and unresolved issues into a review-ready HTML design document. レビュー完了後はHTMLコメントを読み込み、設計へ反映し、確認が必要な場合はHTMLコメントスレッドへagent返信を書き戻す。Triggers: レビュー可能な設計資料, 設計資料をHTMLで, design doc…

u-ichi/reviewable-html-workbench · 236 tokens

visual-html-renderer

HTMLを最終成果物として生成・検証・プレビューしたい時に使う共通レンダラー。Use this shared renderer when the user wants content turned into a final, validated, previewable HTML artifact. 現行rendererの表現能力を前提にagentが文書モデルを直接設計し、表・リスト・コード・注記・図・生成画像を選んだHTML bundleとセッション限定のプレビューURLを提示する。Triggers: html出力して, HTMLにして, HTMLで出して, この内容をHTMLで出して, HTMLでプレビューして…

u-ichi/reviewable-html-workbench · 268 tokens

plan-preview

Plan Mode の を出す直前に、計画の段階・依存関係・検証観点を一時HTMLで視覚確認したい時に使う agent-internal skill。Use this agent-internal skill to create a temporary HTML preview for a plan just before presenting . plugin配布だけで発火し、ユーザーにCLI実行を求めず、agentが plan-preview CLIでセッション限定URLを作り、本文に自然に差し込む。Triggers: planをグラフィカルに見たい, planを図で確認したい, この計画をHTMLでプレビューして…

u-ichi/reviewable-html-workbench · 276 tokens

loop

Use only when user explicitly invokes $loop.

breezewish/CodexPotter · 11 tokens