with one click
agent-loop
// Run long Codex tasks through a filesystem-backed loop: plan, delegate to subagents, record handoffs, verify, and continue with hooks.
// Run long Codex tasks through a filesystem-backed loop: plan, delegate to subagents, record handoffs, verify, and continue with hooks.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | agent-loop |
| description | Run long Codex tasks through a filesystem-backed loop: plan, delegate to subagents, record handoffs, verify, and continue with hooks. |
Use this skill when the user asks for $agent-loop, @agent-loop, long-running task orchestration, resumable work, subagent-first execution, or filesystem-backed task state.
Agent Loop is a method, not a hidden tool runtime. Keep the parent thread focused on planning, dispatch, validation, and state updates. Send implementation work to subagents whenever the task is large enough to benefit from isolation.
.agent-loop/codex/; do not rely on chat history as the source of truth.continue_on_stop: true, awaiting_user: false, and real work remains.workers has no unresolved entries.Treat these as user-facing modes:
$agent-loop plan <objective>: create a new loop plan and state.$agent-loop run [plan-path]: initialize or continue execution.$agent-loop resume: recover from .agent-loop/codex/active-loop.json.$agent-loop report: summarize final state, handoffs, validation, and open issues.$agent-loop halt: set the active loop to paused and stop hook continuation.Read references/loop-state.md before creating or updating loop state.
Minimum layout:
.agent-loop/codex/
active-loop.json
loops/<loop_id>/
state.json
plan.md
handoffs/
evidence/
notes.md
state.json is the control plane. Update it after planning, dispatching, processing handoffs, validation, pauses, and completion.
Read references/plan-format.md before writing a plan.
Plans should be short and executable:
handoffs/; update task status and notes.workers[] record with the returned agent id, task key, role, status, and timestamps.state.json, run validation, then close every finished worker and mark its worker record closed.continue_on_stop: true so the Stop hook can nudge the next turn.Read references/worker-handoff.md before dispatching workers.
The parent owns worker cleanup. The Stop hook can only resume the parent thread; it cannot close Codex background agents by itself.
For every dispatched worker:
workers[] record as soon as spawn_agent returns.in-progress while the worker is running.handoffs/, update task status and notes, then call close_agent for that worker.close_agent, set the worker status to closed and record closed_at.continue_on_stop: true so the next Stop hook turn resumes cleanup.Before setting status: "completed":
workers is empty or every worker has status: "closed" or status: "abandoned" with a note explaining why.continue_on_stop: false after completion.Set awaiting_user: true and stop when:
Do not hide limitations: Codex plugin hooks provide continuation nudges, not a full autonomous background runtime.