Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/async-parallel.md
Open on GitHub

What 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.ts with Promise.all() where the calls don't depend on each other.
  • Check loadDashboard against the async-parallel rule 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.md

The paths frontmatter field limits the files

Step 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.

Similar IDE rules

All IDE rules for Backend and APIs →

From the same set20

The whole set →
js-set-map-lookups The js-set-map-lookups rule recommends using a Set when code repeatedly checks array membership. It applies to repeated lookups, such as filtering items by ID. CX Codex +1 ★ 1,064repo stars rendering-activity rendering-activity — a Claude rule that tells the agent to keep costly React components inside <Activity> so hiding them does not throw away state. CX Codex +1 ★ 1,064repo stars rendering-svg-precision rendering-svg-precision — a rule for Claude Code that reduces SVG coordinate precision to one decimal place. Applies when creating icons or editing graphics. CX Codex +1 ★ 1,064repo stars _template _template — a rule-file scaffold with fields for its title and impact, plus sections for contrasting incorrect and correct code. CX Codex +1 ★ 1,064repo stars rerender-derived-state The rerender-derived-state rule favors derived boolean state over continuously changing values, reducing React re-renders. It fits responsive UI logic. CX Codex +1 ★ 1,064repo stars js-combine-iterations js-combine-iterations tells the Claude agent to replace several filter or map passes over the same array with one loop that fills the results as it goes. CX Codex +1 ★ 1,064repo stars bundle-dynamic-imports bundle-dynamic-imports guides Claude Code to lazy-load heavy components using next/dynamic with SSR disabled. Keeps your initial client bundle lean to protect TTI and LCP metrics. CX Codex +1 ★ 1,064repo stars rendering-content-visibility The rendering-content-visibility rule applies content-visibility: auto to long lists so off-screen items can wait before rendering. It fits message feeds and other scrollable collections. CX Codex +1 ★ 1,064repo stars

Project sponsors

Companies that keep this analytics open