design-a-loop

design-a-loop is a skill for Claude Code, Codex from impactbrussels/AINativeOS. It costs 129 tokens per session (1,948 once invoked), scanned A, original, Apache-2.0.

A method for designing an automated agent workflow that repeatedly finds work, gives it to an agent, checks the result, and chooses what happens next. It is intended for recurring tasks with machine-checkable results.

In plain words
What is it for?
Planning scheduled or continuous tasks such as dependency maintenance or CI triage, where tests, type checks, linting, or builds can verify the outcome.
Why use it?
It helps decide when automation is worth the cost and prevents an agent from repeating incorrect work without a stopping rule.

Skill for Claude CodeCodex

Part of the ai-native-os plugin — 25 skills, 6 agents 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/impactbrussels/ainativeos/design-a-loop
Any agent
npx skills add impactbrussels/AINativeOS --skill design-a-loop
Clone the repo
git clone --depth 1 https://github.com/impactbrussels/AINativeOS

Made for: Claude Code, Codex.

Or install ai-native-os, the plugin that ships this one along with the rest of its 25 skills, 6 agents.

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 design-a-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/impactbrussels/ainativeos/design-a-loop.svg)](https://agentmods.dev/skills/impactbrussels/ainativeos/design-a-loop)
Your own site
<a href="https://agentmods.dev/skills/impactbrussels/ainativeos/design-a-loop"><img src="https://agentmods.dev/badge/skills/impactbrussels/ainativeos/design-a-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,948 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.00129 $0.01948
Opus 5 $0.00064 $0.00974
Sonnet 5 $0.00026 $0.00390
Haiku 4.5 $0.00013 $0.00195

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

Security

Grade A, and why

design-a-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 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/design-a-loop/SKILL.md · 122 lines

How it starts

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

Design a Loop

A loop is a small system that finds the work, hands it to the agent, checks the result, records what happened, and decides the next move on its own. You design it once; it prompts the agent from then on. The leverage has moved from typing the prompt to designing the system that prompts. That is real power and a real bill. A loop with no gate does not stop being wrong, it stops telling you, and it spends the whole time. Build one only where the work repeats, the check is machine-gradable, and the floor is hard.

The method

Build tier. Full framework, tables, and a worked example: references/loop-engineering.md. Standalone explainer: docs/LOOP-ENGINEERING.md.

Step 1: Run the 4-condition test

Build a loop only if all four hold. Miss one and the loop costs more than it returns; do the task by hand.

# Condition Pass looks like Fail means
1 The task repeats Weekly or more, same shape One-off: just prompt it
2 Verification is automated A test, type check, lint, or build fails the work without you in the room No machine grader: you are the gate, so no loop
3 The token budget absorbs waste Loops re-read, retry, explore; you can pay for that Tight budget: the loop eats it on retries
4 The agent has senior tools Logs, a reproduction environment, the ability to run its own code Blind agent: it guesses, you clean up

Step 2: Pick the building blocks

Five blocks plus state. Start with the fewest that close the loop; add only when a failure demands it.

  • Automation (the heartbeat): a schedule, an event, or a trigger. /loop for a fixed cadence; /goal to run until a written condition holds, checked by a separate model.
  • Worktree isolation: git worktrees so parallel agents do not collide on the same files.
  • Skills: the persistent project knowledge the agent reads every run.
  • Connectors and MCP: the reach into GitHub, Linear or Jira, Slack, the error tracker.
  • Sub-agents: separate the maker from the checker (the evaluator-optimizer pattern).
  • The state file: the agent forgets between runs; the repo remembers. STATE.md lets it resume, not restart. Pair it with a standing VISION.md or AGENTS.md spec the agent rereads each run.

Read the full file on GitHub · 122 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 122 lines · 129 tokens per session scan A a235ecb317ab

Subscribe to this mod's changes

design-a-loop is a skill published in the GitHub repository impactbrussels/AINativeOS (1 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 129 tokens to every session and 1,948 once invoked, about $0.0006 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

agent-session-monitor

Real-time agent conversation monitoring - monitors Higress access logs, aggregates conversations by session, tracks token usage. Supports web interface for viewing complete conversation history and costs. Use when users ask about current session token consumption, conversation history, or cost statistics.

higress-group/higress · 53 tokens

embedding-strategies

Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.

foryourhealth111-pixel/Vibe-Skills · 37 tokens

docx-comment-reply

Reply to comments (批注) in Word .docx/.doc files: extract comment context, draft replies, write threaded replies back, and validate OOXML.

foryourhealth111-pixel/Vibe-Skills · 39 tokens

oma-hwp

Convert HWP / HWPX / HWPML files to Markdown using kordoc. Extracts text, headings, tables, lists, images, footnotes, and hyperlinks. Use for Korean word processor files (Hangul), government documents, and AI-ready data preparation.

first-fluke/oh-my-agent · 59 tokens

moai-ref-ui-polish

UI polish and interface-completion reference: the small visual details — concentric border radius, optical alignment, shadow-vs-border, motion easing, typography smoothing, tabular numbers, icon stroke weight, hit areas — that separate polished interfaces from generic ones. Agent-extending skill that amplifies…

modu-ai/moai-adk · 98 tokens

trellis-brainstorm

Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex…

mindfold-ai/Trellis · 65 tokens