Glean 拾遗
Daily /2026-06-28 / Stop Being the Loop: How to Make Claude Work While You Sleep

Stop Being the Loop: How to Make Claude Work While You Sleep

Source x.com Glean’d 2026-06-28 06:00 Read 9 min
AI summary

Boris Cherny, who built Claude Code at Anthropic, no longer writes prompts by hand—he writes loops. This guide explains what a real loop is: a small system that runs Claude repeatedly until a job is done, complete with self-checking, state persistence, and automatic stopping. Unlike cron jobs, loops contain a decision-maker (Claude) that can adapt mid-stream. The article covers Claude Code's /goal (loop until done) and /loop (repeat on a schedule) commands, and provides a paste-ready charter template with sections for goals, work sources, work instructions, self-verification, memory, and stop conditions. Ideal for engineers transitioning from prompting to building persistent, autonomous AI workflows.

Original · 9 min
x.com ↗
§ 1

Stop Being the Loop. Here's How to Make Claude Work While You Sleep.

By @Raytar · 2026-06-23T00:13:24.000Z

Stop Being the Loop. Here's How to Make Claude Work While You Sleep.

The person who built Claude Code at Anthropic stopped prompting Claude.

His name is Boris Cherny. In June 2026 he said it out loud: "I don't prompt Claude anymore."

Loops prompt Claude for him. His actual job now is writing loops.

That sounds like a flex. But no. It's the biggest shift in how people use Claude and ChatGPT right now. You've probably heard the phrase. Almost nobody does it yet.

别再当循环,让 Claude 替你睡觉也能干活

作者:@Raytar · 2026-06-23T00:13:24.000Z

别再当循环,让 Claude 替你睡觉也能干活

那位在 Anthropic 打造 Claude Code 的人已经不再手动提示 Claude 了。

他叫 Boris Cherny。2026 年 6 月,他公开说:“我不再提示 Claude 了。”

循环/loop 替他提示 Claude。他现在真正的工作是写循环。

听起来像炫耀。但并非如此。这是当前人们使用 Claude 和 ChatGPT 的方式中最大的转变。你可能听说过这个词,但几乎没人真正在用。

§ 2

Here is how you work right now.

  • You type a prompt.
  • Claude edits a file.
  • You run the test.
  • It breaks.
  • You paste the error back.
  • It tries again. Twenty minutes later you realize you've been babysitting the exact thing you wanted to hand off.

You are the loop. You're the one checking the work and deciding the next step, every single time. That is the job a loop takes over.

你目前是这样工作的:

  • 你输入提示。
  • Claude 编辑文件。
  • 你运行测试。
  • 测试失败了。
  • 你把错误贴回去。
  • 它重试。 二十分钟后,你发现自己一直在守着原本想交给别人干的活。

你就是那个循环。每次都是你来检查工作、决定下一步。而这正是循环要做的事情。

§ 3

One example shows the whole difference

Ask Claude to write you a one page brief on any topic. Simple task. It writes something clean and confident, with sources at the bottom.

Now read the sources. Some of them are fake(!!!). Claude made them up and has no idea it did. They look real. The links go nowhere, or they go somewhere that doesn't say what Claude claimed. This is the quiet way Claude burns you, and a single prompt can never catch it, because Claude stays confident it's right until something opens the link.

Now run it as a loop instead. Same brief, but you add a bar it can measure:

every claim needs at least three sources, and every link has to open to a real page that backs up the claim.

Watch what happens. Claude writes the brief, then goes link by link. It opens each one. It throws out the dead ones and the fake ones. It finds real replacements. It keeps checking until every single source on the page is something you can open. Then it stops.

It never gets bored. It never skips the boring ones.

Here's how you'd write that in Claude Code. Don't worry about the command yet, I break it down below:

/goal write a one page brief on [your topic]
where every claim has at least three sources and
every link opens to a real page that supports the claim. 

Open each link to confirm it before you call it done.

Replace any source that is dead or does not back up the claim.

Stop only when every source on the page checks out.

一个例子揭示全部差别

让 Claude 就任何主题写一份一页简报。简单的任务。它写出来一份干净、自信的简报,底部附有来源。

