Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"name": "watchdog",
"description": "Self-referential loop for Claude Code that re-feeds the user's prompt until the task truly stops producing file edits. Uses a headless Haiku classifier to judge convergence, requires the agent to actually call tools before exit (no pure-text 'done' claims), and is hidden from the agent so it cannot cheat. Apache 2.0, derived from ralph-loop.",
"version": "1.2.3",
"version": "1.2.4",
"author": {
"name": "Jonyan Dunh",
"email": "jonyandunh@outlook.com"
Expand All @@ -30,5 +30,5 @@
]
}
],
"version": "1.2.3"
"version": "1.2.4"
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "watchdog",
"version": "1.2.3",
"version": "1.2.4",
"description": "Self-referential loop for Claude Code. Re-feeds the same prompt after every turn until files actually stop changing.",
"author": {
"name": "Jonyan Dunh",
Expand Down
13 changes: 13 additions & 0 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ Si alguna de las dos falla, el bucle continúa. Rutas de salida adicionales:
| `/watchdog:stop` | Cancela el watchdog de la sesión actual | `/watchdog:stop` |
| `/watchdog:help` | Imprime la referencia completa dentro de Claude Code | `/watchdog:help` |

### Prompts largos desde un archivo

Si tu prompt contiene saltos de línea, comillas, backticks, `$` u otros caracteres que romperían el análisis de argumentos del shell dentro del bloque `!` del slash command — por ejemplo una especificación de tarea en Markdown con varios párrafos — pásalo como un archivo:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

El archivo lo lee Node directamente con `fs.readFileSync`, sin pasar por el escape del shell. Las rutas relativas se resuelven respecto al directorio de trabajo actual de la sesión de Claude Code. El BOM UTF-8 se elimina automáticamente (los archivos del Bloc de notas de Windows son seguros), el contenido CRLF se conserva byte a byte, y los espacios al inicio/final se recortan. **No se puede combinar con un `<PROMPT>` inline** — elige uno u otro.

Funciona con rutas POSIX en Linux/macOS/WSL (`/home/tu/…`, `./tmp/…`), rutas absolutas de Windows (`C:\Users\tu\…`, `C:/Users/tu/…`) y rutas UNC (`\\server\share\…`). El `~` lo expande tu shell (bash/zsh), no Watchdog — en `cmd.exe` usa `%USERPROFILE%\…` o una ruta absoluta. Las rutas con espacios deben ir entre comillas como cualquier otro argumento del shell: `--prompt-file "./my prompts/task.md"`. Para la referencia completa del manejo de rutas, consulta `/watchdog:help`.

---

## Archivo de estado
Expand Down Expand Up @@ -414,6 +426,7 @@ Watchdog mantiene el mecanismo central — un `Stop hook` que vuelve a inyectar
| **Ámbito del estado** | Un archivo de estado por cada sesión de Claude Code — sin límite de watchdogs concurrentes en el mismo proyecto | Un solo archivo de estado por proyecto — solo UN ralph-loop puede correr por proyecto a la vez |
| **Formato del archivo de estado** | JSON (parseado con `JSON.parse` nativo) | Markdown con frontmatter YAML (parseado con sed/awk/grep) |
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
| **Entrada del prompt** | Inline vía `$ARGUMENTS`, **o** `--prompt-file <path>` — lee el archivo directamente con `fs.readFileSync` de Node, **saltándose por completo el análisis de argumentos del shell**. Seguro para Markdown de varios párrafos con saltos de línea, comillas, backticks, `$`, etc. El BOM UTF-8 se elimina automáticamente; CRLF se preserva byte a byte. | Solo inline vía `$ARGUMENTS` en el bloque `!` del shell del slash command. Cualquier `"`, `` ` ``, `$` o salto de línea sin escapar en el prompt rompe el parser de `bash` con `unexpected EOF`. Sin fallback a archivo ni a stdin — las especificaciones de tareas Markdown de varios párrafos deben convertirse primero en una cadena de una sola línea segura para el shell. |

Ver [`NOTICE`](./NOTICE) para la atribución completa y el listado detallado de modificaciones.

Expand Down
13 changes: 13 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ _`Watchdog` は `Claude Code` のプラグインです。同一セッション
| `/watchdog:stop` | 現在のセッションの watchdog をキャンセル | `/watchdog:stop` |
| `/watchdog:help` | Claude Code 内で完全なリファレンスを表示 | `/watchdog:help` |

### ファイルから長い prompt を渡す

プロンプトに改行、引用符、バッククォート、`$`、その他 slash command の `!` ブロック内でシェル引数解析を壊す文字が含まれる場合——たとえば複数段落の Markdown タスク仕様など——ファイルとして渡してください:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

ファイルは Node が `fs.readFileSync` で直接読み込むので、シェルのエスケープを完全に回避します。相対パスは Claude Code セッションのカレントワーキングディレクトリを基準に解決されます。UTF-8 BOM は自動的に除去され(Windows メモ帳で保存したファイルでも安全)、CRLF はバイト単位でそのまま保持され、先頭/末尾の空白はトリムされます。**インラインの `<PROMPT>` とは併用できません**——どちらか一方を選んでください。

Linux/macOS/WSL の POSIX パス(`/home/you/…`、`./tmp/…`)、Windows 絶対パス(`C:\Users\you\…`、`C:/Users/you/…`)、UNC パス(`\\server\share\…`)のすべてに対応しています。`~` はシェル(bash/zsh)が展開するので、Watchdog 側では処理しません——`cmd.exe` では `%USERPROFILE%\…` か絶対パスを使ってください。スペースを含むパスは他のシェル引数と同様に引用符で囲む必要があります:`--prompt-file "./my prompts/task.md"`。パス処理の完全なリファレンスは `/watchdog:help` を参照してください。

---

## 状態ファイル
Expand Down Expand Up @@ -415,6 +427,7 @@ Watchdog はコアの仕組み(prompt を再投入する Stop hook)は引き
| **状態のスコープ** | Claude Code セッションごとに 1 つの状態ファイル —— 同じプロジェクトで並行 watchdog を何個でも走らせられる | プロジェクトに状態ファイルは 1 つだけ —— 1 つのプロジェクトで同時に走らせられる ralph-loop は 1 つだけ |
| **状態ファイルの形式** | JSON(ネイティブの `JSON.parse` でパース) | YAML frontmatter 付き Markdown(sed/awk/grep でパース) |
| **ランタイム** | Node.js 18+ —— クロスプラットフォーム(Linux、macOS、ネイティブ Windows) | Bash + jq + POSIX coreutils —— Unix 専用 |
| **prompt 入力方式** | `$ARGUMENTS` によるインライン、**または** `--prompt-file <path>` —— Node の `fs.readFileSync` でファイルを直接読み込み、**シェルの引数解析を完全に回避します**。複数段落の Markdown に含まれる改行、引用符、バッククォート、`$` などを安全に渡せます。UTF-8 BOM は自動的に除去され、CRLF はバイト単位でそのまま保持されます。 | slash command の `!` シェルブロック内の `$ARGUMENTS` によるインライン入力のみ。prompt にエスケープされていない `"`、`` ` ``、`$`、改行が一つでもあると `bash` の解析が `unexpected EOF` で失敗します。ファイルや stdin のフォールバックはなく、複数段落の Markdown タスク仕様はシェルで安全な 1 行文字列に変換しないと使えません。 |

完全な帰属表示と変更一覧は [`NOTICE`](./NOTICE) を参照してください。

Expand Down
13 changes: 13 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ _`Claude Code` 플러그인입니다. 하나의 세션 안에서 현재 agent를
| `/watchdog:stop` | 현재 세션의 watchdog 취소 | `/watchdog:stop` |
| `/watchdog:help` | `Claude Code` 안에서 전체 레퍼런스 출력 | `/watchdog:help` |

### 파일로 긴 prompt 전달하기

prompt 안에 줄바꿈, 따옴표, 백틱, `$` 또는 슬래시 커맨드 `!` 블록 내부의 셸 인자 파싱을 깨뜨릴 만한 문자가 들어있다면 — 예를 들어 여러 단락짜리 Markdown 작업 명세 — 파일로 전달하세요:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

파일은 Node가 `fs.readFileSync`로 직접 읽기 때문에 셸 이스케이프를 완전히 우회합니다. 상대 경로는 Claude Code 세션의 현재 작업 디렉터리를 기준으로 해석됩니다. UTF-8 BOM은 자동으로 제거되며(Windows 메모장으로 저장한 파일도 안전), CRLF 내용은 바이트 단위로 보존되고, 앞뒤 공백은 잘립니다. **인라인 `<PROMPT>`와 함께 쓸 수 없습니다** — 둘 중 하나만 고르세요.

Linux/macOS/WSL의 POSIX 경로(`/home/you/…`, `./tmp/…`), Windows 절대 경로(`C:\Users\you\…`, `C:/Users/you/…`), UNC 경로(`\\server\share\…`)를 모두 지원합니다. `~`는 Watchdog이 아니라 셸(bash/zsh)이 확장합니다 — `cmd.exe`에서는 `%USERPROFILE%\…` 또는 절대 경로를 사용하세요. 공백이 들어간 경로는 다른 셸 인자처럼 따옴표로 감싸야 합니다: `--prompt-file "./my prompts/task.md"`. 경로 처리에 대한 전체 레퍼런스는 `/watchdog:help`를 참고하세요.

---

## 상태 파일
Expand Down Expand Up @@ -415,6 +427,7 @@ Watchdog은 핵심 메커니즘(prompt를 다시 먹여주는 `Stop hook`)을
| **상태 범위** | Claude Code 세션마다 상태 파일 하나씩 — 같은 프로젝트에서 동시에 원하는 만큼 watchdog을 돌릴 수 있습니다 | 프로젝트당 상태 파일 하나 — 한 프로젝트에서 동시에 돌릴 수 있는 ralph-loop는 하나뿐입니다 |
| **상태 파일 포맷** | JSON (네이티브 `JSON.parse`로 파싱) | YAML frontmatter가 있는 Markdown (sed/awk/grep으로 파싱) |
| **런타임** | Node.js 18+ — 크로스 플랫폼 (Linux, macOS, 네이티브 Windows) | Bash + jq + POSIX coreutils — Unix 전용 |
| **prompt 입력 방식** | `$ARGUMENTS` 인라인, **또는** `--prompt-file <path>` — Node의 `fs.readFileSync`로 파일을 직접 읽어 **셸 인자 파싱을 완전히 우회합니다**. 여러 단락짜리 Markdown에 들어 있는 줄바꿈, 따옴표, 백틱, `$` 같은 문자를 안전하게 전달할 수 있습니다. UTF-8 BOM은 자동으로 제거되고 CRLF는 바이트 단위로 그대로 보존됩니다. | 슬래시 커맨드 `!` 셸 블록 안의 `$ARGUMENTS`를 통한 인라인 입력만 지원합니다. prompt에 이스케이프되지 않은 `"`, `` ` ``, `$` 또는 줄바꿈이 하나라도 있으면 `bash` 파싱이 `unexpected EOF`로 실패합니다. 파일이나 stdin 대체 경로가 없기 때문에, 여러 단락짜리 Markdown 작업 명세는 먼저 셸 안전한 한 줄 문자열로 압축해야 합니다. |

전체 출처 표기와 수정 내역 전체는 [`NOTICE`](./NOTICE)를 참고하세요.

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ If either check fails, the loop continues. Additional exit paths:
| `/watchdog:stop` | Cancel the watchdog in the current session | `/watchdog:stop` |
| `/watchdog:help` | Print the full reference inside Claude Code | `/watchdog:help` |

### Long prompts from a file

If your prompt contains newlines, quotes, backticks, `$`, or other characters that would break shell-argument parsing inside the slash command's `!` block — for example a multi-paragraph Markdown task spec — pass it as a file instead:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

The file is read directly by Node (`fs.readFileSync`), bypassing shell escaping entirely. Relative paths resolve against the Claude Code session's current working directory. UTF-8 BOM is stripped automatically (so Windows Notepad files are safe), CRLF content is preserved byte-for-byte, and leading/trailing whitespace is trimmed. Mutually exclusive with an inline `<PROMPT>` — pick one or the other.

Works with Linux/macOS/WSL POSIX paths (`/home/you/…`, `./tmp/…`), Windows absolute paths (`C:\Users\you\…`, `C:/Users/you/…`), and UNC paths (`\\server\share\…`). `~` is expanded by your shell (bash/zsh), not by Watchdog — on `cmd.exe` use `%USERPROFILE%\…` or an absolute path. Paths with spaces must be quoted as usual: `--prompt-file "./my prompts/task.md"`. See `/watchdog:help` for the full path-handling reference.

---

## State File
Expand Down Expand Up @@ -414,6 +426,7 @@ Watchdog keeps the core mechanic — a Stop hook that re-feeds the prompt — an
| **State scoping** | One state file per Claude Code session — unlimited concurrent watchdogs in the same project | One state file per project — only ONE ralph-loop can run per project at a time |
| **State file format** | JSON (parsed with native `JSON.parse`) | Markdown with YAML frontmatter (parsed with sed/awk/grep) |
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
| **Prompt input** | Inline via `$ARGUMENTS`, **or** `--prompt-file <path>` — reads the file directly with Node's `fs.readFileSync`, bypassing shell argument parsing entirely. Safe for multi-paragraph Markdown containing newlines, quotes, backticks, `$`, etc. UTF-8 BOM is stripped automatically; CRLF is preserved byte-for-byte. | Inline via `$ARGUMENTS` in the slash command's `!` shell block only. Any unescaped `"`, `` ` ``, `$`, or newline in the prompt breaks `bash` parsing with `unexpected EOF`. No file or stdin fallback — multi-paragraph Markdown task specs must be mangled into a single-line, shell-safe string first. |

See [`NOTICE`](./NOTICE) for the full attribution and the complete list of modifications.

Expand Down
13 changes: 13 additions & 0 deletions README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ Se qualquer uma das duas falhar, o loop continua. Outras formas de sair:
| `/watchdog:stop` | Cancela o watchdog da sessão atual | `/watchdog:stop` |
| `/watchdog:help` | Mostra a referência completa dentro do `Claude Code` | `/watchdog:help` |

### Prompts longos a partir de um arquivo

Se seu prompt contiver quebras de linha, aspas, crases, `$` ou outros caracteres que quebrariam o parser de argumentos do shell dentro do bloco `!` do slash command — por exemplo uma especificação de tarefa em Markdown com vários parágrafos — passe-o como um arquivo:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

O arquivo é lido diretamente pelo Node com `fs.readFileSync`, ignorando totalmente o escape do shell. Caminhos relativos são resolvidos a partir do diretório de trabalho atual da sessão do Claude Code. O BOM UTF-8 é removido automaticamente (arquivos do Bloco de Notas do Windows são seguros), o conteúdo CRLF é preservado byte a byte, e espaços em branco no início/fim são aparados. **Não pode ser combinado com um `<PROMPT>` inline** — escolha um ou outro.

Funciona com caminhos POSIX em Linux/macOS/WSL (`/home/voce/…`, `./tmp/…`), caminhos absolutos do Windows (`C:\Users\voce\…`, `C:/Users/voce/…`) e caminhos UNC (`\\server\share\…`). O `~` é expandido pelo seu shell (bash/zsh), não pelo Watchdog — no `cmd.exe` use `%USERPROFILE%\…` ou um caminho absoluto. Caminhos com espaços precisam ser colocados entre aspas, como qualquer outro argumento de shell: `--prompt-file "./my prompts/task.md"`. Veja `/watchdog:help` para a referência completa de tratamento de caminhos.

---

## Arquivo de estado
Expand Down Expand Up @@ -414,6 +426,7 @@ O Watchdog mantém a mecânica principal — um Stop hook que reinjeta o prompt
| **Escopo do estado** | Um arquivo de estado por sessão do Claude Code — quantos watchdogs simultâneos quiser no mesmo projeto | Um único arquivo de estado por projeto — só UM ralph-loop roda por projeto de cada vez |
| **Formato do arquivo de estado** | JSON (parseado com `JSON.parse` nativo) | Markdown com frontmatter YAML (parseado com sed/awk/grep) |
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
| **Entrada do prompt** | Inline via `$ARGUMENTS`, **ou** `--prompt-file <path>` — lê o arquivo diretamente com `fs.readFileSync` do Node, **ignorando totalmente o parser de argumentos do shell**. Seguro para Markdown de vários parágrafos contendo quebras de linha, aspas, crases, `$`, etc. O BOM UTF-8 é removido automaticamente; CRLF é preservado byte a byte. | Apenas inline via `$ARGUMENTS` no bloco `!` do shell do slash command. Qualquer `"`, `` ` ``, `$` ou quebra de linha sem escape no prompt quebra o parser do `bash` com `unexpected EOF`. Sem fallback para arquivo ou stdin — especificações de tarefa em Markdown com vários parágrafos precisam ser convertidas antes em uma string de uma única linha segura para o shell. |

Veja o [`NOTICE`](./NOTICE) pra atribuição completa e a lista total de modificações.

Expand Down
13 changes: 13 additions & 0 deletions README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ Chỉ cần một trong hai sai là loop tiếp tục. Các đường thoát kh
| `/watchdog:stop` | Huỷ watchdog trong session hiện tại | `/watchdog:stop` |
| `/watchdog:help` | In bản tham chiếu đầy đủ ngay trong Claude Code | `/watchdog:help` |

### Prompt dài từ file

Nếu prompt của bạn chứa xuống dòng, dấu ngoặc kép, backtick, `$` hoặc các ký tự khác có thể phá vỡ việc phân tích đối số shell trong khối `!` của slash command — ví dụ một bản mô tả nhiệm vụ Markdown nhiều đoạn — hãy truyền nó dưới dạng file:

```bash
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
```

File được Node đọc trực tiếp bằng `fs.readFileSync`, hoàn toàn bỏ qua escape của shell. Đường dẫn tương đối được phân giải theo thư mục làm việc hiện tại của session Claude Code. UTF-8 BOM được tự động loại bỏ (file lưu bằng Notepad trên Windows vẫn an toàn), nội dung CRLF được giữ nguyên từng byte, và khoảng trắng đầu/cuối sẽ bị cắt. **Không thể dùng cùng lúc với `<PROMPT>` nội tuyến** — chọn một trong hai.

Hỗ trợ đường dẫn POSIX trên Linux/macOS/WSL (`/home/you/…`, `./tmp/…`), đường dẫn tuyệt đối trên Windows (`C:\Users\you\…`, `C:/Users/you/…`) và đường dẫn UNC (`\\server\share\…`). `~` được shell (bash/zsh) mở rộng chứ không phải Watchdog — trên `cmd.exe` hãy dùng `%USERPROFILE%\…` hoặc đường dẫn tuyệt đối. Đường dẫn có dấu cách phải được đặt trong dấu nháy như mọi tham số shell khác: `--prompt-file "./my prompts/task.md"`. Xem `/watchdog:help` để có tham chiếu đầy đủ về xử lý đường dẫn.

---

## File trạng thái
Expand Down Expand Up @@ -414,6 +426,7 @@ Watchdog giữ nguyên cơ chế cốt lõi — một Stop hook nạp lại prom
| **Phạm vi trạng thái** | Mỗi session Claude Code một file trạng thái riêng — cùng một project muốn chạy bao nhiêu watchdog song song cũng được | Cả project chỉ một file trạng thái — cùng một project tại một thời điểm chỉ chạy được MỘT ralph-loop |
| **Định dạng file trạng thái** | JSON (parse bằng `JSON.parse` native) | Markdown với YAML frontmatter (parse bằng sed/awk/grep) |
| **Runtime** | Node.js 18+ — đa nền tảng (Linux, macOS, Windows nguyên bản) | Bash + jq + POSIX coreutils — chỉ chạy trên Unix |
| **Cách truyền prompt** | Inline qua `$ARGUMENTS`, **hoặc** `--prompt-file <path>` — đọc file trực tiếp bằng `fs.readFileSync` của Node, **bỏ qua hoàn toàn việc phân tích đối số shell**. An toàn cho Markdown nhiều đoạn chứa xuống dòng, dấu ngoặc kép, backtick, `$`, v.v. UTF-8 BOM được tự động loại bỏ; CRLF được giữ nguyên từng byte. | Chỉ inline qua `$ARGUMENTS` trong khối shell `!` của slash command. Bất kỳ `"`, `` ` ``, `$` hoặc xuống dòng nào chưa được escape trong prompt đều làm `bash` báo `unexpected EOF`. Không có dự phòng bằng file hay stdin — các mô tả nhiệm vụ Markdown nhiều đoạn phải được ép thành một chuỗi một dòng an toàn với shell trước đã. |

Xem [`NOTICE`](./NOTICE) để biết ghi nhận đầy đủ và danh sách thay đổi chi tiết.

Expand Down
Loading
Loading