Mother Session Orchestrator + N Parallel Sub-Sessions
Pattern operativo standard per task Claude Code >4h decomponibili in 2+ stream paralleli. Originato 2026-05-13 (reconciliation Stream A↔C + Stream A finalize · session ID mother
5071abe1-1ff4-414c-bba5-e193f6d1c692).
Cos'è
Un task pesante viene gestito da 1 mother session in BOS (control center) + N child sessions (P1, P2, ...) in worktree separati del repo target. La mother monitora e orchestrizza via live state JSON di BOS; le child fanno il lavoro effettivo (code, refactor, test) ognuna su scope strict mutuamente esclusivo.
Trigger criteria · quando attivare
- Task >4h lavoro totale stimato
- Decomponibile in 2+ stream con scope strict separati (no overlap file/feature)
- Esiste un repo BOS / SSoT da cui orchestrare (
Multiverbe-Business/) - Founder vuole status updates frequenti senza riaprire sessione cara ogni volta
Quando NON attivare
- Task <2h → 1 sessione singola basta
- 1 solo stream parallelo → niente "mother" overhead
- Lavori su repo senza BOS / live state files
Architettura (ASCII)
┌──────────────────────────────────┐
│ FOUNDER (Gregorio) │
│ briefing 5 righe in chat │
└──────────────▲───────────────────┘
│
┌──────────────┴───────────────────┐
│ MOTHER session │
│ D:\Desktop\Multiverbe-Business │
│ actor_session_name=mother-DATE │
└─┬────────────┬────────────┬──────┘
│ inbox.json │activity.json│sessions.json
│ locks │ kpi.json │
┌─────────▼─────┐ ┌────▼──────┐ ┌────▼──────┐
│ CHILD P1 │ │ CHILD P2 │ │ CHILD Pn │
│ worktree A │ │ worktree B│ │ worktree N│
│ scope strict │ │ scope str │ │ scope str │
└───────────────┘ └───────────┘ └───────────┘
Tutti scrivono/leggono source/_meta/live/*.json nel repo BOS condiviso.
Setup steps (founder)
- Apri mother session in BOS:
cd D:\Desktop\Multiverbe-Business- Avvia Claude Code worktree branch dedicato (es.
claude/<orchestrator-name>) - Mother auto-carica AGENTS.md + status.json + decisions
- Mother registra heartbeat
actor_session_name: "mother-YYYY-MM-DD"
- Bulk-approve edge decisions upfront (D1-D6 style) per minimizzare handoff mid-execution
- Apri N child sessions in worktree del repo target (es.
D:\Desktop\Multiverbe\.claude\worktrees\<nome>):- Ogni child riceve nel prompt iniziale il mother
session_idcome reference - Ogni child scope strict documentato (file/feature non-overlapping)
- Ogni child registra heartbeat
actor_session_name: "P1-..."/"P2-..."etc.
- Ogni child riceve nel prompt iniziale il mother
- Update status.json action items child: scheduled → in_progress + started_at +
mother_session_orchestrator: <UUID>pointer
Operating protocol mother (8 punti)
- Auto-load contesto BOS (AGENTS.md + status.json + decisions-log + eventuale reconciliation doc)
- Register heartbeat
actor_session_name: "mother-YYYY-MM-DD"viascripts/live/heartbeat.mjs - Update status.json action_items child: scheduled → in_progress + started_at + mother_session_orchestrator pointer UUID
- Idle polling 5-10min OR on-demand founder (mai polling vuoto)
- Response founder = 5 righe max:
- 📅 [HH:MM] · P1 [%+last update] · P2 [%+last update]
- 🚦 Blockers (o "Nessuno")
- 📬 Inbox (msg pending da child)
- 🎯 Next auto-action mother
- ⚡ Risk emergente
- Autonomous OK per: naming variance, library choice triviale, decisioni bulk-approvate (D1-D6 style), test cases extra
- Chiedere founder PRIMA di: schema DB change, auth pattern change, cost cap variation, push master, decisioni architetturali non bulk-approvate
- Quando tutti child "done" + smoke E2E passa → mother prepara merge gate summary 10 righe per founder approve
Co-working protocol child → mother (inbox.json)
Child appendono entry via scripts/live/inbox.mjs:
{
"from": "P1",
"to": "mother",
"type": "question" | "progress" | "blocker",
"body": "Stream A reconciliation 60%. Edge case su X: applico bulk-approve D3? requires_action=false (FYI).",
"requires_action": false,
"ts": "2026-05-13T14:32:00Z"
}
Mother risponde same channel from: "mother", to: "P1". Eventi paralleli loggati in activity.json (type: progress | decision | blocker_resolved | merge_gate).
Regole hard universali
- ZERO commit/push BOS senza founder approve esplicito
- ZERO merge to master senza founder approve esplicito
- ZERO autonomous decision su scope architetturale non bulk-approvato
- Response founder max 5 righe default (10 righe solo per merge gate summary)
- NO polling vuoto · aspettare evento (inbox/activity) o input founder
- ZERO INFO LOSS se mother edita chunks
source/*.md(verbatim mandatory, vedi pre-edit protocol AGENTS.md)
Esempio storico · 2026-05-13
- Mother: branch
claude/condescending-hamilton-77da87· worktree in BOS · session_id5071abe1-1ff4-414c-bba5-e193f6d1c692 - P1: reconciliation Stream A↔C nel worktree codice
D:\Desktop\Multiverbe\.claude\worktrees\publish-hosting\· ETA 4-6h - P2: Stream A finalize + smoke E2E ristoratore Lugano · ETA 3-5h
- Decisioni bulk-approvate upfront: D1-D6 (naming, lib choices, test boundaries) per minimizzare handoff
- Polling cadence: mother poll
inbox.json+activity.jsonogni 5-10 min o on-demand founder - Risultato: founder ha visto status P1/P2 in chat senza riaprire sessioni costose, cache mother mantenuto warm tra check
Reference
AGENTS.md(root BOS) — auto-load protocol + regole hard + orchestrazione multi-Claude legacyscripts/live/heartbeat.mjs— register/heartbeat/end sessionscripts/live/inbox.mjs— sendMessage cross-sessionscripts/live/activity-log.mjs— append-only event logscripts/live/lock.mjs— acquireLock/releaseLock cross-session chunk- Memoria Claude trigger:
~/.claude/projects/D--Desktop-Multiverbe-Business/memory/feedback_mother_orchestrator_standard.md