现在读一读那些来源。有些是假的(!!!)。Claude 编造了它们,而且自己并不知道。它们看起来很真。链接打不开,或者打开的页面说的和 Claude 声称的完全不符。这就是 Claude 默默坑你的方式,单次提示永远无法发现,因为 Claude 会一直自信自己没错,直到有人点开链接。

现在改用循环来运行这个任务。同样的简报,但你加上一个可衡量的条件:

每一项论断都需要至少三个来源,每个链接都必须能打开一个真实页面来支持该论断。

看看会发生什么。Claude 写好简报,然后逐个检查链接。它打开每一个。它丢弃那些死链和假链接。它找到真实的替代链接。它持续检查,直到页面上每个来源都能打开。然后它才停止。

它从不觉得无聊。它从不跳过那些枯燥的链接。

以下是在 Claude Code 中的写法。先别担心命令细节,我下面会详细分解:

/goal 写一份关于 [你的主题] 的一页简报
要求每一项论断至少有三个来源
每一个链接都能打开一个支持该论断的真实页面。

在完成前打开每个链接确认。

替换任何失效或不能支持论断的来源。

只有当页面上每个来源都通过验证时才停止。
§ 4

What a loop is

A loop is a small system that prompts Claude for you, over and over, until a job is done.

Every loop, no matter how fancy, is the same five beats:

  1. Find the work. Open tasks, failing tests, unread emails, files in a folder.
  2. Do it. Claude handles one item at a time, like you would by hand.
  3. Check itself. A second pass confirms the work is done and correct, not just produced.
  4. Remember. It writes down what's finished, so it never repeats work or loses its place.
  5. Go again. It repeats until nothing's left, then stops or pings you. One line to keep: prompting is doing the work. Loop engineering is managing the worker.

什么是循环?

循环是一个小型系统,它会替你反复提示 Claude,直到任务完成。

任何循环,无论多花哨,都遵循同样的五个环节:

  1. 找到工作——开放任务、失败的测试、未读邮件、文件夹中的文件。
  2. 执行它——Claude 一次处理一个项目,就像你手动处理一样。
  3. 自我检查——第二次确认工作已完成且正确,不仅仅是生成了输出。
  4. 记住——它记下已完成的内容,因此永远不会重复工作或丢失位置。
  5. 继续——重复直到没有剩余,然后停止或通知你。

有一句话值得记住:提示是在做工作。循环工程是在管理工人。

§ 5

"Isn't this just a scheduled task?"

Good question. No.

You can already make your computer run the same thing every morning at 8am. That's a cron job. It's older than most of us. It runs a fixed script. Same steps, every time, no thinking.

A loop is different because of one thing: there's a decision-maker inside it.

A cron job runs a script. A loop runs Claude. Claude looks at the current situation, picks the next action, does it, checks the result, and then decides what to do next. Keep going. Try again. Undo. Stop.

That decision in the middle is the entire point. A script can't look at a broken test and figure out a different fix. Claude can. This only became possible once Claude and ChatGPT got good enough to make real judgment calls mid-job.

“这不就是定时任务吗?”

好问题。不是。

你已经可以让电脑每天早上 8 点运行同一件事。那是 cron 定时任务。它比我们大多数人都老。它运行一个固定的脚本。相同的步骤,每次都一样,不需要思考。

循环的不同之处在于一件事:里面有一个决策者。

Cron 任务运行脚本。循环运行 Claude。Claude 观察当前状况,选择下一个动作,执行它,检查结果,然后决定下一步做什么:继续、重试、撤销、停止。

中间的决策才是全部关键。脚本无法查看失败的测试并找出不同的修复方案。Claude 可以。这只有在 Claude 和 ChatGPT 足够好、能在任务中途做出真正判断时才成为可能。

§ 6

The two commands that run a loop

Here's where most people go wrong. You don't build a loop by typing "do this in a loop" into a normal chat. Claude Code has two commands built in, and which one you reach for depends on the kind of loop you need.

  1. /goal is the loop that works until it's done.

But obviously not that kind of goal. xD

