autoloop

autoloop is a skill for Claude Code, Codex from jun0-ds/sonmat. It costs 40 tokens per session (4,850 once invoked), scanned A, original, BSD-3-Clause.

A repeatable work cycle that plans a task, defines the expected result, carries it out, checks the result, records useful findings, and repeats when needed.

In plain words
What is it for?
It helps manage multi-step work, inspect prior session notes, verify changes, decide whether to continue or escalate, and save relevant context.
Why use it?
It gives complex coding tasks a consistent process and identifies when more planning, checking, or user input is needed.

Skill for Claude CodeCodex

Part of the sonmat plugin — 6 skills, 3 agents, 1 hook 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 skills/jun0-ds/sonmat/autoloop
Any agent
npx skills add jun0-ds/sonmat --skill autoloop
Clone the repo
git clone --depth 1 https://github.com/jun0-ds/sonmat

Made for: Claude Code, Codex.

Or install sonmat, the plugin that ships this one along with the rest of its 6 skills, 3 agents, 1 hook.

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 autoloop

README.md
[![agentmods](https://agentmods.dev/badge/skills/jun0-ds/sonmat/autoloop.svg)](https://agentmods.dev/skills/jun0-ds/sonmat/autoloop)
Your own site
<a href="https://agentmods.dev/skills/jun0-ds/sonmat/autoloop"><img src="https://agentmods.dev/badge/skills/jun0-ds/sonmat/autoloop.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,850 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00040 $0.04850
Opus 5 $0.00020 $0.02425
Sonnet 5 $0.00008 $0.00970
Haiku 4.5 $0.00004 $0.00485

Measured 3d ago against content hash fc20a77d2743, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

autoloop 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 3d 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.

skills/autoloop/SKILL.md · 375 lines

How it starts

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

Autoloop — Autonomous Loop Protocol

0. Entry Routing

On receiving a task, judge complexity:

Signal L0 (direct) Full loop
Files to modify 1 Multiple
Iteration needed One-shot Expected

L0: Skip planning questions and definition. Apply core.md + hints.md → execute → verify → done. Escalate to full loop if a trigger fires.

Full loop: Proceed to section 1.

Bridge-note check: Before starting any task, check if the sonmat bridge note exists (bridge-note.md in $SONMAT_PROJECTS_BASE/<slug>, default ~/.sonmat/projects/<slug>/ where <slug> is the cwd path with /-; legacy .claude/sonmat/ as fallback). If relevant context is found, incorporate it silently. Mention to user only if directly relevant to the new task.

1. Planning Questions

When no loop definition exists, build one through conversation. Ask 2-3 at a time, not all at once.

Required Questions

# Question Collects
1 What is the end goal? loop.name + objective
2 Which files/scope to modify? loop.modify
3 How to run after modification? loop.run
4 How to evaluate results? loop.evaluate
5 Keep/discard/refine criteria? loop.judge
6 Constraints? (off-limits files, time, preservation zones) loop.constraints
7 When to stop? loop.exit

Skip rules

  • Already answered in task description → fill without asking.
  • Clearly inferable from context → fill without asking.
  • At minimum, secure modify, run, evaluate.

Confirmation

Show the loop definition YAML and get user approval before starting. For L0 tasks: one-line summary suffices — "Proceeding like this: [summary]. Object if not."

2. Loop Protocol

[Plan] → [Define] → [Execute] → [Evaluate] → [Judge] → [Record] → [Repeat/Exit]

[Plan]

  • No definition → run section 1 questions.
  • Has definition → proceed to [Define].
  • Milestone-scale planning → escalate to L3 (see below).

Read the full file on GitHub · 375 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. 3d ago First seen · 375 lines · 40 tokens per session scan A fc20a77d2743

Subscribe to this mod's changes

autoloop is a skill published in the GitHub repository jun0-ds/sonmat (6 stars, last pushed 6d ago), licensed BSD-3-Clause. It adds 40 tokens to every session and 4,850 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

auto-review-loop

Autonomous multi-round research review loop. In Copilot CLI it defaults to the native complementary rubber-duck subagent with host-event model evidence; elsewhere it uses Codex, while explicit external reviewer overrides remain available. Implements fixes and re-reviews until a policy-approved positive assessment or…

wanshuiyin/Auto-claude-code-research-in-sleep · 65 tokens

proof-checker

Rigorous mathematical proof verification and fixing workflow. Reads a LaTeX proof, identifies gaps via cross-model review (external reviewer backend, ultra reasoning), fixes each gap with full derivations, re-reviews, and generates an audit report. Use when user says "检查证明", "verify proof", "proof check", "审证明"…

wanshuiyin/Auto-claude-code-research-in-sleep · 87 tokens

auto-paper-improvement-loop

Autonomously improve a generated paper via GPT-5.6-Sol xhigh review → implement fixes → recompile, for 2 rounds. Use when user says "改论文", "improve paper", "论文润色循环", "auto improve", or wants to iteratively polish a generated paper.

wanshuiyin/Auto-claude-code-research-in-sleep · 69 tokens

citation-audit

Zero-context verification that every bibliographic entry in the paper is real, correctly attributed, and used in a context the cited paper actually supports — catching hallucinated authors, wrong years, fabricated venues, version mismatches, and wrong-context citations. Use when user says "审查引用", "check citations"…

wanshuiyin/Auto-claude-code-research-in-sleep · 86 tokens

grant-proposal

Draft a structured grant proposal from research ideas and literature. Supports KAKENHI (Japan), NSF (US), NSFC (China, including 面上/青年/优青/杰青/海外优青/重点), ERC (EU), DFG (Germany), SNSF (Switzerland), ARC (Australia), NWO (Netherlands), and generic formats. Use when user says "write grant", "grant proposal", "申請書", "write…

wanshuiyin/Auto-claude-code-research-in-sleep · 131 tokens

idea-creator

Generate and rank research ideas given a broad direction. Use when user says "找idea", "brainstorm ideas", "generate research ideas", "what can we work on", or wants to explore a research area for publishable directions.

wanshuiyin/Auto-claude-code-research-in-sleep · 51 tokens