async-parallel — Claude Code rule: parallel awaits with Promise.all
async-parallel — a Claude rule that sends independent async calls through Promise.all() instead of awaiting them one by one. Useful when a handler piles up sequential awaits.
no license ★ 1,064 updated 2026-01-21
.claude/rules/async-parallel.mdWhat async-parallel does
The rule covers async code: calls with no dependency between them should be fired together with Promise.all(). The author rates the impact as CRITICAL and puts the gain at 2-10×.
Two TypeScript snippets sit in the file. The bad one awaits user, posts and comments one after another, which costs three round trips. The good one passes the same three calls into Promise.all() and gets them back in a single round trip.
Its own condition is the limit. Once the second call needs data from the first, running them together breaks the logic, so those calls stay sequential.
What it helps with
- replace a chain of sequential awaits in a request handler
- collapse three independent fetches into one round trip
- show the agent why parallel calls beat a waterfall
- spot the calls that must stay in order
Example prompts for the agent
- Rewrite the sequential awaits in
src/api/profile.tswithPromise.all()where the calls don't depend on each other. - Check
loadDashboardagainst theasync-parallelrule and tell me which awaits can run together. - Find places in this repo where
Promise.all()would break logic because the second call needs the first.
How to install async-parallel
Manually: put the files in place
.claude/rules/async-parallel.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/async-parallel.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/async-parallel.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/async-parallel.mdManually: put the files in place
.clinerules/async-parallel.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about async-parallel
How do I install async-parallel in Claude Code?
Place the rule file in your project at .claude/rules/async-parallel.md.
What does async-parallel do?
It pushes the agent to run independent async operations together with Promise.all(), and shows the sequential and the parallel version of the same code side by side.
When is Promise.all() the wrong choice?
When a later call needs the result of an earlier one. Run in parallel, it gets data that does not exist yet, so keep those awaits in order.