Agent skill

Parallel Batch Operations

by QwenLM in QwenLM/qwen-code

Runs one operation across many files with parallel worker agents: finds files by glob pattern, splits them into chunks, launches workers and summarizes the results.

Apache-2.0Auto-check passedDevelopment

Install Parallel Batch Operations

skills CLI
$ npx skills add QwenLM/qwen-code --skill batch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install QwenLM/qwen-code batch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/core/src/skills/bundled/batch .claude/skills/batch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
batch
GitHub stars
28k
Token cost
~2.3k tokens
SKILL.md length
823 words
Files
1
Skills in repo
41
Repo updated
First seen
Licence
Apache-2.0

At a glance

Runs one operation across many files with parallel worker agents: finds files by glob pattern, splits them into chunks, launches workers and summarizes the results.

  • Works in 5 steps: Parse Intent and Discover Files → Chunk Files for Parallel Processing → Launch Parallel Worker Agents → …
  • Applying the same edit, such as adding JSDoc comments, across many source files
  • SKILL.md covers Step 1: Parse Intent and…, Step 2: Chunk Files for…, Step 3: Launch Parallel Worker… and Step 4: Aggregate Results, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill makes the agent an orchestrator. It parses the target glob pattern and the operation from the /batch request, discovers files, and applies standard exclusions such as node_modules, dist, build, lock files, minified files, tests, binary files and files above 500KB. If nothing matches it stops. If more than 50 files match it reports the count and list and proceeds, and above 100 it warns and suggests a narrower pattern.

Files are split into chunks by the size of the set, from a single chunk for up to 5 files to five chunks for larger sets, with at least 3 and at most 15 files per chunk and no more than 5 parallel agents. Worker agents process the chunks and the results are aggregated into a summary. The description notes that for many independent single-turn transforms that can wait, you may type /batch-api yourself for the half-price asynchronous option, which the agent cannot invoke.

When your agent uses it

  • Applying the same edit, such as adding JSDoc comments, across many source files
  • Converting a set of files to another language or format in parallel
  • Running a repetitive refactor over a glob like src/**/*.ts

Example prompts

  • “/batch add JSDoc comments to every file in src/utils.”
  • “Convert all the JavaScript files under src/legacy to TypeScript in parallel.”
  • “Apply the new logging helper across src/**/*.ts and show me a summary of the changes.”

Requirements

  • A runtime that can launch parallel worker agents

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Parse Intent and Discover Files
  2. Chunk Files for Parallel Processing
  3. Launch Parallel Worker Agents
  4. Aggregate Results
  5. Error Handling

What it can do on your machine

Read from SKILL.md and the folder at commit 4970bfa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Parallel Batch Operations loads about 2.3k tokens when it runs. Until then it costs about 132 tokens; SKILL.md has 823 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~132
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from QwenLM/qwen-code at commit 4970bfa, republished under its Apache-2.0 licence (© QwenLM). 823 words, ~2,323 tokens.

