octo-loop

octo-loop is a command for Claude Code, Cursor from nyldn/claude-octopus. It costs 16 tokens per session (1,042 once invoked), scanned A, original, MIT.

A command that repeats a task while checking whether each attempt makes progress. It stops when the goal is reached, a maximum number of attempts is used, or progress stalls.

In plain words
What is it for?
Use it to rerun tests and fix failures, audit and enhance code, or optimize a task until a stated condition is met.
Why use it?
It supports work that may need several rounds, such as fixing tests or improving performance, without allowing an endless process.

Command for Claude CodeCursor

Written for Claude Code and Cursor: disable-model-invocation in frontmatter, but also a Cursor plugin manifest. Also seen: positional $N argument.

Part of the octo plugin โ€” 69 skills, 106 commands, 10 agents, 18 hooks shipped together

Good fit Use it to rerun tests and fix failures, audit and enhance code, or optimize a task until a stated condition is met.

Compare 6 commands from other repositories โ†“
Install with agentmods
npx agentmods add commands/nyldn/claude-octopus/octo-loop
About the project

Claude Octopus is an orchestration project that sends research, design, and coding tasks to Claude Code and other AI model providers so their results can be compared. Developers use it for multi-model work, disagreement detection, reviews, persistent context, and an optional workflow that moves from discovery through delivery. The catalogue entries are its commands, skills, agents, instructions, hooks, plugins, and settings.

nyldn/claude-octopus ยท 4,054 stars ยท on GitHub ยท reddit.com

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.

Clone the repo
git clone --depth 1 https://github.com/nyldn/claude-octopus

Made for: Claude Code, Cursor.

Or install octo, the plugin that ships this one along with the rest of its 69 skills, 106 commands, 10 agents, 18 hooks.

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/nyldn/claude-octopus/octo-loop.svg)](https://agentmods.dev/commands/nyldn/claude-octopus/octo-loop)
Your own site
<a href="https://agentmods.dev/commands/nyldn/claude-octopus/octo-loop"><img src="https://agentmods.dev/badge/commands/nyldn/claude-octopus/octo-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 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,042 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.00016 $0.01042
Opus 5 $0.00008 $0.00521
Sonnet 5 $0.00003 $0.00208
Haiku 4.5 $0.00002 $0.00104

Measured 4d ago against content hash 019b3b942d7c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 4d 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

Copies of this mod

2 near-identical copies found in the catalogue:

  • loop โ€” 97% identical, 3 lines differ
  • octo-loop โ€” 95% identical, 5 lines differ
.cursor-plugin/commands/octo-loop.md ยท 137 lines

How it starts

The opening of the file, as written. The whole thing โ€” 137 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/SKILL.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 ยท 137 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. 4d ago First seen ยท 137 lines ยท 16 tokens per session scan A 019b3b942d7c

Subscribe to this mod's changes

octo-loop is a command published in the GitHub repository nyldn/claude-octopus (4,054 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 1,042 once invoked, about $0.0001 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-09-03.