/ashlr-parallelize
Spawn N parallel sub-agents — one per file — each applying the same task instruction. Merges results into a unified report.
Spawn one sub-agent per file, all running the same task in parallel, then merge their outputs.
Usage
<task>— the instruction to apply to each file (quoted string or unquoted phrase ending before the first file path).<file1> [file2] ...— one or more file paths (contain/or.or start with__).--code— optional flag. When present, useashlr:ashlr:code(sonnet) agents instead of the defaultashlr:ashlr:explore(haiku) agents. Use--codewhen the task requires edits; omit for read-only analysis.
Examples
Steps
-
Parse
$ARGUMENTS:- Detect
--codeflag (remove from argument list before further parsing). - Determine
subagent_type:ashlr:ashlr:codeif--code, elseashlr:ashlr:explore. - Split remaining tokens: file-path-like tokens (contain
/,., or start with__) → file list; everything before the first file path → task string. - If no files are found, error: "No files specified. Usage: /ashlr-parallelize
<task><file1>[file2] ..." - If task string is empty, error: "No task specified. Usage: /ashlr-parallelize
<task><file1>[file2] ..."
- Detect
-
For each file, construct an agent prompt:
-
Spawn all agents in parallel via the Agent tool — one per file — each with
subagent_typeas determined in step 1. -
Wait for all agents to complete.
-
Print merged report:
Reuses agent definitions from agents/ashlr-explore.md (default) and agents/ashlr-code.md (--code).