Skip to content

Commit 93bb63c

Browse files
JonyanDunhclaude
andauthored
feat: --prompt-file flag to read long prompts from disk (v1.2.4) (#13)
Add a new `--prompt-file <path>` argument to `/watchdog:start` so users can pass multi-paragraph prompts (Markdown task specs with headings, code fences, quoted strings, etc.) without mangling them through shell- argument escaping. ## Problem Slash command `!` shell blocks invoke setup-watchdog.js via `$ARGUMENTS` literal substitution. Any unescaped `"`, backtick, `$`, or newline in the user's inline prompt breaks bash parsing with `unexpected EOF`. In practice this hits every realistic multi-paragraph Markdown prompt the moment a user pastes it into `/watchdog:start "..."`. ralph-loop (from which watchdog is derived) has the same failure mode and does not provide a file or stdin fallback. ## Solution New `--prompt-file <path>` flag in scripts/setup-watchdog.js. The file is read directly with Node's `fs.readFileSync`, bypassing shell argument parsing entirely. Mutually exclusive with an inline `<PROMPT>` positional — pick one or the other. Path handling is delegated to `path.resolve()`, which is platform- aware: - Linux/macOS/WSL POSIX paths (absolute + relative, `./name`, `../name`) - Windows `C:\...`, `C:/...`, and UNC `\\server\share\...` paths - Relative paths resolve against `process.cwd()` on every platform Leading UTF-8 BOM is stripped automatically — Windows Notepad and PowerShell's default `Set-Content` silently prepend U+FEFF to UTF-8 files, and `.trim()` does not remove it (BOM is not whitespace), so without this Claude would see an invisible zero-width marker as the first character of the prompt. CRLF line endings inside the content are preserved byte-for-byte. `~` is NOT expanded by watchdog — that is the shell's job, and bash/zsh already expand it before the args reach the script. `cmd.exe` users should pass an absolute path or `%USERPROFILE%\...`. Error paths return clean messages: - ENOENT => "prompt file not found: <resolved>" - EISDIR => "--prompt-file expects a file, got a directory: <resolved>" - EACCES/EPERM => "permission denied reading prompt file: <resolved>" - empty file => "prompt file is empty: <resolved>" - missing arg => "--prompt-file requires a path argument" - combined with inline => "--prompt-file cannot be combined with a positional prompt" ## What changed - scripts/setup-watchdog.js — parseArgs() recognizes --prompt-file, new readPromptFile() helper centralizes file read + BOM strip + error mapping, main() enforces mutual exclusion - commands/start.md — argument-hint updated to show the alternate form - commands/help.md — new --prompt-file option with the full path- handling reference (POSIX / Windows / UNC / BOM / CRLF / spaces / encoding / ~ expansion) - test/setup.test.js — +17 tests: happy path, shell metacharacters in content, whitespace trimming, UTF-8 BOM strip, relative path, ./name relative path, CRLF content, non-ASCII filename, symlink following (non-Windows), permission denied (non-Windows non-root), missing file, directory target, empty file, missing path arg, mutual exclusion with inline, help text listing new form - README.{md,zh,es,ja,ko,vi,pt}.md — new "Long prompts from a file" subsection under Commands, plus a new "Prompt input" row in the Watchdog vs ralph-loop comparison table - .claude-plugin/plugin.json — version => 1.2.4 - .claude-plugin/marketplace.json — version => 1.2.4 (both the plugin entry and the marketplace top-level) ## Test plan - [x] 96-test suite passes locally (94 active + 2 skipped-inside- Claude-Code, 0 failures) - [x] setup.test.js: 27 tests — 26 active + 1 pre-existing skip - [x] Root cause debugged by reproducing the real bash `unexpected EOF` on a pasted multi-paragraph Markdown prompt - [ ] CI will confirm on the standard matrix (ubuntu/macos/windows × Node 18/20/22) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cc2d6d0 commit 93bb63c

13 files changed

Lines changed: 438 additions & 7 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"name": "watchdog",
1212
"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.",
13-
"version": "1.2.3",
13+
"version": "1.2.4",
1414
"author": {
1515
"name": "Jonyan Dunh",
1616
"email": "jonyandunh@outlook.com"
@@ -30,5 +30,5 @@
3030
]
3131
}
3232
],
33-
"version": "1.2.3"
33+
"version": "1.2.4"
3434
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "watchdog",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Self-referential loop for Claude Code. Re-feeds the same prompt after every turn until files actually stop changing.",
55
"author": {
66
"name": "Jonyan Dunh",

README.es.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ Si alguna de las dos falla, el bucle continúa. Rutas de salida adicionales:
117117
| `/watchdog:stop` | Cancela el watchdog de la sesión actual | `/watchdog:stop` |
118118
| `/watchdog:help` | Imprime la referencia completa dentro de Claude Code | `/watchdog:help` |
119119

120+
### Prompts largos desde un archivo
121+
122+
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:
123+
124+
```bash
125+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
126+
```
127+
128+
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.
129+
130+
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`.
131+
120132
---
121133

122134
## Archivo de estado
@@ -414,6 +426,7 @@ Watchdog mantiene el mecanismo central — un `Stop hook` que vuelve a inyectar
414426
| **Á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 |
415427
| **Formato del archivo de estado** | JSON (parseado con `JSON.parse` nativo) | Markdown con frontmatter YAML (parseado con sed/awk/grep) |
416428
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
429+
| **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. |
417430

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

README.ja.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ _`Watchdog` は `Claude Code` のプラグインです。同一セッション
118118
| `/watchdog:stop` | 現在のセッションの watchdog をキャンセル | `/watchdog:stop` |
119119
| `/watchdog:help` | Claude Code 内で完全なリファレンスを表示 | `/watchdog:help` |
120120

121+
### ファイルから長い prompt を渡す
122+
123+
プロンプトに改行、引用符、バッククォート、`$`、その他 slash command の `!` ブロック内でシェル引数解析を壊す文字が含まれる場合——たとえば複数段落の Markdown タスク仕様など——ファイルとして渡してください:
124+
125+
```bash
126+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
127+
```
128+
129+
ファイルは Node が `fs.readFileSync` で直接読み込むので、シェルのエスケープを完全に回避します。相対パスは Claude Code セッションのカレントワーキングディレクトリを基準に解決されます。UTF-8 BOM は自動的に除去され(Windows メモ帳で保存したファイルでも安全)、CRLF はバイト単位でそのまま保持され、先頭/末尾の空白はトリムされます。**インラインの `<PROMPT>` とは併用できません**——どちらか一方を選んでください。
130+
131+
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` を参照してください。
132+
121133
---
122134

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

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

README.ko.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ _`Claude Code` 플러그인입니다. 하나의 세션 안에서 현재 agent를
118118
| `/watchdog:stop` | 현재 세션의 watchdog 취소 | `/watchdog:stop` |
119119
| `/watchdog:help` | `Claude Code` 안에서 전체 레퍼런스 출력 | `/watchdog:help` |
120120

121+
### 파일로 긴 prompt 전달하기
122+
123+
prompt 안에 줄바꿈, 따옴표, 백틱, `$` 또는 슬래시 커맨드 `!` 블록 내부의 셸 인자 파싱을 깨뜨릴 만한 문자가 들어있다면 — 예를 들어 여러 단락짜리 Markdown 작업 명세 — 파일로 전달하세요:
124+
125+
```bash
126+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
127+
```
128+
129+
파일은 Node가 `fs.readFileSync`로 직접 읽기 때문에 셸 이스케이프를 완전히 우회합니다. 상대 경로는 Claude Code 세션의 현재 작업 디렉터리를 기준으로 해석됩니다. UTF-8 BOM은 자동으로 제거되며(Windows 메모장으로 저장한 파일도 안전), CRLF 내용은 바이트 단위로 보존되고, 앞뒤 공백은 잘립니다. **인라인 `<PROMPT>`와 함께 쓸 수 없습니다** — 둘 중 하나만 고르세요.
130+
131+
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`를 참고하세요.
132+
121133
---
122134

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

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

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ If either check fails, the loop continues. Additional exit paths:
117117
| `/watchdog:stop` | Cancel the watchdog in the current session | `/watchdog:stop` |
118118
| `/watchdog:help` | Print the full reference inside Claude Code | `/watchdog:help` |
119119

120+
### Long prompts from a file
121+
122+
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:
123+
124+
```bash
125+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
126+
```
127+
128+
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.
129+
130+
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.
131+
120132
---
121133

122134
## State File
@@ -414,6 +426,7 @@ Watchdog keeps the core mechanic — a Stop hook that re-feeds the prompt — an
414426
| **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 |
415427
| **State file format** | JSON (parsed with native `JSON.parse`) | Markdown with YAML frontmatter (parsed with sed/awk/grep) |
416428
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
429+
| **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. |
417430

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

README.pt.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ Se qualquer uma das duas falhar, o loop continua. Outras formas de sair:
117117
| `/watchdog:stop` | Cancela o watchdog da sessão atual | `/watchdog:stop` |
118118
| `/watchdog:help` | Mostra a referência completa dentro do `Claude Code` | `/watchdog:help` |
119119

120+
### Prompts longos a partir de um arquivo
121+
122+
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:
123+
124+
```bash
125+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
126+
```
127+
128+
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.
129+
130+
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.
131+
120132
---
121133

122134
## Arquivo de estado
@@ -414,6 +426,7 @@ O Watchdog mantém a mecânica principal — um Stop hook que reinjeta o prompt
414426
| **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 |
415427
| **Formato do arquivo de estado** | JSON (parseado com `JSON.parse` nativo) | Markdown com frontmatter YAML (parseado com sed/awk/grep) |
416428
| **Runtime** | Node.js 18+ | Bash + jq + POSIX coreutils |
429+
| **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. |
417430

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

README.vi.md

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

120+
### Prompt dài từ file
121+
122+
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:
123+
124+
```bash
125+
/watchdog:start --prompt-file ./tmp/my-task.md --max-iterations 20
126+
```
127+
128+
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.
129+
130+
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.
131+
120132
---
121133

122134
## File trạng thái
@@ -414,6 +426,7 @@ Watchdog giữ nguyên cơ chế cốt lõi — một Stop hook nạp lại prom
414426
| **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 |
415427
| **Đị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) |
416428
| **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 |
429+
| **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 đã. |
417430

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

0 commit comments

Comments
 (0)