async-tool-execution

Execute async tool calls in parallel without blocking the Mathematica kernel.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/transreal/claudecode --skill async-tool-execution
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: async-tool-execution
Source: https://github.com/transreal/claudecode/tree/main/Claude%20Directives/skills/async-tool-execution
Command: npx skills add https://github.com/transreal/claudecode --skill async-tool-execution

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents long-running or parallelizable tool calls (such as web search) from blocking the main Mathematica kernel, while keeping tool call order consistent and providing reliable progress updates.

Core Features & Use Cases

  • Hybrid sync/async tool routing: Automatically classifies tool calls into sync (immediate Mathematica-side execution) and async (separate OS processes) while preserving original Index ordering for correct result reassembly.
  • State machine for async tool execution: Implements an AsyncToolExec poll/collect/finalize flow using OS process control (StartProcess), polling ticks, timeout cancellation, and deterministic result merging.
  • Phase D2 progress UX contract: Updates $claudeProgress[pollKey] and WindowStatusArea every polling tick to avoid the “0s stuck” user experience.
  • Adapter extension for async tools: Defines adapter keys like AsyncToolNames, MaxConcurrentTools, SubmitToolAsync, CollectToolAsync, and CancelToolAsync to standardize async tool execution.
  • Safety/guardrails: Ensures callback suppression for scheduled outcomes and enforces strict ordering integrity (no partial async/sync mixing).

Quick Start

Tell the assistant to implement the async tool execution hybrid path in the Claude adapter runtime by adding SubmitToolAsync/CollectToolAsync/CancelToolAsync, enabling $UseClaudeRuntime = True, and ensuring Phase D2 progress updates use $claudeProgress[pollKey] after polling tick registration.

Frequently Asked Questions about async-tool-execution

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

FAQPage Schema
How do I run async web search tool calls in Mathematica without blocking the kernel?

You can run async web search tool calls without kernel blocking by scheduling tool subprocesses using StartProcess and polling for completion. This allows parallel execution while the Mathematica kernel remains responsive.

How does async tool execution maintain result order when mixing sync and async calls?

Async tool execution maintains result order by preserving original Index ordering during hybrid sync/async routing. It performs deterministic result merging to reassemble outputs in the correct sequence after polling completes.

What's the best way to implement progress updates for polling subprocesses in the Claude adapter runtime?

The best way to implement progress updates is using the Phase D2 progress UX contract, which updates $claudeProgress[pollKey] and WindowStatusArea every polling tick. This prevents the stuck user experience during async tool execution.

Can I use adapter design to standardize async tool execution with timeout cancellation?

Yes, you can use adapter design to standardize async tool execution by defining adapter keys like SubmitToolAsync, CollectToolAsync, and CancelToolAsync. These keys manage timeout cancellation and enforce strict callback suppression for scheduled outcomes.

Why does my Mathematica kernel freeze during parallel web search tool execution?

The Mathematica kernel freezes during parallel web search because long-running tool calls block the main thread. Implementing async tool execution with OS process polling and state machine flow prevents this kernel blocking.

Does async tool execution support concurrent subprocess polling with timeout cancellation?

Async tool execution supports concurrent subprocess polling through a state machine flow using StartProcess and polling ticks. It includes timeout cancellation via CancelToolAsync and enforces MaxConcurrentTools limits for safety.