async-concurrency

Coordinate tool execution with per-tool concurrency and cancellation.

5|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/TechyMT/claude-code-superpowers --skill async-concurrency-techymt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: async-concurrency
Source: https://github.com/TechyMT/claude-code-superpowers/tree/main/skills/async-concurrency
Command: npx skills add https://github.com/TechyMT/claude-code-superpowers --skill async-concurrency-techymt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teaches Claude Code's concurrency model: isConcurrencySafe() for parallel tool execution, AbortController propagation for cancellation, Promise.all() for parallel initialization, and the StreamingToolExecutor for concurrent progress streams. Use this when writing tools that could benefit from parallel execution, need to respect cancellation, or must stream partial results. Read-only tools that don't declare concurrency safety are needlessly serialized.

Core Features & Use Cases

Key concepts: per-tool isConcurrencySafe(input) for deciding whether a tool can run in parallel; isReadOnly(input) to indicate non-mutating operations; propagation of context.abortController.signal to cancel in-flight I/O; parallel initialization with Promise.all(); streaming partial results via onProgress using a StreamingToolExecutor. Use cases include read-only tools that can run concurrently with others and long-running tools that should be cancellable and stream progress.

Quick Start

Add isConcurrencySafe and isReadOnly checks to your tool, thread cancellation via AbortController signals, and stream progress with onProgress as your tool evolves.

Frequently Asked Questions about async-concurrency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run read-only tools in parallel without serialization?

Parallel tool execution is enabled by declaring isConcurrencySafe(input) and isReadOnly(input) on read-only tools, preventing needless serialization and allowing safe concurrent execution alongside other tools.

How do I cancel long-running tool execution when an operation is aborted?

Long-running tool execution is cancelled by propagating the context.abortController.signal to terminate in-flight I/O. This AbortController propagation ensures that cancellable operations respect abort requests immediately.

How do I stream partial progress results from concurrent tool execution?

Partial progress results are streamed using a StreamingToolExecutor with onProgress callbacks during concurrent tool execution. This provides live progress updates as your tool evolves and processes long-running operations.

What's the best way to initialize multiple tools in parallel?

Parallel initialization is best achieved using Promise.all() to start multiple tools concurrently. This modular, context-aware concurrency pattern reduces startup time by running initialization steps simultaneously rather than sequentially.

When should I not use parallel tool execution for my operations?

Parallel tool execution should not be used for mutating operations or tools that lack per-call safety classifications. Without proper isConcurrencySafe checks, concurrent execution of mutating tools can cause unsafe state modifications.

Does the concurrency model support per-call safety classifications for different inputs?

Per-call safety classifications are supported through the isConcurrencySafe(input) function, which evaluates each input individually to decide whether a tool can run in parallel. This context-aware approach allows the same tool to run concurrently or serialized depending on the specific input.