@Xudong07452910: 开源项目推荐:loop-engineering —— 让你的 AI 编码 Agent 拥有自循环与智能编排能力的实用框架 loop-engineering 是目前很火的概念,该项目提供了实用模式、启动器和 CLI 工具,帮助开发者设计系统…
摘要
loop-engineering 是一个开源框架,为 AI 编码代理(如 Claude Code、Codex、Cursor)提供自循环和智能编排能力,包含 7 个生产级循环模式、实用 CLI 工具和五大数据块设计,帮助开发者从手动提示转向系统化自动化。
查看缓存全文
缓存时间: 2026/06/22 07:39
开源项目推荐:loop-engineering —— 让你的 AI 编码 Agent 拥有自循环与智能编排能力的实用框架
loop-engineering 是目前很火的概念,该项目提供了实用模式、启动器和 CLI 工具,帮助开发者设计系统来提示和编排 AI 编码代理(如 Claude Code、Cursor、Grok、Codex 等)。
受 Addy Osmani 和 Boris Cherny(Claude Code 负责人)理念启发,让 Agent 从“被动响应提示”转向“主动循环”完成目标,实现可持续的自动化。
核心亮点:
- 7 个生产级循环模式(如 Daily Triage、PR Babysitter、Issue Triage),支持 L1(仅报告)→ L2(辅助)→ L3(无人值守)渐进 rollout
- 实用 CLI 工具:loop-init(快速启动项目)、loop-audit(评估循环就绪度)、loop-cost(估算 token 消耗)
- 五大数据块设计:自动化/调度、工作树、技能、插件/连接器、子代理 + 内存/状态
- 内置 checklist、failure modes、anti-patterns 和 MCP 集成
- 支持 Claude Code、Cursor、Codex 、Grok等多平台,强调工程化与可控性
该项目深入“循环工程”,让你的 AI 编码 Agent 系统更自主、可控、可持续。特别适合使用 Claude Code、Codex 等 AI 编码代理的开发者、DevOps 工程师和想从手动提示转型为系统设计师的团队。
https://github.com/cobusgreyling/loop-engineering… #AIAgent #ClaudeCode #LoopEngineering #AI工具 #开源项目 #codex
cobusgreyling/loop-engineering
Source: https://github.com/cobusgreyling/loop-engineering
Loop Engineering
Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead.
For developers using Grok, Claude Code, Codex, Cursor, and other AI coding agents.
A loop is a recursive goal: you define a purpose and the AI iterates (often with sub-agents, verification, and external state) until the goal is complete or the loop decides to hand off to you.
→ Interactive showcase + pattern picker
→ Loop Engineering essay (Substack)
Canonical essay by Addy Osmani
Contents
- Quick Links
- Why This Matters
- The Five Building Blocks + Memory
- Patterns
- Getting Started (5 minutes)
- Examples by Tool
- Operating & Safety
- Caveats
- Contributing
- Sources
- License
Quick Links
| Start here | Description |
|---|---|
| Loop Engineering essay | The concept, primitives, and Grok mapping — read this first |
| Pattern Picker | Which loop to run first — start here if unsure |
| Primitives Matrix | Grok vs Claude Code vs Codex — bookmark this |
| Loop Design Checklist | Ship readiness rubric |
| Patterns | 7 production patterns + interactive picker |
| Starters | Clone-and-run kits (Grok, Claude Code, Codex) |
| loop-audit | Loop Readiness Score CLI (v1.4 + activity detection) — npx @cobusgreyling/loop-audit . --suggest |
| loop-init | Scaffold starters + budget/run-log (v1.2) — npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok |
| loop-cost | Token spend estimator — npx @cobusgreyling/loop-cost |
| Stories | Real wins and honest failures |
Why This Matters
Peter Steinberger:
“You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.”
Boris Cherny (Head of Claude Code at Anthropic):
“I don’t prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops.”
The leverage point has moved from crafting individual prompts to designing the control systems that orchestrate agents over time.
The Five Building Blocks + Memory
| Primitive | Job in the Loop |
|---|---|
| Automations / Scheduling | Discovery + triage on a cadence |
| Worktrees | Safe parallel execution |
| Skills | Persistent project knowledge |
| Plugins & Connectors | Reach into your real tools (MCP) |
| Sub-agents | Maker / checker split |
| + Memory / State | Durable spine outside any conversation |
Full detail: docs/primitives.md · Cross-tool matrix: docs/primitives-matrix.md
Visual Overview
Anatomy of a Loop (Mermaid)
flowchart LR
A[Schedule / Automation] --> B[Triage Skill]
B --> C[Read + Write STATE / Memory]
C --> D[Isolated Worktree]
D --> E[Implementer Sub-agent]
E --> F[Verifier Sub-agent<br/>tests + gates]
F --> G[MCP / Git / Tickets]
G --> H{Human Gate?}
H -->|safe / allowlisted| I[Commit / PR / Action]
H -->|risky / ambiguous| J[Escalate to human<br/>with full context]
I --> A
J --> A
This reference repo now runs its own validate-patterns + audit workflows on every push/PR (see .github/workflows/). We also added LOOP.md describing the loops that will maintain it.
Patterns
| Pattern | Cadence | Starter | Week 1 | Token cost |
|---|---|---|---|---|
| Daily Triage | 1d–2h | minimal-loop | L1 report | Low |
| PR Babysitter | 5–15m | pr-babysitter | L1 watch | High |
| CI Sweeper | 5–15m | ci-sweeper | L2 cautious | Very high |
| Dependency Sweeper | 6h–1d | dependency-sweeper | L2 patch-only | Medium |
| Changelog Drafter | 1d or tag | changelog-drafter | L1 draft | Low |
| Post-Merge Cleanup | 1d–6h | post-merge-cleanup | L1 off-peak | Low |
| Issue Triage | 2h–1d | issue-triage | L1 propose-only | Low |
Not sure which to pick? Try the interactive picker or pattern-picker.
Machine-readable index: patterns/registry.yaml (7 patterns)
Getting Started (5 minutes)
# 1. Scaffold a starter (or copy manually — see starters/)
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
# 2. Estimate token spend for your cadence
npx @cobusgreyling/loop-cost --pattern daily-triage --level L1
# 3. Audit readiness (budget + run-log now scored)
npx @cobusgreyling/loop-audit . --suggest
# 4. See scores climb: empty → L1 → L2
bash scripts/before-after-demo.sh
# 5. Start report-only (Grok example)
/loop 1d Run loop-triage. Update STATE.md. No auto-fix in week one.
All three CLIs publish to npm from tagged releases — see docs/RELEASE.md. No clone required.
Develop from source (monorepo contributors):
cd tools/loop-init && npm ci && npm test && node dist/cli.js /path/to/project --pattern daily-triage --tool grok
cd tools/loop-audit && npm ci && npm test && node dist/cli.js /path/to/project --suggest
cd tools/loop-cost && npm ci && npm test && node dist/cli.js --pattern ci-sweeper --cadence 15m
Phased rollout: L1 report → L2 assisted fixes → L3 unattended — see loop-design-checklist.
Examples by Tool
Operating & Safety
- Failure Modes — incident-style catalog
- Anti-Patterns — design mistakes before production
- Multi-Loop Coordination — when loops collide
- Operating Loops — cost, logging, when to kill
- Safety — denylist, auto-merge, MCP scopes
- Security — reporting and unattended automation risks
- Concepts — intent debt, comprehension debt, harness vs loop
- MCP Cookbook — connector examples by pattern
Caveats
Loop engineering amplifies judgment — both good and bad.
- Token costs can explode with sub-agents and long-running loops.
- Verification is still on you. Unattended loops make unattended mistakes.
- Comprehension debt grows faster unless you read what the loop ships.
- Two people can run the same loop and get opposite results. The loop doesn’t know. You do.
Addy Osmani:
“Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go.”
Contributing
Share production patterns, tool mappings, and failure stories. See CONTRIBUTING.md, adopters, and GitHub Discussions.
Sources
- Cobus Greyling – Loop Engineering (Substack)
- Addy Osmani – Loop Engineering
- Attribution & further reading
License
MIT
Practical, tool-aware reference for loop engineering — patterns you can clone, checklists you can ship against, and stories that include what broke.
相似文章
@QingQ77: Loops 提供 100 个精心策划的 AI 驱动自动化循环模板,覆盖软件开发、数据科学、内容创作、产品运营、学习管理等领域。 https://github.com/jwangkun/loops 让 AI 助手自己反复"干→查→修→再干"…
Loops 是一个包含 100 个 AI 驱动自动化循环模板的开源项目,覆盖软件开发、数据科学、内容创作等领域,支持 Claude Code、Cursor、Trae 等 AI 编程助手,通过“执行→检查→修复→重复”的闭环模式实现自主任务完成。
@freeman1266: https://x.com/freeman1266/status/2064702757773496552
本文介绍Loop Engineering概念,即通过设计自动化系统让AI代理自主循环工作,包括自动化任务、工作树、技能、插件、子代理等要素,从而取代手动提示的方式,提升开发效率。
@cellinlab: https://x.com/cellinlab/status/2064144608242679822
这篇文章介绍了 Loop Engineering 的概念——不再直接给 AI agent 写 prompt,而是设计一个系统(loop)来递归地让 agent 迭代工作,直到任务完成。文章详细对比了 Claude Code 和 Codex 在 automations、worktrees、skills、sub-agents 等五个构建块上的实现,认为这可能是未来与 coding agent 协作的趋势,但仍需警惕 token 成本和 AI slop 问题。
@li9292: 我推荐这个网址: https://loops.elorm.xyz 收录了几十个大神的 loop engineering的思路
一个精心整理的预构建代理循环(闭环工作流)集合,适用于 Claude Code 和 Cursor 等编码代理,包含触发器、反馈门控以及用于自主任务执行的退出条件。
@Lonely__MH: 提示词已死,Loop Engineering 已来! 最近,AI 编程领域的 Loop Engineering(循环工程) 概念引发了技术圈的广泛讨论。 Claude Code 负责人 Boris Cherny 在近期采访中,分享了团队内…
Claude Code负责人Boris Cherny提出AI编程正从提示词工程转向循环工程(Loop Engineering),未来开发者核心任务是设计自动化循环而非编写提示词,这一趋势有望拉平开发门槛。