You saw /goal up in the brief example. You type it, then describe what "done" looks like. Claude keeps working, turn after turn, on its own. After every turn, a second copy of Claude quietly checks: are we at the goal yet? If not, it tells the first one why, and the work continues. The moment the goal is met, the loop stops by itself.

That self-check after every turn is the whole difference between a real loop and a prompt that runs once and hopes.

Use /goal when there's a finish line. Work until this is true.

  1. /loop is the loop that repeats on a rhythm.

Reach for this when the job isn't "finish a pile" but "keep an eye on something." You tell it how often and what to do, and Claude re-runs it for you.

/loop 30m check whether my live site is back up by loading the homepage.

The moment it returns a normal page, tell me and stop checking.

The 30m means every 30 minutes. You can also just say "every morning, triage my inbox" and Claude will schedule it.

Use /loop when there's no finish line, just a beat. Check this again and again.

Most of the strong loops you'll build start with /goal. These are recent Claude Code features, so if you don't see the commands, update Claude Code and they'll show up.

运行循环的两个命令

大多数人都栽在这里。你并非通过在一个普通聊天中键入“在一个循环中做这个”来构建循环。Claude Code 内置了两个命令,用哪个取决于你需要的循环类型。

  1. /goal 是循环,直到完成才停止。

你已经在简报例子里见过 /goal。你输入它,然后描述“完成”是什么样子。Claude 会自主地一轮接一轮地工作。每一轮之后,Claude 的另一个副本会悄悄检查:我们达到目标了吗?如果没有,它会告诉第一个 Claude 原因,工作继续。一旦达到目标,循环自动停止。

每轮之后的这种自我检查正是真正的循环和一次运行就完事的提示之间的全部区别。

在有终点线时使用 /goal:一直工作直到这个条件为真。

  1. /loop 是按节奏重复的循环。

当任务不是“完成一堆工作”而是“盯着某件事”时,选用这个。你告诉它频率和要做什么,Claude 会替你重复运行。

/loop 30m check whether my live site is back up by loading the homepage.

The moment it returns a normal page, tell me and stop checking.

30m 表示每 30 分钟。你也可以直接说“每天早上处理我的收件箱”,Claude 会安排计划。

在没有终点线、只有固定节拍时使用 /loop:一遍又一遍地检查这个。

你会构建的大多数强大循环都从 /goal 开始。这些是最近的 Claude Code 特性,因此如果你看不到这些命令,请更新 Claude Code,它们就会出现。

§ 7

Your first loop, ready to paste

A one line goal is plenty for a small job. For a bigger job with lots of steps, you hand Claude a full charter: where to find the work, how to check itself, how to remember, when to stop.

Fill in the brackets and paste this into Claude Code:

You are running as a loop, not answering one prompt. Here is your charter.

GOAL
[Describe the finished state in one or two sentences. 
Be specific about what DONE looks like, and make it something you can measure. 

Example: "Every product page in /pages has the new pricing and every link opens."]

WHERE THE WORK IS
[Tell Claude where to look.

Examples: "Scan the /pages folder for files with old pricing." Or "Read TODO.md and treat each unchecked box as a task." Or " Check my connected task board for items tagged ai."]

HOW TO WORK
- Do one item at a time. Finish it fully before starting the next.
- Match the patterns you find in existing files. Do not invent new ones.
- If an item needs a decision only I can make (spending money, deleting things, emailing a person), stop on that item, add it to a "needs me" list, and move to the next one.

HOW TO CHECK YOURSELF
After each item, prove it is done before you mark it done.

[Pick what fits: "run the tests" / "re-read the file and confirm it meets the goal" / "open the link and confirm it loads." Checking means evidence, not confidence.]

If the check fails, fix it and check again. Three tries per item, then log it as blocked and move on.

HOW TO REMEMBER
Keep a file called LOOP-STATE.md. 
After each item, write the item name, its status (done / blocked / needs me), what you changed, and anything the next run should know.

Read this file FIRST every run so you never redo finished work.

WHEN TO STOP
Stop when every item is done or logged as blocked, or when you have finished [N] items this run.

Then give me a short report: what got done, what is blocked, what needs my call.

Start by reading LOOP-STATE.md if it exists, then find the work.

The state file is the quiet hero. Without it, every run starts from zero. With it, the loop picks up exactly where it left off, even when it runs on a schedule.

