From claude-initial-setup
Patterns for running independent tasks in parallel using multiple tool calls and Agent invocations. Use when the user has multiple independent operations, asks about fan-out/fan-in, or wants to speed up multi-step workflows.
npx claudepluginhub versoxbt/claude-initial-setup --plugin claude-initial-setupThis skill uses the workspace's default tool permissions.
Claude Code can execute multiple independent tool calls in a single response. This dramatically reduces wall-clock time for tasks that do not depend on each other.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Claude Code can execute multiple independent tool calls in a single response. This dramatically reduces wall-clock time for tasks that do not depend on each other.
Two operations are independent when neither needs the other's result. Test by asking: "Can I start operation B without knowing the result of operation A?"
# INDEPENDENT (run in parallel):
- Read file A and Read file B
- Grep for pattern X and Grep for pattern Y
- Analyze auth module and Analyze database module
# DEPENDENT (run sequentially):
- Find the config file, THEN read it
- Read the test file, THEN modify it based on contents
- Get the function signature, THEN find all call sites
Make multiple tool calls in a single response block:
# Single response with 3 parallel calls:
Call 1 - Read:
file_path: "src/auth/middleware.ts"
Call 2 - Read:
file_path: "src/auth/tokens.ts"
Call 3 - Read:
file_path: "src/auth/permissions.ts"
All three files are read concurrently. Results arrive together for synthesis.
Launch multiple Agent tool calls for independent investigations:
# Fan-out: 3 parallel subagents
Agent 1:
prompt: "Analyze all React components in src/components/
for accessibility issues (missing aria labels,
no keyboard handlers). Report findings as a list."
Agent 2:
prompt: "Check all API routes in src/api/ for proper
error handling. Report which routes lack try/catch
or return generic error messages."
Agent 3:
prompt: "Review all database queries in src/db/
for N+1 query problems. Report file paths and
the specific query patterns."
After parallel calls complete, synthesize in the next response:
# Step 1: Parallel fan-out (3 Agent calls)
# Step 2: All results arrive
# Step 3: Synthesize
"Based on the three analyses:
- Accessibility: 4 components need aria labels (Agent 1)
- Error handling: 2 routes missing try/catch (Agent 2)
- Database: 1 N+1 query in user-posts loader (Agent 3)
Priority order: Database N+1 > Error handling > Accessibility"
Combine different tool types in a single parallel batch:
# All independent, all in parallel:
Call 1 - Glob:
pattern: "src/**/*.test.ts"
Call 2 - Grep:
pattern: "TODO|FIXME|HACK"
path: "src/"
Call 3 - Read:
file_path: "package.json"
Call 4 - Bash:
command: "git log --oneline -10"
When some steps depend on others but have parallel sub-branches:
# Step 1 (sequential): Read the config to understand the project
Read: "tsconfig.json"
# Step 2 (parallel, depends on Step 1):
# After reading tsconfig, these are independent:
Grep: pattern "import.*from" in src/ # Find all imports
Glob: "src/**/*.d.ts" # Find type declarations
Bash: "npx tsc --noEmit 2>&1 | wc -l" # Count type errors
Use run_in_background for commands that take a while:
Bash:
command: "npm run test:coverage"
run_in_background: true
# Continue working on other things while tests run.
# You will be notified when the background task completes.
When creating multiple independent files:
# All independent, all in parallel:
Write: "src/utils/format.ts"
content: "..."
Write: "src/utils/validate.ts"
content: "..."
Write: "src/utils/transform.ts"
content: "..."
| Pattern | When | How |
|---|---|---|
| Parallel reads | Multiple files to inspect | Multiple Read calls in one response |
| Parallel searches | Multiple patterns or directories | Multiple Grep/Glob calls in one response |
| Fan-out agents | Independent investigations | Multiple Agent calls in one response |
| Fan-in synthesis | After parallel results arrive | Single response analyzing all results |
| Background tasks | Long-running commands | run_in_background: true on Bash |
| Mixed parallel | Different tool types, independent | Mix Read + Grep + Glob + Bash in one response |
Independence test: "Can B start without A's result?" If yes, parallelize. Batch size: 3-5 concurrent operations is the sweet spot. Synthesis: Always dedicate a response to combining parallel results.