How Do You Run Claude Prompts in Parallel and Merge Them?
Send each independent part to its own prompt, then combine the results in code or with one final merge prompt. Use it when parts don't depend on each other, such as 50 contracts to review or five competitors to profile. On the API, the Batches API does this at half price. In Claude Code, use subagents or separate sessions.
Part prompt, run once per item:
Review [item ID: 123]. Answer only these questions: [questions]. Return exactly: { "id": "123", "findings": [...], "confidence": "high|medium|low", "quote": "..." }. Don't compare it with anything else.
Merge prompt, run once at the end:
Below are [N] separate reviews. Don't redo them. Produce:
1. what most items have in common, with the IDs
2. outliers worth a person's attention, with the IDs
3. any items where reviews conflict, showing both
4. any IDs missing from the input
[paste results]
- 50%lower cost than standard calls
- 100,000requests per batchor 256 MB, whichever is first
- 1 hourmost batches finish within
- 24 hoursthen unfinished work expires
- 1Split into independent parts
- 2Run each one separately
- 3Match results by ID
- 4Merge, and flag conflicts
Try it now
- 1Pick five items of the same type, and write one prompt that handles a single item and returns its ID.
- 2Run it on all five. In Claude Code, ask: "Use a subagent for each file in [folder], and return only the fields above."
- 3Run the merge prompt over the results, and check that every ID appears.
- 4You'll know it worked if an outlier the merge flagged is real when you open that item. Only then scale up to the full set.
Use it when
Use it when you have many similar items, or several angles on one question that don't depend on each other. Reviewing a contract folder, tagging a backlog and checking code for vulnerabilities from different angles all fit.
Skip it when
Don't use it when one part's answer changes what the next should do. Run those in sequence. Batches don't suit anything a person is waiting on, and aren't eligible for zero data retention, since results are kept for 29 days. Parallel work also spends limits in parallel, so small jobs may cost more than they save.
Why it works
Anthropic's agent guide describes two types. Sectioning splits a task into independent subtasks, and voting runs the same task several times to raise confidence. On the API, Anthropic says a batch can hold up to 100,000 requests or 256 MB, costs 50 percent less, and mostly finishes within an hour, though it can take up to 24. In Claude Code, each subagent has its own context window, and only its final result returns to your main conversation, so noisy work stays out of the way.
Example
You have 200 vendor contracts and want to know which auto-renew and which cap liability. On the API, each contract becomes one batch request with its filename as custom_id, using a cheap model. Results come back in any order, so you match on the ID. A final Opus call reads only the extracted fields and produces a table of outliers for your lawyer.
Going further
Batch results can come back in any order, so custom_id is required for matching. It must be 1 to 64 characters of letters, numbers, hyphens and underscores. Claude can also make parallel tool calls in one response, and the API leaves execution order up to you. Read-only calls are usually safe to run together, while tools with side effects may be better run in sequence. For parallel code changes, claude -w feature-auth gives each session its own worktree. Claude Code's docs say handing work to a subagent doesn't improve the answer by itself, and each one costs extra tokens.
Common mistakes
- Fanning out work that depends on order, so parts contradict each other and the merge can't resolve it.
- Matching batch results by position, when they can return in any order.
- Merging with "summarize these", which averages away the outliers you were looking for. Ask for conflicts by ID.
- Running 500 items before testing on five, and paying to find a flaw in the prompt.
Sources
- Building effective agents, Anthropic Engineering
- Batch processing, Claude Platform Docs
- Subagents, Claude Code Docs
- Best practices, Claude Code Docs
- Parallel tool use, Claude Platform Docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.