You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: purge every literal "--max-iterations 0" mention from docs and tests (#17)
Follow-up to #16. The previous PR removed the canonical "--max-iterations
0" example but left explanatory sentences like "you no longer need to
pass --max-iterations 0" in the docs and a backward-compat test name in
test/setup.test.js. Those still printed the literal "--max-iterations 0"
to readers, defeating the point of the cleanup. This PR removes every
remaining occurrence.
## Why
Telling users "you don't need to write --max-iterations 0 anymore" still
shows them "--max-iterations 0". A new user reading the docs has no
prior knowledge of the legacy form, so explaining what NOT to write just
plants the wrong syntax in their head. Cleaner: omit the deprecation
note entirely. New users see only the "omit the flag for unlimited"
guidance. Existing users who happen to pass 0 keep working silently.
## What changed
- **`commands/help.md`**:
- `--max-iterations` Options description: dropped the trailing "You no
longer need to pass --max-iterations 0..." sentence
- Best Practices #4: dropped the trailing "you do not need to pass
--max-iterations 0" sentence
- **`scripts/setup-watchdog.js` printHelp()**: dropped the
"You do NOT need to pass --max-iterations 0 anymore." line from the
help-output trailer
- **All 7 READMEs** (`README.{md,zh,es,ja,ko,vi,pt}.md`):
- --no-classifier subsection paragraph: dropped the "you no longer
need to pass --max-iterations 0" trailing sentence
- Best Practices #4 paragraph: dropped the same trailing sentence
- **`test/setup.test.js`**:
- Renamed test from
"setup --no-classifier + --max-iterations 0 is allowed (infinite loop, manual stop only)"
to
"setup --no-classifier with no max cap is allowed (infinite loop, manual stop only)"
- Test args changed from `['build', '--no-classifier', '--max-iterations', '0']`
to `['build', '--no-classifier']`
- Added a comment explaining that the recommended way to express
"unlimited" is omission, and that the state file's max_iterations=0
default is what makes the stop hook treat the loop as uncapped
## Backward compatibility
**Identical** to the previous state. The parser still accepts
--max-iterations 0; the stop hook still treats max_iterations=0 as "no
cap" (the > 0 guard fails). Anyone who was passing 0 explicitly keeps
working. The only change is that the literal string "--max-iterations 0"
no longer appears anywhere in the docs, the in-Claude-Code help, or
test names that get printed in CI logs.
Confirmed via `Grep "--max-iterations 0"` returning **zero matches**
across the entire repo.
## Test plan
- [x] 132-test suite still passes (132 active + 2 skipped, 0 failures)
- [x] node --test test/*.test.js clean
- [x] Grep "--max-iterations 0" returns zero matches in the repo
- [ ] CI will confirm on the standard matrix
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.es.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ Para ejecuciones estilo ralph-loop donde no quieres ningún LLM juzgando la conv
163
163
/watchdog:start "Sigue iterando hasta que yo /watchdog:stop." --no-classifier
164
164
```
165
165
166
-
El Stop hook salta la llamada a Haiku por completo. Las únicas formas de salir se vuelven `--max-iterations` y `/watchdog:stop`. **`--max-iterations` es opcional** — si lo omites (como en el ejemplo de arriba), el bucle es verdaderamente ilimitado y solo para cuando tú lo dices.**Ya no necesitas pasar `--max-iterations 0`** para significar "ilimitado"; simplemente deja la flag fuera por completo. (La forma con `0` sigue siendo aceptada por compatibilidad.)
166
+
El Stop hook salta la llamada a Haiku por completo. Las únicas formas de salir se vuelven `--max-iterations` y `/watchdog:stop`. **`--max-iterations` es opcional** — si lo omites (como en el ejemplo de arriba), el bucle es verdaderamente ilimitado y solo para cuando tú lo dices.
167
167
168
168
El CLI `claude` ni siquiera es necesario en este modo (el subproceso de Haiku nunca se lanza). Compatible con `--prompt-file` y `--watch-prompt-file`. Mutuamente excluyente con `--exit-confirmations` — el contador del streak no tiene sentido cuando no hay un clasificador devolviendo veredictos.
169
169
@@ -317,7 +317,7 @@ Implementa la feature X usando TDD:
317
317
318
318
El subproceso clasificador no es infalible. Un agent atascado que no para de hacer ediciones sin sentido, o uno que se confunde y deja de editar antes de tiempo, debería caer en un tope duro. `--max-iterations 20` es un valor por defecto razonable para la mayoría del trabajo.
319
319
320
-
**Pero la flag es opcional**. Si genuinamente quieres un bucle ilimitado (por ejemplo, un bucle de mantenimiento de larga duración que pretendes detener manualmente con `/watchdog:stop`, o una ejecución `--no-classifier` donde la convergencia la juzgas tú, no Haiku), **simplemente omite la flag por completo**.**No** necesitas pasar `--max-iterations 0` — esa forma sigue siendo aceptada por compatibilidad, pero la manera natural de expresar "ilimitado" ahora es dejar la flag fuera.
320
+
**Pero la flag es opcional**. Si genuinamente quieres un bucle ilimitado (por ejemplo, un bucle de mantenimiento de larga duración que pretendes detener manualmente con `/watchdog:stop`, o una ejecución `--no-classifier` donde la convergencia la juzgas tú, no Haiku), **simplemente omite la flag por completo**.
Copy file name to clipboardExpand all lines: README.ko.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ ralph-loop 스타일로 어떤 LLM도 수렴을 판정하지 않도록 — 수
164
164
/watchdog:start "내가 /watchdog:stop할 때까지 계속 반복해." --no-classifier
165
165
```
166
166
167
-
Stop hook이 Haiku 호출을 **완전히 건너뜁니다**. 종료 수단은 `--max-iterations`와 `/watchdog:stop` 두 가지로 줄어듭니다. **`--max-iterations`는 선택입니다** — 위 예시처럼 생략하면 루프는 진짜로 무제한이 되고, 당신이 멈추라고 할 때까지만 돕니다. "무제한"을 의미하기 위해 `--max-iterations 0`을 전달할 **필요가 더 이상 없습니다** — 그냥 플래그를 빼세요. (`0` 형식은 하위 호환을 위해 여전히 허용됩니다.)
167
+
Stop hook이 Haiku 호출을 **완전히 건너뜁니다**. 종료 수단은 `--max-iterations`와 `/watchdog:stop` 두 가지로 줄어듭니다. **`--max-iterations`는 선택입니다** — 위 예시처럼 생략하면 루프는 진짜로 무제한이 되고, 당신이 멈추라고 할 때까지만 돕니다.
168
168
169
169
이 모드에서는 `claude` CLI조차 필요 없습니다(Haiku 서브프로세스가 절대 생성되지 않습니다). `--prompt-file`, `--watch-prompt-file`과 자유롭게 조합할 수 있습니다. **`--exit-confirmations`와는 함께 쓸 수 없습니다** — 분류기가 판정을 반환하지 않는 이상 streak 카운터는 의미가 없습니다.
170
170
@@ -318,7 +318,7 @@ TDD로 기능 X를 구현해주세요:
318
318
319
319
분류기 서브프로세스는 완벽하지 않습니다. 의미 없는 편집을 반복하며 멈추지 못하는 agent나, 헷갈려서 너무 일찍 편집을 중단해 버리는 agent는 결국 하드 스톱으로 떨어져야 합니다. 대부분의 작업에는 `--max-iterations 20`이 합리적인 기본값입니다.
320
320
321
-
**그래도 이 플래그는 선택사항입니다**. 정말로 무제한 루프를 원한다면(예: `/watchdog:stop`으로 수동 중지할 작정인 장기 유지보수 루프, 또는 Haiku가 아닌 본인이 수렴을 판정하는 `--no-classifier` 실행), **그냥 플래그를 빼세요**.`--max-iterations 0`을 전달할 **필요가 없습니다** — 그 형식은 하위 호환을 위해 여전히 허용되지만, "무제한"을 표현하는 자연스러운 방법은 이제 플래그를 빼는 것입니다.
321
+
**그래도 이 플래그는 선택사항입니다**. 정말로 무제한 루프를 원한다면(예: `/watchdog:stop`으로 수동 중지할 작정인 장기 유지보수 루프, 또는 Haiku가 아닌 본인이 수렴을 판정하는 `--no-classifier` 실행), **그냥 플래그를 빼세요**.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ For ralph-loop-style runs where you don't want any LLM judging convergence — y
163
163
/watchdog:start "Keep iterating until I /watchdog:stop." --no-classifier
164
164
```
165
165
166
-
The Stop hook skips the Haiku call entirely. The only ways to exit become `--max-iterations` and `/watchdog:stop`. **`--max-iterations` is optional** — if you omit it (as in the example above), the loop is truly unbounded and only stops when you say so. You no longer need to pass `--max-iterations 0` to mean "unlimited"; just leave the flag off entirely. (The `0` form is still accepted for backward compatibility.)
166
+
The Stop hook skips the Haiku call entirely. The only ways to exit become `--max-iterations` and `/watchdog:stop`. **`--max-iterations` is optional** — if you omit it (as in the example above), the loop is truly unbounded and only stops when you say so.
167
167
168
168
The `claude` CLI is not even required in this mode (the Haiku subprocess is never spawned). Compatible with `--prompt-file` and `--watch-prompt-file`. Mutually exclusive with `--exit-confirmations` — the streak counter is meaningless when there is no classifier returning verdicts.
169
169
@@ -317,7 +317,7 @@ Implement feature X using TDD:
317
317
318
318
The classifier subprocess is not infallible. A stuck agent that keeps making meaningless edits, or one that gets confused and stops editing prematurely, should fall through to a hard stop. `--max-iterations 20` is a reasonable default for most work.
319
319
320
-
**The flag is optional, though.** If you genuinely want an unlimited loop (e.g., a long-running maintenance loop you intend to stop manually with `/watchdog:stop`, or a `--no-classifier` run where convergence is judged by you, not Haiku), **just omit the flag entirely**. You do **not** need to pass `--max-iterations 0` — that form is still accepted for backward compatibility, but the natural way to express "unlimited" is now to leave the flag off.
320
+
**The flag is optional, though.** If you genuinely want an unlimited loop (e.g., a long-running maintenance loop you intend to stop manually with `/watchdog:stop`, or a `--no-classifier` run where convergence is judged by you, not Haiku), **just omit the flag entirely**.
Copy file name to clipboardExpand all lines: README.pt.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ Para execuções estilo ralph-loop onde você não quer nenhum LLM julgando conv
163
163
/watchdog:start "Continue iterando até eu /watchdog:stop." --no-classifier
164
164
```
165
165
166
-
O Stop hook pula a chamada ao Haiku completamente. As únicas formas de sair se tornam `--max-iterations` e `/watchdog:stop`. **`--max-iterations` é opcional** — se você omiti-lo (como no exemplo acima), o loop é verdadeiramente ilimitado e só para quando você manda.**Você não precisa mais passar `--max-iterations 0`** para significar "ilimitado"; basta deixar a flag de fora por completo. (A forma com `0` continua sendo aceita por compatibilidade.)
166
+
O Stop hook pula a chamada ao Haiku completamente. As únicas formas de sair se tornam `--max-iterations` e `/watchdog:stop`. **`--max-iterations` é opcional** — se você omiti-lo (como no exemplo acima), o loop é verdadeiramente ilimitado e só para quando você manda.
167
167
168
168
O CLI `claude` nem mesmo é necessário neste modo (o subprocesso Haiku nunca é spawned). Compatível com `--prompt-file` e `--watch-prompt-file`. **Mutuamente exclusivo com `--exit-confirmations`** — o contador de streak é sem sentido quando não há classificador retornando vereditos.
169
169
@@ -317,7 +317,7 @@ Implement feature X using TDD:
317
317
318
318
O subprocesso classificador não é infalível. Um agente travado que fica fazendo edições sem sentido, ou um que se perde e para de editar cedo demais, precisa cair num limite rígido. `--max-iterations 20` é um default razoável para a maior parte do trabalho.
319
319
320
-
**Mas a flag é opcional**. Se você genuinamente quer um loop ilimitado (por exemplo, um loop de manutenção de longa duração que você pretende parar manualmente com `/watchdog:stop`, ou uma execução `--no-classifier` onde a convergência é julgada por você, não pelo Haiku), **simplesmente omita a flag por completo**. Você **não** precisa passar `--max-iterations 0` — essa forma continua sendo aceita por compatibilidade, mas a maneira natural de expressar "ilimitado" agora é deixar a flag de fora.
320
+
**Mas a flag é opcional**. Se você genuinamente quer um loop ilimitado (por exemplo, um loop de manutenção de longa duração que você pretende parar manualmente com `/watchdog:stop`, ou uma execução `--no-classifier` onde a convergência é julgada por você, não pelo Haiku), **simplesmente omita a flag por completo**.
Copy file name to clipboardExpand all lines: README.vi.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ Cho các lần chạy kiểu ralph-loop mà bạn không muốn bất kỳ LLM n
163
163
/watchdog:start "Cứ lặp cho đến khi tôi /watchdog:stop." --no-classifier
164
164
```
165
165
166
-
Stop hook bỏ qua hoàn toàn lời gọi Haiku. Cách thoát duy nhất trở thành `--max-iterations` và `/watchdog:stop`. **`--max-iterations` là tùy chọn** — nếu bạn bỏ qua nó (như trong ví dụ trên), vòng lặp thực sự không giới hạn và chỉ dừng khi bạn ra lệnh.**Bạn không còn cần truyền `--max-iterations 0`** để có nghĩa là "không giới hạn"; chỉ cần bỏ flag đó hoàn toàn. (Dạng `0` vẫn được chấp nhận vì lý do tương thích ngược.)
166
+
Stop hook bỏ qua hoàn toàn lời gọi Haiku. Cách thoát duy nhất trở thành `--max-iterations` và `/watchdog:stop`. **`--max-iterations` là tùy chọn** — nếu bạn bỏ qua nó (như trong ví dụ trên), vòng lặp thực sự không giới hạn và chỉ dừng khi bạn ra lệnh.
167
167
168
168
CLI `claude` thậm chí không cần thiết trong chế độ này (subprocess Haiku không bao giờ được spawn). Tương thích với `--prompt-file` và `--watch-prompt-file`. **Không tương thích với `--exit-confirmations`** — bộ đếm streak vô nghĩa khi không có bộ phân loại trả về kết luận.
169
169
@@ -317,7 +317,7 @@ Implement feature X using TDD:
317
317
318
318
Classifier subprocess không phải là thánh. Một agent bị kẹt mà cứ loay hoay sửa linh tinh vô nghĩa, hoặc một agent bị rối rồi ngừng sửa quá sớm, đều cần rơi vào một cú dừng cứng. `--max-iterations 20` là một mặc định hợp lý cho hầu hết công việc.
319
319
320
-
**Tuy nhiên flag này là tùy chọn**. Nếu bạn thực sự muốn vòng lặp không giới hạn (ví dụ: một vòng lặp bảo trì chạy lâu mà bạn định dừng thủ công bằng `/watchdog:stop`, hoặc một lần chạy `--no-classifier` mà việc hội tụ do bạn — không phải Haiku — đánh giá), **chỉ cần bỏ flag hoàn toàn**. Bạn **không** cần truyền `--max-iterations 0` — dạng đó vẫn được chấp nhận vì lý do tương thích ngược, nhưng cách tự nhiên để biểu đạt "không giới hạn" giờ đây là không truyền flag.
320
+
**Tuy nhiên flag này là tùy chọn**. Nếu bạn thực sự muốn vòng lặp không giới hạn (ví dụ: một vòng lặp bảo trì chạy lâu mà bạn định dừng thủ công bằng `/watchdog:stop`, hoặc một lần chạy `--no-classifier` mà việc hội tụ do bạn — không phải Haiku — đánh giá), **chỉ cần bỏ flag hoàn toàn**.
Copy file name to clipboardExpand all lines: commands/help.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Start a Watchdog in the current session.
46
46
47
47
**Options:**
48
48
49
-
-`--max-iterations <n>` — **optional safety cap**. If passed, the loop exits after N iterations no matter what. **If you don't pass it, the loop is unlimited** — it will only exit via convergence (Haiku verdict + `--exit-confirmations`) or `/watchdog:stop` (or, under `--no-classifier`, only via `/watchdog:stop`). Recommended for most tasks: `--max-iterations 20`. You no longer need to pass `--max-iterations 0` to mean "unlimited" — just omit the flag entirely (the `0` form is still accepted for backward compatibility).
49
+
-`--max-iterations <n>` — **optional safety cap**. If passed, the loop exits after N iterations no matter what. **If you don't pass it, the loop is unlimited** — it will only exit via convergence (Haiku verdict + `--exit-confirmations`) or `/watchdog:stop` (or, under `--no-classifier`, only via `/watchdog:stop`). Recommended for most tasks: `--max-iterations 20`. To express "unlimited", just leave the flag off entirely.
50
50
-`--exit-confirmations <n>` — require **N consecutive**`NO_FILE_CHANGES` verdicts from the Haiku classifier before allowing the loop to exit. Default `1` (exit on the first clean verdict, identical to pre-1.3.0 behavior). Use a higher value when you want belt-and-suspenders confirmation that the work is really done — for example `--exit-confirmations 3` means the agent must finish three turns in a row without modifying any project file.
51
51
52
52
**Strict reset semantics:** the streak counter is reset to `0` whenever the Haiku classifier returns anything other than a clean `NO_FILE_CHANGES` verdict — that includes `FILE_CHANGES`, `AMBIGUOUS`, `CLI_MISSING`, `CLI_FAILED`, or a pure-text turn (no tool invocations). Convergence has to be **unbroken** to count.
@@ -111,7 +111,7 @@ The state file is keyed by the **parent Claude Code process ID**, which Watchdog
111
111
-**Clear completion criteria** — "no more edits needed" must be a verifiable answer, not subjective. Tie it to passing tests, a clean typecheck, zero lint errors, etc.
112
112
-**Incremental verifiable goals** — if there's no verifiable end state, the loop will just spin.
113
113
-**Self-correcting structure** — tell Claude how to notice failure and adapt.
114
-
-**Set `--max-iterations` for most tasks** — even if the Haiku classifier is reliable, a stuck agent should fall through to a hard stop. `--max-iterations 20` is a reasonable default. **Omit the flag entirely** if you genuinely want unlimited iterations (e.g., a long-running maintenance loop you intend to stop manually with `/watchdog:stop`); you do **not** need to pass `--max-iterations 0`.
114
+
-**Set `--max-iterations` for most tasks** — even if the Haiku classifier is reliable, a stuck agent should fall through to a hard stop. `--max-iterations 20` is a reasonable default. **Omit the flag entirely** if you genuinely want unlimited iterations (e.g., a long-running maintenance loop you intend to stop manually with `/watchdog:stop`).
0 commit comments