explore
Question-driven, not map-driven. If the user's request is "describe this repo" rather than "where does X happen / how does Y work", push back for a concrete question — a tour without a destination is wasted subagent load.
-
Sharpen the question. Rewrite it as a single sentence you can hand to each subagent verbatim. If it isn't crisp enough for a grep-guided answer, ask the user to narrow it before spawning anything.
-
Identify candidate clusters. Breadth first:
ls -lathe repo root, read the package manifest (package.json/pyproject.toml/Cargo.toml/go.mod/ etc.) for entry points, then run a single keyword grep —grep -rli '<term>' <top-level dirs>— to list candidate files without opening them. Pick 2–5 plausible clusters where the answer could live. If it's obvious (single file, single function), skip delegation and read it directly. -
Spawn one subagent per cluster via
node "$MI_PATH" -p '<prompt>'withbg=truthy— the harness returnspid:X log:/tmp/mi-X.logand detaches the child; do NOT append&. Use this prompt template for each subagent:Question: <the sharpened question, verbatim> Scope: <absolute paths in this cluster only> Do NOT read files outside the scope above. Write your findings to /tmp/mi-explore-<cluster>.md using this exact format: STATUS: complete | partial | blocked SCOPE: <paths you actually read> ANSWER: <1-3 sentences, no file:line refs here> CITATIONS: <path/to/file.ext:<line> — <quoted excerpt>, one per line> FOLLOW_UPS: <paths outside scope worth checking next, if any>