octo-loop

octo-loop is a command for Claude Code from CES-Ltd/Lumi. It costs 13 tokens per session (1,029 once invoked), scanned A, a copy of octo-loop, MIT.

A command for repeating a coding task until a stated goal is reached, such as passing tests or meeting a performance target.

In plain words
What is it for?
Use it for iterative testing, fixing failures, auditing code, improving performance, or refining a result over several attempts.
Why use it?
It gives repeated work a clear stopping condition and can stop when progress stalls or a maximum number of attempts is reached.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the octo plugin — 10 skills, 47 commands shipped together

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 commands/ces-ltd/lumi/octo-loop
Clone the repo
git clone --depth 1 https://github.com/CES-Ltd/Lumi

Made for: Claude Code.

Or install octo, the plugin that ships this one along with the rest of its 10 skills, 47 commands.

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 octo-loop

README.md
[![agentmods](https://agentmods.dev/badge/commands/ces-ltd/lumi/octo-loop.svg)](https://agentmods.dev/commands/ces-ltd/lumi/octo-loop)
Your own site
<a href="https://agentmods.dev/commands/ces-ltd/lumi/octo-loop"><img src="https://agentmods.dev/badge/commands/ces-ltd/lumi/octo-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,029 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod 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.00013 $0.01029
Opus 5 $0.00006 $0.00515
Sonnet 5 $0.00003 $0.00206
Haiku 4.5 $0.00001 $0.00103

Measured 6d ago against content hash 507590de67b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

octo-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 6d 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.

Origin

This is a copy

95% identical to octo-loop — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

resources/seed/octopus/commands/octo-loop.md · 136 lines

How it starts

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

Loop - Iterative Execution Skill

Your first output line MUST be: 🐙 Octopus Loop Mode

Instructions

Read and follow the full skill instructions from: ${HOME}/.claude-octopus/plugin/.claude/skills/skill-iterative-loop.md

Quick Usage

Just use natural language:

"Loop 5 times auditing, enhancing, testing"
"Keep trying until all tests pass"
"Iterate until performance improves"

Or use the explicit command:

/octo:loop "run tests and fix issues" --max 5
/octo:loop "optimize performance until < 100ms"

Loop Execution Approach

  1. Define Goal: Clear success criteria and exit conditions
  2. Set Max Iterations: Safety limit to prevent infinite loops
  3. Execute: Run the task/operation
  4. Evaluate: Check if goal is met or progress made
  5. Loop or Complete: Continue if needed, stop when done

What You Get

  • Systematic iteration with progress tracking
  • Clear exit conditions (max iterations or goal met)
  • Progress metrics after each iteration
  • Stall detection (stops if no progress)
  • Final summary of all iterations

Use Cases

Testing Loops:

"Loop until all unit tests pass, max 3 attempts"
"Keep fixing failing tests until test suite is green"

Optimization Iterations:

"Loop 5 times optimizing query performance"
"Iterate until API response time is under 100ms"

Progressive Enhancement:

"Loop around 3 times enhancing error handling"
"Iterate improving code quality until score > 80"

Retry Patterns:

"Try up to 5 times to connect to the database"
"Loop until deployment succeeds, max 3 retries"

Safety Features

  • Max iterations enforced: Never infinite loops
  • Stall detection: Stops if no progress after N iterations
  • Clear exit criteria: Always know when to stop
  • Progress tracking: See improvement each iteration

Parameters

  • Task/Goal: What to execute or achieve
  • Max iterations: Safety limit (default: 5, max: 20)
  • Exit condition: When to stop ("until tests pass", "until score > X")
  • Progress metric: How to measure improvement

Read the full file on GitHub · 136 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. 6d ago First seen · 136 lines · 13 tokens per session scan A 507590de67b2

Subscribe to this mod's changes

octo-loop is a command published in the GitHub repository CES-Ltd/Lumi (31 stars, last pushed 3mo ago), licensed MIT. It adds 13 tokens to every session and 1,029 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to octo-loop, differing in 5 lines, and is treated as a copy.