正在打开每日关注
正在打开每日关注
将 Agent 运行拆成回合、目标、时间与主动式循环,强调系统质量与 Token 成本。
CLAUDE CODE JUST DROPPED ITS FIRST OFFICIAL GUIDE TO LOOP ENGINEERING. prompt engineering is no longer enough. here’s the entire guide in one post: 1. Turn-based loops every prompt already runs as a loop. Claude gathers context, takes action, checks its own work, and repeats until the task is done or it needs your input. 2. Goal-based loops define what “done” looks like with /goal. Claude keeps working until it reaches that goal, while a separate evaluator checks every attempt before letting it stop. 3. Time-based loops use /loop to run prompts on a schedule. for example, every 5 minutes Claude can check your PR, fix review comments, and resolve failing CI automatically. 4. Proactive loops set up an event once. after that, the loop triggers itself whenever that event happens - no human input required. Anthropic also shared two important lessons: → loop quality depends on system quality → tokens are your biggest cost the biggest takeaway? loops aren’t magic. they’re just prompts, goals, skills, and hooks combined into systems that keep running without you. this article explains exactly how that kind of system is built a loop that wakes up every morning, finds work on its own, reviews itself, and leaves ready-to-merge PRs waiting for you.
是什么 这条推文把“Prompt Engineering”的关注点推进到“Loop Engineering”:Agent 不只回答一次,而是在明确触发器、工作步骤、检查器和停止条件后持续运行。配图将模式归纳为四类:回合式由人逐轮给提示;目标式以验收标准驱动尝试—评估;时间式按间隔轮询外部变化;主动式由事件或计划触发路由、执行与复核。
核心设计 四类循环本质上是在设计控制回路。目标式最关键的是把“完成”写成可判定信号,并设置试错上限;时间式和主动式则把人从触发链路中移开,依靠调度、Hooks、Skills、子任务和评估器形成可持续流水线。它适合把 PR 检查、CI 修复、摘要、Issue 分诊等重复工作变成后台流程。
关键洞察 循环质量不由提示词单独决定,而取决于上下文获取、工具权限、状态持久化、评估标准和失败恢复;Token 是持续运行的主要成本,应把轮询频率、上下文大小和退出条件纳入系统设计。
边界与风险 “官方指南”和外链正文未在材料中独立呈现,不能据此验证其权威性。自动修改代码仍需沙箱、权限隔离、幂等处理、审计日志和人工合并门槛,否则错误评估会造成重复执行、成本失控或把错误结果当成完成。