Harry Xin

$ looming run

The work continues,
and so does the record.
工作继续,
来龙去脉也留下。

Looming keeps Claude Code working on one mission, round after round, until the work is done or you stop it. This page is its log: what happens from the first command to a clean stop.Looming 让 Claude Code 围绕一个目标一轮接一轮地工作,直到完成或被你叫停。这一页就是它的运行日志:从第一条命令,到一次干净的停止。

Open on GitHub在 GitHub 打开
npm install -g looming

run locally本机运行Real output, run on this machine on 2026-11-07.2026-11-07 在本机实际运行的输出。README sampleREADME 示例The sample run published in the README.README 中公开的示例运行。

run locally本机运行

looming init

Three files,
and the loop has a memory
三个文件,循环就有了记忆

Every round starts with an empty context window, so whatever matters must live on disk. mission.md is the charter: the goal, what counts as done, and what must never happen. backlog.json is the queue of tasks, each todo, doing, done or blocked. journal.ndjson is the record of every round, failures included, and it only grows.每一轮都从空白的上下文窗口开始,所以重要的东西必须放在磁盘上。mission.md 是章程:目标是什么、怎样算完成、哪些事绝对不能做。backlog.json 是任务队列,每项任务处于待办、进行中、完成或受阻四种状态之一。journal.ndjson 记下每一轮的经过,失败也记,只追加不改写。

2026-11-07 06:26:37 已初始化 …\lmdemo\.looming
2026-11-07 06:26:37 下一步:编辑 .looming/mission.md 写清你的使命,然后 `looming run`。

.looming/
├── mission.md       861 B
├── backlog.json     { "tasks": [] }
├── journal.ndjson   (empty)
└── state.json
run locally本机运行

$EDITOR .looming/mission.md

Write the mission like a work order像写工单一样写目标

The guardrails go into every prompt. A loop that runs while nobody watches should be told plainly what it may not do.「边界与约束」会写进每一轮的提示。一个在无人看管时运行的循环,应当被明确告知哪些事不能做。

# 使命 (Mission)
为 `report.ts` 补齐单元测试,并保持 `npm test` 全绿。

## 完成定义 (Definition of Done)
- [ ] `npm test` 全绿
- [ ] `report.ts` 的每个导出函数都有测试

## 边界与约束 (Guardrails)
- 不 force push
- 每完成一个工作单元就 commit
run locally本机运行

looming run --dry-run

See the prompt before spending anything先看提示,
不花一分钱

A dry run assembles the exact prompt the first round would receive and stops. The three files appear in it as three sections. The last instruction asks Claude to end with a fenced report block; that block is the only way the loop learns what happened.dry-run 会组合出第一轮将要收到的完整提示,然后停下。三个文件在提示里对应三段内容。最后一条要求 Claude 在结尾输出一个固定格式的报告块,循环只能通过这个报告块得知这一轮发生了什么。

──── #1 本轮 prompt(dry-run,不调用 claude)────
你是一个【自驱循环 / autonomous loop】中的某一轮执行体。进度都存在磁盘文件里,
不在你的上下文里——所以务必把成果写进文件/代码/提交,并在结尾如实汇报……

