selfloop

selfloop is a command for Claude Code from RasputinKaiser/Self-Improvement-Plugin. It costs 13 tokens per session (334 once invoked), scanned A, original, MIT.

A command for starting and controlling a persistent loop that improves SIPS and the agent through measured, verified iterations. It can start, pause, resume, inspect, complete, or clear the loop.

In plain words
What is it for?
Running repeated self-improvement cycles, checking their status, pausing or resuming them, and ending a loop when its objective is genuinely complete.
Why use it?
Ongoing improvement needs a recorded objective and explicit state rather than disconnected experiments. This command keeps the loop’s progress and controls in one place.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the harness-self-improvement plugin — 11 skills, 12 commands, 5 agents, 7 hooks, 1 MCP server shipped together

Good fit Running repeated self-improvement cycles, checking their status, pausing or resuming them, and ending a loop when its objective is genuinely complete.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rasputinkaiser/self-improvement-plugin/selfloop
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/RasputinKaiser/Self-Improvement-Plugin

Made for: Claude Code.

Or install harness-self-improvement, the plugin that ships this one along with the rest of its 11 skills, 12 commands, 5 agents, 7 hooks, 1 MCP server.

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 selfloop

README.md
[![agentmods](https://agentmods.dev/badge/commands/rasputinkaiser/self-improvement-plugin/selfloop/github.svg)](https://agentmods.dev/commands/rasputinkaiser/self-improvement-plugin/selfloop)
Your own site
<a href="https://agentmods.dev/commands/rasputinkaiser/self-improvement-plugin/selfloop"><img src="https://agentmods.dev/badge/commands/rasputinkaiser/self-improvement-plugin/selfloop/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.

agentmods 80×15 button for selfloop

Your own site · 80×15
<a href="https://agentmods.dev/commands/rasputinkaiser/self-improvement-plugin/selfloop"><img src="https://agentmods.dev/badge/commands/rasputinkaiser/self-improvement-plugin/selfloop.svg" alt="Reviewed on agentmods" width="80" 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 334 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.00013 $0.00334
Opus 5.5 $0.00005 $0.00134
Sonnet 5.5 $0.00003 $0.00067
Haiku 4.5 $0.00001 $0.00033

Measured 1mo ago against content hash b34cdc81d5b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

selfloop 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.

commands/selfloop.md · 31 lines

What it actually says

Follow references/command-protocol.md.

Use goal_state.py selfloop-set <focus> only for an explicitly requested loop. status, pause, resume, complete, and clear retain their documented state controls. A request for status never starts a cycle. No background scheduler or automatic child-agent campaign is implied.

For each authorized foreground cycle: inspect self_correct.py --json and reproducible failures; use /checkpoint for recoverable state; create an adaptation episode; declare competing hypotheses; inspect diagnostic_design for hypotheses that no proposed probe can separate; gather evidence or propose one intervention. The active agent authors the isolated candidate and evaluates it against the frozen original, consumer, and counterexample checks.

Record review-ready, rejected, unavailable, or plateau evidence. Use selfloop-record only with the corresponding supported result; evaluation does not mean an improvement is deployed. Stop at ready_for_review for generated changes. Use /teach for a durable candidate lesson, not every iteration.

A plateau means no supported next intervention within the current evidence and budget; it is not proof that no improvement exists. Keep one candidate at a time and the episode's persisted limits. Honor pause/stop immediately and report an external blocker accurately without silently changing user goal controls.

Use adaptation view next and action advance for the resumable foreground cycle. Match packet identity and required output exactly. Link later evaluated uses with link_outcome; report unmatched comparisons as unmeasured.

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. 1mo ago Changed · -44 lines · -16 tokens per session b34cdc81d5b4
  2. 1mo ago First seen · 75 lines · 29 tokens per session scan A abd41bbf619a

Subscribe to this mod's changes

selfloop is a command published in the GitHub repository RasputinKaiser/Self-Improvement-Plugin (8 stars, last pushed 16d ago), licensed MIT. It adds 13 tokens to every session and 334 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.