From 2c7d83246d18d28df849567769c707942d3a5945 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 12 Feb 2026 11:25:16 +0800 Subject: [PATCH] docs: fix broken script references in subagent.md Remove references to non-existent scripts/agent-send.ts and scripts/ralph.ts. Replace with equivalent tmux commands that work without external scripts, and generalize the Ralph section into a reusable 'Supervisor Loop Pattern'. Fixes #6 --- docs/subagent.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/subagent.md b/docs/subagent.md index d0ba982..2a1132d 100644 --- a/docs/subagent.md +++ b/docs/subagent.md @@ -15,25 +15,23 @@ read_when: ``` Once inside the session, run `/model` to confirm the active alias (`haiku` maps to Claude 3.5 Haiku) and switch models if needed. -- Need to queue instructions without attaching? Use `bun scripts/agent-send.ts --session -- "your command"` to inject text into a running agent session (single Enter is sent by default). +- Need to queue instructions without attaching? Use `tmux send-keys -t "your command" Enter` to inject text into a running agent session. - Always switch to the fast Haiku model upfront (`claude --model haiku --dangerously-skip-permissions …` or `/model haiku` in-session) to keep turnaround fast. - Two modes: - **One-shot tasks** (single summary, short answer): run `claude --model haiku --dangerously-skip-permissions --print …` in a tmux session, wait with `sleep 30`, then read the output buffer. - **Interactive tasks** (multi-file edits, iterative prompts): start `claude --model haiku --dangerously-skip-permissions` in tmux, send prompts with `tmux send-keys`, and capture completed responses with `tmux capture-pane`. Expect to sleep between turns so Haiku can finish before you scrape the pane. -- Ralph’s supervisor loop launches Claude the same way (`claude --dangerously-skip-permissions ""`) to keep the tmux automation flowing. - ## One-Shot Prompts - The CLI accepts the prompt as a trailing argument in one-shot mode. Multi-line prompts can be piped: `echo "..." | claude --print`. - Add `--output-format json` when you need structured fields (e.g., summary + bullets) for post-processing. -- Keep prompts explicit about reading full files: “Read docs/example.md in full and produce a 2–3 sentence summary covering all sections.” +- Keep prompts explicit about reading full files: "Read docs/example.md in full and produce a 2-3 sentence summary covering all sections." ## Bulk Markdown Conversion - Produce the markdown inventory first (`pnpm run docs:list`) and feed batches of filenames to your Claude session. -- For each batch, issue a single instruction like “Rewrite these files with YAML front matter summaries, keep all other content verbatim.” Haiku can loop over multi-file edits when you provide the explicit list. +- For each batch, issue a single instruction like "Rewrite these files with YAML front matter summaries, keep all other content verbatim." Haiku can loop over multi-file edits when you provide the explicit list. - After Claude reports success, diff each file locally (`git diff docs/.md`) before moving to the next batch. -## Ralph Integration Notes -- Ralph (see `scripts/ralph.ts`) spins up tmux sessions, auto-wakes the worker, and calls Claude as the supervisor via `claude --dangerously-skip-permissions`. -- Supervisor responses must end with either `CONTINUE`, `SEND: `, or `RESTART`; Ralph parses these tokens to decide the next action. -- To start Ralph manually: `bun scripts/ralph.ts start --goal "…" [--markdown path]`. Progress is tracked in `.ralph/progress.md` by default. -- Send ad-hoc instructions to the worker session with `bun scripts/ralph.ts send-to-worker -- "your guidance"`. +## Supervisor Loop Pattern +- A supervisor loop can spin up tmux sessions, auto-wake workers, and call Claude via `claude --dangerously-skip-permissions ""` to keep tmux automation flowing. +- Supervisor responses typically end with tokens like `CONTINUE`, `SEND: `, or `RESTART` so the orchestrator can decide the next action. +- Progress can be tracked in a local file (e.g., `.ralph/progress.md`) by default. +- Send ad-hoc instructions to a worker session with `tmux send-keys -t "your guidance" Enter`.