首个可直接粘贴的循环模板

一行目标对于小任务来说足够了。对于步骤较多的大任务,你需要给 Claude 一份完整的章程:工作在哪里、如何自我检查、如何记忆、何时停止。

填写括号中的内容,然后粘贴到 Claude Code 中:

你以循环方式运行,而非回答单次提示。以下是你的章程:

GOAL
[用一两句话描述完成状态。
具体说明“完成”是什么样的,并且使其可衡量。

示例:“/pages 中的每个产品页面都有新定价,且每个链接都可以打开。”]

WHERE THE WORK IS
[告诉 Claude 去哪里找。

示例:“扫描 /pages 文件夹,查找包含旧定价的文件。”或者“读取 TODO.md,将每个未勾选的框视为一个任务。”或者“检查我关联的任务板上标有 ai 的项目。”]

HOW TO WORK
- 一次只做一件事。完成一件后再开始下一件。
- 匹配你在现有文件中找到的模式。不要自己发明新模式。
- 如果某个项目需要只有我能做的决定(花钱、删除东西、发送邮件),则在此项目上停止,将其添加到“需要我处理”列表,然后继续下一个项目。

HOW TO CHECK YOURSELF
在标记每个项目为完成之前,先证明它确实完成了。

[选择合适的方式:“运行测试”/“重新读取文件并确认它符合目标”/“打开链接并确认它加载成功。”检查意味着证据,而非信心。]

如果检查失败,修复并再次检查。每个项目最多尝试三次,然后标记为受阻并继续。

HOW TO REMEMBER
维护一个名为 LOOP-STATE.md 的文件。
在每个项目之后,写入项目名称、它的状态(done / blocked / needs me)、你更改了什么,以及下次运行需要知道的任何内容。

每次运行**首先**读取此文件,这样你就永远不会重做已完成的工作。

WHEN TO STOP
当所有项目都完成或记录为受阻时停止,或者当你此次运行已完成 [N] 个项目时停止。

然后给我一份简短报告:完成了什么,什么受阻了,什么需要我决断。

首先读取 LOOP-STATE.md(如果存在),然后找到工作。

状态文件是默默无闻的英雄。没有它,每次运行都从零开始。有了它,循环能精确地从上次中断的地方继续,即使按计划运行也是如此。

§ 8

When not to build a loop

Loops are not free and not for everything. Three honest things before you start.

  1. One-off tasks don't need a loop. If the job is a single answer, a plain prompt is faster. Loops earn their setup cost on work that repeats or has many pieces.
  2. Loops cost more. A loop that checks itself and retries is running Claude several times per item. On a Claude plan, you'll hit your usage limit faster.
  3. Vague work doesn't belong in a loop. "Think of a better product strategy" is not a loop. Go figure out the actual goal first.

何时不应构建循环

循环不是免费的,也不是万能的。开始之前,有三件实话要说。

  1. 一次性任务不需要循环。 如果工作就是给出一个答案,普通提示更快。循环在重复性或包含多个部分的任务上才值得它的搭建成本。
  2. 循环成本更高。 一个自我检查和重试的循环会为每个项目运行 Claude 多次。在 Claude 付费计划上,你会更快触及使用上限。
  3. 模糊的工作不适合循环。 “想一个更好的产品策略”不是循环。先弄清楚真正的目标是什么。
§ 9

Start this week

Pick one task you keep doing by hand, the kind with lots of small pieces. Paste the charter. Fill in the brackets. Run it once while you watch every step.

When you trust it, put it on a schedule. The first time you wake up to work that finished overnight, you'll stop typing prompts one at a time. Just like Boris.

Helped? Follow me. I share this stuff so you don't have to dig for it

本周就上手

选一个你一直手动执行的任务,那种包含许多小步骤的。粘贴章程模板。填写括号中的内容。先运行一次并观察每一步。

当你信任它之后,把它放到计划上。第一次你醒来发现工作在前一晚已完成时,你就不会再一个接一个地手动输入提示了。就像 Boris 那样。

有帮助吗?关注我。我分享这些内容,这样你就不用到处去搜了。

Open source ↗