loop-three-elements

loop-three-elements is a skill for Claude Code, Codex from kangarooking/loop-engineering-skill. It costs 122 tokens per session (1,633 once invoked), scanned A, original, MIT.

A simple model for any repeating automated process: something starts it, an action happens, and a rule decides when it stops. The start may be a schedule, a new message, or a failed build.

In plain words
What is it for?
Use it to design a new repeating workflow, explain what a loop is, or diagnose one that will not start or stop correctly.
Why use it?
It makes it easier to design a loop that starts at the right time, does useful work, and does not run forever.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to design a new repeating workflow, explain what a loop is, or diagnose one that will not start or stop correctly.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kangarooking/loop-engineering-skill/loop-three-elements
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.

Any agent
npx skills add kangarooking/loop-engineering-skill --skill loop-three-elements
Clone the repo
git clone --depth 1 https://github.com/kangarooking/loop-engineering-skill

Made for: Claude Code, Codex.

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 loop-three-elements

README.md
[![agentmods](https://agentmods.dev/badge/skills/kangarooking/loop-engineering-skill/loop-three-elements/github.svg)](https://agentmods.dev/skills/kangarooking/loop-engineering-skill/loop-three-elements)
Your own site
<a href="https://agentmods.dev/skills/kangarooking/loop-engineering-skill/loop-three-elements"><img src="https://agentmods.dev/badge/skills/kangarooking/loop-engineering-skill/loop-three-elements/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 loop-three-elements

Your own site · 80×15
<a href="https://agentmods.dev/skills/kangarooking/loop-engineering-skill/loop-three-elements"><img src="https://agentmods.dev/badge/skills/kangarooking/loop-engineering-skill/loop-three-elements.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 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.00122 $0.01633
Opus 5.5 $0.00049 $0.00653
Sonnet 5.5 $0.00024 $0.00327
Haiku 4.5 $0.00012 $0.00163

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

Security

Grade A, and why

loop-three-elements 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 2mo 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.

loop-three-elements/SKILL.md · 109 lines

How it starts

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

Source Metadata

Original cangjie-skill frontmatter from the distillation run:

name: loop-three-elements
description: |
  设计或审计任何循环系统的起点: 将循环拆解为 Trigger(触发器)、Action(动作)、Stop Condition(停止条件) 三要素。
  当用户需要设计一个新循环、诊断一个失效循环、或向他人解释"什么是 Loop"时使用。
  不适用于: 单次任务执行、非循环的自动化脚本、或已经稳定运行无需重新设计的系统。
  关键 trigger: "设计一个 loop"、"这个循环为什么不停止"、"什么是 loop 的最小结构"。
source_book: "Loop Engineering 视频合集 (Gillock/Cherny/Steinberger/Idoos Money/小木头)"
source_chapter: 视频1/3/4
tags: [loop-design, core-concept, trigger, action, stop-condition]
related_skills: [loop-worthiness-test, goal-verification, loop-build-path]

Loop 三要素 — 任何循环的最小可工作结构

R — Reading (原文)

"A loop is three things: a trigger, an action, and a stop condition." — Adam Gillock (视频1)

"第一块心跳,它用来自动触发... 第二块工作树... 第三块skill... 第四块连接器... 第五块子智能体... 最后就是那根脊柱——记忆。" — 小木头 (视频3)

I — Interpretation (自述)

任何循环系统,无论多复杂,都可以拆解为三个基本要素:

  1. Trigger (触发器): 什么条件下启动循环? 可以是定时 (cron)、事件 (新邮件到达)、或状态变化 (CI 失败)。
  2. Action (动作): 循环启动后执行什么操作? 这是循环的主体逻辑。
  3. Stop Condition (停止条件): 何时判定任务完成并退出循环? 可以是目标达成 (凑够 5 条)、次数上限 (最多 8 轮)、或状态判断 (无新任务)。

三要素缺一不可: 没有 trigger 的循环不知道何时开始; 没有 action 的循环是空壳; 没有 stop condition 的循环会无限运行直到资源耗尽。

A1 — Past Application (书中案例)

案例1: Boris Cherny 的 Support Loop (视频2)

  • Trigger: 每 30 分钟定时启动
  • Action: 读取新 support ticket → AI 分类+回复 → 记录摩擦/想法到 signals 文件夹
  • Stop Condition: 无新 ticket 或达到最大处理数

案例2: 小木头的选题 Loop (视频3)

  • Trigger: 每天早上 8 点 (cron)
  • Action: 拉取过去 24h AI 资讯 → 用 topic-score 子智能体评级 → 追加到 inbox.md
  • Stop Condition: 无新资讯或 inbox 达到上限

A2 — Future Trigger (未来触发)

用户会在以下情境下需要这个 skill:

  1. 设计新循环时: "我想让 AI 每天自动做 X" → 先问: trigger 是什么? action 是什么? 何时停止?
  2. 诊断失效循环时: "我的 loop 跑了 3 天还没停" → 检查 stop condition 是否缺失或过主观
  3. 向团队解释 Loop 时: 用三要素作为教学框架,让非技术人员理解循环系统的结构
  4. 比较不同 Loop 实现时: 用三要素作为分析框架,对比不同方案的触发策略和停止逻辑

语言信号: "设计一个 loop"、"这个循环怎么停"、"什么是 loop 的最小结构"、"帮我看看这个 loop 缺什么"

与相邻 skill 的区别:

  • loop-worthiness-test: 判断"要不要做 loop" (本 skill 假设已决定要做,关注"怎么做")
  • goal-verification: 关注 stop condition 的设计 (本 skill 是三要素的整体框架)
  • loop-build-path: 关注构建步骤 (本 skill 是静态结构分析)

Read the full file on GitHub · 109 lines

Files

What ships with it

2 files 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. 2mo ago First seen · 109 lines · 122 tokens per session scan A 8fcd65e1387b

Subscribe to this mod's changes

loop-three-elements is a skill published in the GitHub repository kangarooking/loop-engineering-skill (28 stars, last pushed 4mo ago), licensed MIT. It adds 122 tokens to every session and 1,633 once invoked, about $0.0005 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-30.

Related

loop-three-elements compared with skills from other repositories

loop-three-elements next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
loop-three-elementskangarooking/loop-engineering-skillSkill284mo agoMITA122Claude Code, Codex
imagegenopenai/codexSkill135ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill100ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill394ktodayMITA36Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill80k6d agoMITA200Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code
systematic-debuggingobra/superpowersSkill317k9d agoMITA21Claude Code