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.
git clone --depth 1 https://github.com/SiluPanda/codex-agent-loopWrote 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.
[](https://agentmods.dev/commands/silupanda/codex-agent-loop/run)<a href="https://agentmods.dev/commands/silupanda/codex-agent-loop/run"><img src="https://agentmods.dev/badge/commands/silupanda/codex-agent-loop/run/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.
<a href="https://agentmods.dev/commands/silupanda/codex-agent-loop/run"><img src="https://agentmods.dev/badge/commands/silupanda/codex-agent-loop/run.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.00728 |
| Opus 5.5 | $0.00011 | $0.00291 |
| Sonnet 5.5 | $0.00005 | $0.00146 |
| Haiku 4.5 | $0.00003 | $0.00073 |
Grade A, and why
run 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.
How it starts
The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/agent-loop:run
This command definition is included for Codex builds that surface plugin-defined
slash commands. If /agent-loop:run is unrecognized in your Codex build, use
$agent-loop instead.
This plugin command is namespaced by plugin id, so invoke it as:
/agent-loop:run ...
Run the local Codex Agent Loop runner at:
~/.codex/plugins/agent-loop/scripts/agent_loop.py
When to use
- The user explicitly asks for a loop, autonomous run, or Claude-Code-style persistence.
- The task likely needs multiple inspect/edit/test cycles.
- You want a bounded run with a turn cap and resumable approval pauses.
Arguments
The user invoked this command with: $ARGUMENTS
Workflow
- Treat
$ARGUMENTSas CLI flags plus the task text. - If
--resumeis present, run the script with that resume path. - Only add
--approve-pendingafter the user explicitly approves the paused action. - If
--doctoris present, run the environment check and summarize the result. - If
--demois present, run the safe onboarding demo. - Approval modes in human terms:
on-write= safenever= hands-offalways= review-everything
- If the first positional token looks like
10m,1h, or5t, treat it as a shorthand budget:m= minutesh= hourst= turns
- Run:
python3 ~/.codex/plugins/agent-loop/scripts/agent_loop.py $ARGUMENTS
- If the runner pauses for approval:
- summarize the pending command or patch
- show the saved state path
- ask whether to resume with
--approve-pending
- If the runner completes, report:
- stop reason
- backend
- turns used
- files changed
- verification commands
- final answer
- Do not claim any command or patch executed unless the runner output shows it.
Notes:
- Agent Loop is bounded; it should stop when the task is complete or when it hits a budget/pause/error.
- In fallback mode, a stop reason like
completed_via_fallbackmeans the run completed throughcodex exec; it is not an error.
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.
- 1mo ago First seen · 82 lines · 0 tokens per session scan A 690a0cb7e7f1
run is a command published in the GitHub repository SiluPanda/codex-agent-loop (4 stars, last pushed 6mo ago), licensed MIT. It adds 27 tokens to every session and 728 once invoked, about $0.0001 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.
Other commands, from other repositories
send
Send a message to a running agent session. Use this to correct or direct a live agent mid-stream without killing and respawning it.
sync
Manually trigger plan-sync to update downstream task specs after implementation drift.
analyze-context
USE WHEN you want to analyze project context before starting work on a task. Calls context + recall, then synthesizes goals, decisions, gotchas, and relevant memories into a pre-task brief.
me-figure-discussion
Write or review thermal-fluid figure discussion with observation, physical mechanism, comparison, uncertainty, and claim limits.
iterate
Iteration delivery — delivery check + archive + commit & tag + bump version.
triage
Interactive triage. Mark each finding TP / FP / wontfix. Feeds the active-learning loop for next scan.