# 使命 (MISSION:长期目标 + 完成定义)      ← mission.md
# 当前待办 (BACKLOG)                        ← backlog.json
(待办为空 —— 若使命尚未达成完成定义,请先把使命拆成具体任务再开干……)
# 最近若干轮日志 (JOURNAL — 从失败里学习,别重复踩坑)   ← journal.ndjson
(暂无历史)
# 本轮要做的
1. 从待办里挑【单个】最高价值的下一步……
# 结尾必须输出(这是循环追踪进度的唯一方式)
```looming  { "summary", "taskUpdates", "newTasks", "learnings", "missionComplete", "blocked" }
──── prompt 结束 ────
  循环结束 · 共 1 轮 · 累计 $0.0000
README sampleREADME 示例

looming run

The loop starts循环开始

Each round is a fresh claude -p --output-format json, with the prompt sent on stdin. Looming keeps the result, the session id and the cost of every round. It needs no API key; it runs on an existing Claude Code subscription.每一轮都是一个全新的 claude -p --output-format json,提示通过标准输入传入。Looming 记录每一轮的结果、会话 ID 和花费。它不需要 API key,使用现有的 Claude Code 订阅。

2026-06-14 02:11:04  Looming · autonomous loop started
2026-06-14 02:11:04  dir ~/proj/acme · model (default) · perm acceptEdits · every 5s · fresh context
README sampleREADME 示例

#1 ✓ scaffolded test harness; 3 specs green $0.0212

At the end of the round Claude writes its report. Looming parses it, marks tasks done, adds the work it discovered, and appends the lessons to the journal.一轮结束时,Claude 写下报告。Looming 解析它:把完成的任务标为完成,把新发现的工作加入待办,把经验追加到日志。

```looming
{
  "summary": "what this iteration did",
  "taskUpdates": [{ "id": "t_…", "status": "done" }],
  "newTasks": [{ "title": "discovered work", "priority": 3 }],
  "learnings": ["gotcha for next time"],
  "missionComplete": false,
  "blocked": false
}
```
README sampleREADME 示例

#2 ✓ covered auth module (12 new tests, 0 fail) $0.0307

The second round reads the first round’s learnings before it starts. Failures are written down in the same way, so the next round does not walk into the same wall.第二轮开始前,先读到第一轮留下的经验。失败也以同样的方式记录,下一轮就不会撞上同一堵墙。

README sampleREADME 示例

#3 ✓ found + fixed off-by-one in pagination $0.0291

rule规则

When the service pushes back服务端开始拒绝的时候

On a rate limit Looming backs off and waits. After repeated failures it trips a circuit breaker and stops, rather than retrying all night.遇到限流,Looming 退避等待;连续失败若干次后触发熔断并停下,不会整夜反复重试。

rule规则

When the money runs out预算用完的时候

--max-cost stops the loop at a lifetime total. --max-daily-cost and --max-daily-tokens pause it for the day; the count resets at local midnight and survives restarts. These caps matter more since June 2026, when claude -p usage began to be metered on a separate credit.--max-cost 在累计花费达到上限时停止循环。--max-daily-cost 与 --max-daily-tokens 让它当天暂停,计数在本地零点重置,重启后依然有效。2026 年 6 月起,claude -p 的用量改为单独计费,这些上限因此更加重要。

README sampleREADME 示例

#4 ▸ refactoring report.ts for testability …

README sampleREADME 示例

^C stop signal — exiting cleanly after this iteration

An interrupt never cuts a round in half. The current round finishes, its report is written, and the loop stops. The same happens on its own when the definition of done is objectively met.打断不会把一轮切成两半:当前这一轮会做完、写好报告,然后循环停下。达到完成标准时,它也会以同样的方式自行停止。

run locally本机运行

looming status

Check on it in the morning早上看一眼

Because everything is on disk, the loop resumes where it left off after a crash or a reboot. Put it under pm2, systemd or Windows Task Scheduler and it survives the night; the repository has ready-made configs.所有状态都在磁盘上,崩溃或重启后循环会从中断处继续。交给 pm2、systemd 或 Windows 任务计划程序管理,它就能撑过整夜;仓库里有现成的配置。

  Looming · 状态
2026-11-07 06:26:45 使命   为 `report.ts` 补齐单元测试,并保持 `npm test` 全绿。
2026-11-07 06:26:45 状态   idle · 第 1 轮 · 累计 $0.0000
2026-11-07 06:26:45 今日   2026-11-07 · $0.0000 · 0 tok
2026-11-07 06:26:45 待办   todo:0 doing:0 blocked:0 done:0

diff /loop /goal ralph looming

/loop/goalRalphLooming
Survives terminal, crash or reboot关闭终端、崩溃、重启后仍在✗✗✗✓
Mission, backlog, journal as state目标、待办、日志是正式状态✗✗~✓
Learns from its own failures从自己的失败中学习✗✗~✓
When it stops何时停止interval poll定时轮询when done完成即停when drained清空即停when interrupted被打断才停

From the Looming README. Looming builds on Geoffrey Huntley’s Ralph technique and Ryan Carson’s snarktank/ralph.对比取自 Looming README。Looming 建立在 Geoffrey Huntley 的 Ralph 技巧和 Ryan Carson 的 snarktank/ralph 之上。

In June 2026 the head of Claude Code, Boris Cherny, said he no longer prompts Claude directly; he writes loops that do. Looming is one answer to how such a loop should be written.2026 年 6 月,Claude Code 负责人 Boris Cherny 说,他已不再直接给 Claude 写提示,而是写循环,由循环去提示 Claude。Looming 回答的是:这样的循环应该怎么写。

cat ROADMAP

  • [ ]Install as a real system service (systemd, launchd, Windows Service)安装为系统服务(systemd、launchd、Windows 服务)
  • [ ]Several loops in parallel over git worktrees在多个 git worktree 上并行运行多个循环
  • [ ]Backends beyond Claude Code, such as Codex and Gemini CLI支持 Claude Code 以外的后端,例如 Codex、Gemini CLI
  • [ ]A web dashboard for the journal and live cost用网页面板查看日志和实时花费

npm looming@0.2.0 · Node ≥ 18 · TypeScript · MIT · README in 10 languages10 种语言的 README

A loop that keeps state does not make the work correct or safe; run it in a repository you can reset, and set a budget before leaving it alone.循环能保留状态,并不保证工作正确或安全。请在可以回退的仓库里运行,离开前先设好预算上限。