Anatomy of a research thread
A typical thread looks like this:
- PI session start. PI attaches to the supervisor (VSCode Remote-SSH or
project attach). Claude Code starts. The supervisor reads its most-recentlogbook/supervisor/*.mdto reload context, lists.workers/*.jsonto see what exists. - Question. PI poses a research question in plain English.
- Reuse-or-fresh decision. The supervisor inspects existing
downworkers’summary.mdtop line (their thematic identity). Same theme → respawn; new theme → new worker name. - Plan. Supervisor drafts
plan/draft/<name>.mdwith## Question / ## Inputs / ## Deliverables / ## Verification. PI reviews; explicit “go” required. - Spawn. Supervisor runs
rs-worker spawn <name> --plan plan/draft/<name>.md [--mcps a,b]. The harness validates the four sections, promotes the draft to canonical (plan/<name>.md), copies it as the worker’stask.md, deletes the draft, starts a headless worker container. - Block. Supervisor calls
rs-worker wait <name>and does not return to the PI until the worker terminates. - Review. Worker is in state
waiting(idle) ordone(clean exit). Supervisor readsresearch_log.md, opensoutputs/<slug>/, compares against the plan’s## Verification. Decides:- Meets brief →
rs-worker finalize <name> --slug <slug>. Showsstaging/<name>/to PI. On PI approval:rs-worker accept. The cycle is now inresults/<name>/<NNN>_<slug>/. - Minor gap →
rs-worker message <name> "<correction>"(queues follow-up in inbox; same container). - Wrong shape → fail loudly; iterate via message with a new slug.
- Meets brief →
- Loop until satisfied for the current PI question, or escalate back if blocked on a decision only the PI can make.
- Session end. PI types
/log. Supervisor sends summarize-and-shutdown messages to every live worker, writes onelogbook/supervisor/<date>-<HHMM>.md(chronological) and Nlogbook/pi/<date>-<slug>.md(executive, one per coherent topic). Thenrs-worker shutdown <name>for each worker → registry state goes todown, container is gone, bind-mount preserved.
Next session, the PI reads the relevant logbook/pi/*.md to remember where things stood. The supervisor reads logbook/supervisor/*.md to remember its own decisions. Workers respawn from their summary.md.