Download SKILL.mdSave it as .claude/skills/batch/SKILL.md (or your agent's skills folder).
name
batch
description
Execute batch operations on multiple files in parallel. Automatically discovers files, splits into chunks, and processes with parallel worker agents. Use `/batch` followed by operation and file pattern. For many independent single-turn transforms (translate/rewrite/extract each file into a new file) that can wait minutes to hours, you may suggest the user type `/batch-api` themselves for the half-price asynchronous Batch API — you cannot invoke it, and it is not suited to in-place edits or tasks needing tool feedback.
argument-hint
<operation> <file-pattern>

/batch - Parallel Batch Operations

You are orchestrating a batch operation across multiple files. Your job is to:

  1. Parse the user's request to understand the target files and operation
  2. Discover matching files using glob
  3. Split files into chunks for parallel processing
  4. Launch multiple worker agents to process files concurrently
  5. Aggregate results and present a summary

Step 1: Parse Intent and Discover Files

First, parse the user's request to identify:

  • Target pattern: glob pattern for files (e.g., src/**/*.ts, **/*.js)
  • Operation: what to do with each file (e.g., "add JSDoc comments", "convert to TypeScript")

If the user didn't specify a pattern, infer it from context or ask for clarification.

Use the glob tool to discover matching files.

If no files match the pattern:

  • Inform the user that no files were found for the given pattern
  • Suggest checking the pattern or broadening the search scope
  • Do not proceed with an empty batch

Apply these common exclusions automatically:

  • node_modules/**
  • dist/**
  • build/**
  • .git/**
  • **/*.test.ts, **/*.test.js
  • **/*.spec.ts, **/*.spec.js
  • **/__tests__/**
  • **/test/**, **/tests/**
  • **/package-lock.json
  • **/yarn.lock
  • **/pnpm-lock.yaml
  • **/*.min.js
  • Binary files (images, fonts, etc.)
  • Files larger than 500KB (check size if needed)

Important: If more than 50 files match, inform the user with the exact count and the file list, then proceed. The user can cancel (Ctrl+C) if needed. If the count exceeds 100 files, warn the user and suggest a more specific pattern instead of proceeding.

Step 2: Chunk Files for Parallel Processing

Split the discovered files into chunks based on these rules:

Total FilesChunk CountFiles Per Chunk
1-51All files
6-1523-8 each
16-303~10 each
31-504~10-12 each
51-755~10-15 each
76-1005~15-20 each

Chunking algorithm:

  • Minimum chunk size: 3 files (avoid over-parallelization for small batches)
  • Maximum chunk size: 15 files (ensure reasonable work per agent)
  • Maximum parallel agents: 5 (API rate limit consideration)

Example: 24 files → 3 chunks of ~8 files each

Step 3: Launch Parallel Worker Agents

Launch worker agents in parallel by invoking the task tool (the Agent tool) multiple times in a SINGLE message.

Note: The task tool in allowedTools is the Agent tool used to spawn worker agents.

Each worker agent should receive:

  • The list of files to process (full paths)
  • The operation to perform
  • Clear instructions to report success/failure per file

Use the general-purpose subagent type for workers.

CRITICAL: All Agent tool calls MUST be in a single response to enable parallel execution. The system automatically runs multiple Agent calls concurrently.

Agent Prompt Template

For each chunk, use this prompt format:

You are a worker agent processing a batch of files.

**Operation**: [describe the operation, e.g., "Add JSDoc comments to all exported functions"]

**Files to process**:
- [file1.ts]
- [file2.ts]
- ...

**Instructions**:
1. Process each file independently
2. For each file, report one of:
   - SUCCESS: [file path] - [brief description of change]
   - FAILED: [file path] - [reason for failure]
   - SKIPPED: [file path] - [reason for skipping]
3. If a file fails or is skipped, continue with the next file - do not abort
4. At the end, provide a summary of what was done

**Constraints**:
- Do not modify test files unless explicitly requested
- Preserve existing code style and formatting
- Make minimal necessary changes to accomplish the operation
Example Invocation Pattern

Set run_in_background: false on every worker call so all results return inline for aggregation in Step 4.

<Agent tool call 1>
description: "Process batch chunk 1/3"
prompt: "You are a worker agent... [full prompt as above]"
subagent_type: "general-purpose"
run_in_background: false
</Agent tool call 1>

<Agent tool call 2>
description: "Process batch chunk 2/3"
prompt: "You are a worker agent... [full prompt as above]"
subagent_type: "general-purpose"
run_in_background: false
</Agent tool call 2>

<Agent tool call 3>
description: "Process batch chunk 3/3"
prompt: "You are a worker agent... [full prompt as above]"
subagent_type: "general-purpose"
run_in_background: false
</Agent tool call 3>

Step 4: Aggregate Results

After all worker agents complete, aggregate their results into a clear summary.

Output Format
markdown
### Batch Operation Complete

**Operation**: [description of what was done]
**Files discovered**: [total count]
**Chunks processed**: [number of parallel agents]
**Total time**: [duration if tracked]

| Status  | Count |
| ------- | ----- |
| Success | [N]   |
| Failed  | [N]   |
| Skipped | [N]   |

**Successful files**:

- [file1.ts] - [brief description]
- [file2.ts] - [brief description]
  ...

**Failed files** (if any):

- [file.ts]: [reason for failure]

**Skipped files** (if any):

- [file.ts]: [reason for skipping]
Handling Partial Failures

If some files failed but others succeeded:

  • Clearly report which files succeeded
  • List failures with specific reasons
  • Suggest follow-up actions if appropriate

If all files failed:

  • Report the common failure pattern
  • Suggest potential fixes
Show full SKILL.md (326 more words)Show less

Step 5: Error Handling

During Batch Processing
  1. Single file failure: Don't abort the batch. The worker agent records the error and continues.
  2. Agent failure: If a worker agent fails completely (timeout, crash), note the chunk as failed with reason.
  3. User cancellation: If the user sends Ctrl+C, the system will cancel all pending agents gracefully.
Error Reporting

For each failed file, include:

  • File path
  • Specific error message or reason
  • Suggested fix if obvious

Usage Examples

Example 1: Add License Headers
/batch Add Apache 2.0 license header to all .ts files in src/

Flow:

  1. glob src/**/*.ts → find 45 files
  2. Split into 4 chunks
  3. Launch 4 parallel agents
  4. Each agent adds the license header to its assigned files
  5. Summary: 45 files processed, 45 succeeded, 0 failed
Example 2: Convert JavaScript to TypeScript
/batch Convert all .js files in utils/ to TypeScript

Flow:

  1. glob utils/**/*.js → find 12 files
  2. Split into 2 chunks
  3. Launch 2 parallel agents
  4. Each agent converts files and renames to .ts
  5. Summary: 12 files processed, 10 succeeded, 2 failed (complex dynamic patterns)
Example 3: Fix Lint Errors
/batch Fix all @typescript-eslint/no-explicit-any errors in src/

Flow:

  1. Use grep_search to find files containing : any pattern in src/
  2. Filter to relevant files
  3. Split into chunks and launch parallel agents
  4. Each agent fixes the specific lint issue (replace any with proper types)
  5. Summary: 8 files fixed

Constraints and Limits

ConstraintValueReason
Max files per batch100Prevent resource exhaustion
Max parallel agents5API rate limit consideration
Min files per agent3Avoid over-parallelization
Max files per agent15Ensure meaningful work
File size limit500KBAvoid context overflow

Dry-Run Mode

If the user wants to preview what will be changed without actually modifying files (e.g., "preview", "show me what would change", "dry run"):

  1. Discover and list all matching files with counts
  2. Show the planned operation for each file
  3. Display the chunking strategy
  4. Ask the user if they want to proceed with the actual changes
  5. If user confirms, execute the batch operation

Example:

/batch preview adding JSDoc comments to src/**/*.ts

Expected output:

### Dry-Run Preview

**Operation**: Add JSDoc comments to all .ts files in src/

**Files discovered**: 24 files

**Chunking plan**:
| Chunk | Files |
|-------|-------|
| 1     | src/utils/a.ts, b.ts, c.ts, ... (8 files) |
| 2     | src/components/x.ts, y.ts, ... (8 files) |
| 3     | src/services/m.ts, n.ts, ... (8 files) |

**Planned operation per file**:
- Add JSDoc comments to all exported functions
- Preserve existing code style

Proceed? (y/n)

© QwenLM, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/core/src/skills/bundled/batch of QwenLM/qwen-code.

Open the folder on GitHubat commit 4970bfa

Compare with similar skills

Parallel Batch Operations next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Parallel Batch Operations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Parallel Batch Operations this skillQwenLM/qwen-code28k—~2.3kAutomated safety check: PassApache-2.0
Multi-Model Adversarial Reviewcursor/plugins10k8 repos~1.3kAutomated safety check: PassNone
Multi-Persona Code Revieweric-tramel/moraine117—~1.3kAutomated safety check: PassApache-2.0
O2 Review Loopopenobserve/openobserve22k—~3.7kAutomated safety check: PassAGPL-3.0
Kimi Code DelegationCherryHQ/cherry-studio52k—~504Automated safety check: PassAGPL-3.0
Swarm Orchestrationruvnet/ruflo74k2 repos~779Automated safety check: PassMIT

Similar skills

  • Official

    Runs one read-only reviewer subagent per configured model against a diff to challenge a change, then synthesizes a single verdict without applying any fixes.

    10k GitHub starsUsed in 8 repos~1.3k tokens
    DevelopmentAuto-check passed
  • Multi-Persona Code Review

    eric-tramel/moraine

    Coordinates a delegated review of a Moraine PR or local change by seven focused reviewer subagents, merges their findings and follows up on the fixes.

    117 GitHub stars~1.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • O2 Review Loop

    openobserve/openobserve

    Splits a change into planner, coder and independent reviewer roles: you confirm a spec, a subagent implements it, and a separate reviewer checks each round's local WIP commit.

    22k GitHub stars~3.7k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Kimi Code Delegation

    CherryHQ/cherry-studio

    Delegates one bounded repository task to Kimi Code in non-interactive prompt mode and reads back the final result from its JSON event stream.

    52k GitHub stars~504 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Coordinates a hierarchical swarm of specialized agents through the claude-flow CLI for work that spans several files or modules at once.

    74k GitHub starsUsed in 2 repos~779 tokens
    Agent WorkflowsAuto-check passed
  • Adversarial Codebase Audit

    ben-manes/caffeine

    Runs a hostile review of the Caffeine Java caching library with parallel subagents that get no design docs, then challenges and consolidates their findings.

    18k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from QwenLM/qwen-code

All 41 skills in this repo
  • Reproduces a feature from Codex or Claude Code in Qwen Code by running the reference agent under capture, reading the traces, then implementing matching behavior.

    28k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Qwen Code E2E Testing

    QwenLM/qwen-code

    Guides end-to-end testing of the Qwen Code CLI in headless mode with real model calls, MCP test servers and inspection of raw API traffic.

    28k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Scheduled CI skill that scans a repository for small, certain docs, test and code hygiene issues and fixes them on one branch with a commit per finding.

    28k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Builds a rebranded Qwen Code desktop package from the Tauri shell using only a brand id and a logo, with sensible derived defaults.

    28k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Walks through capturing and comparing V8 heap snapshots to find memory leaks in the Qwen Code Node.js CLI, using tmux and the chrome-devtools CLI.

    28k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • tmux Real User Testing

    QwenLM/qwen-code

    Drives Qwen Code in a real tmux session the way a user would and saves a readable step-by-step transcript of each screen for maintainers to review.

    28k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Questions about Parallel Batch Operations

What does Parallel Batch Operations do?

Runs one operation across many files with parallel worker agents: finds files by glob pattern, splits them into chunks, launches workers and summarizes the results. The skill makes the agent an orchestrator. It parses the target glob pattern and the operation from the /batch request, discovers files, and applies standard exclusions such as node_modules, dist, build, lock files, minified files, tests, binary files and files above 500KB.

When should I use Parallel Batch Operations?

Parallel Batch Operations fits situations like: applying the same edit, such as adding JSDoc comments, across many source files; converting a set of files to another language or format in parallel; running a repetitive refactor over a glob like src/**/*.ts.

How do I install Parallel Batch Operations in Claude Code?

Run `npx skills add QwenLM/qwen-code --skill batch -a claude-code`. Or copy the skill folder (packages/core/src/skills/bundled/batch in QwenLM/qwen-code) into .claude/skills/batch in your project. Claude Code loads it when a task matches its description.

How do I install Parallel Batch Operations in Codex?

Run `npx skills add QwenLM/qwen-code --skill batch -a codex`. Or copy the skill folder (packages/core/src/skills/bundled/batch in QwenLM/qwen-code) into .agents/skills/batch in your project. Codex loads it when a task matches its description.

Can I use Parallel Batch Operations in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add QwenLM/qwen-code --skill batch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/batch, .gemini/skills/batch, .github/skills/batch and .opencode/skills/batch in your project.

What does Parallel Batch Operations need to run?

SKILL.md names no scripts, command-line tools or credentials: Parallel Batch Operations is instructions for the agent only. Our summary lists: A runtime that can launch parallel worker agents.

Does Parallel Batch Operations access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Parallel Batch Operations safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Parallel Batch Operations use?

Parallel Batch Operations is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Parallel Batch Operations use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Parallel Batch Operations?

Skills that share tags, products or a category with Parallel Batch Operations: Multi-Model Adversarial Review (cursor/plugins, 10k stars), Multi-Persona Code Review (eric-tramel/moraine, 117 stars), O2 Review Loop (openobserve/openobserve, 22k stars) and Kimi Code Delegation (CherryHQ/cherry-studio, 52k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Parallel Batch Operations?

QwenLM (a GitHub organization) maintains it in QwenLM/qwen-code, which has 28,337 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 7, 2026.

Source: QwenLM/qwen-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.