summary: 'Multi-agent system directives and coordination rules. Master reference for agent behavior.' read_when:
- Coordinating subagents or running tmux-based agent sessions.
Claude Subagent Quickstart
CLI Basics
-
Launch long-running subagents inside tmux so the session can persist. Example:
tmux new-session -d -s claude-haiku 'claude --model haiku' tmux attach -t claude-haikuOnce inside the session, run
/modelto confirm the active alias (haikumaps to Claude 3.5 Haiku) and switch models if needed. -
Need to queue instructions without attaching? Use
tmux send-keys -t <name> "your command" Enterto inject text into a running agent session. -
Always switch to the fast Haiku model upfront (
claude --model haiku --dangerously-skip-permissions …or/model haikuin-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 withsleep 30, then read the output buffer. - Interactive tasks (multi-file edits, iterative prompts): start
claude --model haiku --dangerously-skip-permissionsin tmux, send prompts withtmux send-keys, and capture completed responses withtmux capture-pane. Expect to sleep between turns so Haiku can finish before you scrape the pane.
- One-shot tasks (single summary, short answer): run
-
A manual supervisor loop can launch Claude the same way (
claude --dangerously-skip-permissions "<prompt>") to keep 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 jsonwhen 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.”
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.
- After Claude reports success, diff each file locally (
git diff docs/<file>.md) before moving to the next batch.
Supervisor Loop Notes
- There is no checked-in Ralph helper in this repo. For supervisor/worker loops, launch the worker in tmux and drive it with
tmux send-keys. - Supervisor responses should end with an explicit next action such as
CONTINUE,SEND: <message>, orRESTARTso the operator can route the next turn without ambiguity.