Guide · Agent skill
How to use the Batch File Operations agent skill (/batch)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The batch skill lets an AI coding agent apply one operation, such as adding a license header or doc comments, to many files at once. It works by finding matching files, splitting them into chunks and handing each chunk to a separate worker agent. After this guide you will know what the skill does, how to install it, how to trigger it with a /batch request, and what to check before letting it edit your code.
Quick start
- 1Confirm your setup. Make sure you run Qwen Code or a compatible agent runtime that supports the tools the skill lists. Commit your current work so changes can be reverted.
- 2Download and unzip the skill. Download the ZIP from this page and unzip it so SKILL.md sits inside a batch folder.
- 3Place the folder. Move the folder into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, upload it under Settings → Capabilities → Skills instead.
- 4Write a specific request. Start with /batch, then state the operation and a file pattern, for example /batch Add Apache 2.0 license header to all .ts files in src/.
- 5Review the file list. If more than 50 files match, read the count and list the agent reports before letting it continue. Cancel with Ctrl+C if the list is wrong.
- 6Check the summary. Read the success, failure and skip counts and the reasons listed for each file. Review the diff with your version control tool.
What the batch skill makes the agent do
The skill is a set of instructions (SKILL.md) that tells the agent how to run a batch operation. You type /batch followed by an operation and a file pattern. The agent then parses your request, discovers matching files with glob, splits them into chunks and launches worker agents to process the chunks in parallel.
When the workers finish, the agent collects their results into a summary that lists successes, failures and skips per file.
- Finds files that match a glob pattern such as src/**/*.ts
- Skips common noise: node_modules, dist, build, .git, test files, lock files, minified JS, binary files and files over 500KB
- Splits the remaining files into chunks; workers run independently and at most 5 run at once
- Reports each file as SUCCESS, FAILED or SKIPPED
Install the batch skill
Download the ZIP file from this page and unzip it. The skill is a folder that contains SKILL.md, so the folder must end up in one of the locations below.
For a personal skill available in all your projects, unzip it into ~/.claude/skills/. For a skill that only applies to one project, unzip it into that project's .claude/skills/ folder.
In the Claude apps you can instead upload the skill under Settings → Capabilities → Skills.
- Personal: ~/.claude/skills/
- Project only: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills, then upload
Trigger the skill with a natural request
Start your request with /batch, then state the operation and the file pattern. Be specific about which files you mean. If you leave the pattern out, the agent is told to infer it from context or ask you.
The skill accepts an argument hint of the form <operation> <file-pattern>, so keep both parts in the same request.
- Good: /batch Add Apache 2.0 license header to all .ts files in src/
- Good: /batch Convert all .js files in utils/ to TypeScript
- Vague: /batch fix stuff (no pattern, the agent will have to ask)
/batch Add Apache 2.0 license header to all .ts files in src/Worked examples
The source includes three example requests. In the first, the agent globs src/**/*.ts, finds 45 files, splits them into 4 chunks and runs 4 agents in parallel, each adding the header to its own files.
In the second, a JavaScript-to-TypeScript conversion over utils/ finds 12 files and splits them into 2 chunks. Two files can fail on complex dynamic patterns, and the summary reports them with reasons instead of stopping the batch.
In the third, the agent uses grep_search to find files containing ': any' in src/ and has workers replace the any types with proper types for a specific lint rule.
- License headers: uniform change across many files
- Format conversion: some files may fail and are reported individually
- Lint fixes: search first, then fix only the matching files
/batch Fix all @typescript-eslint/no-explicit-any errors in src/What it needs and safety notes
The skill needs Qwen Code or a compatible agent runtime that supports the tools it lists: glob, grep_search, read_file, edit, write_file, run_shell_command, task and ask_user_question. The source says the skill runs scripts and does not use the network.
The skill edits files in place and can write to disk and run shell commands. Commit your work or make a backup before running it, and review the summary and the diff afterwards. Do not rely on it for edits that depend on each other across files, because workers run independently and may conflict.
If more than 50 files match, the agent reports the exact count and file list before continuing. If more than 100 match, it warns you and asks for a more specific pattern.
- Use version control so every change can be reverted
- Keep patterns narrow for your first run
- Check the per-file report for failures and skips
Tips for better results
Write the operation as a single, checkable rule, such as 'Add JSDoc comments to all exported functions'. Workers are told to make minimal changes and to preserve existing style, so a clear rule gives the most predictable output.
For a large batch of independent one-shot transforms, such as translating or extracting each file into a new file, the skill may suggest that you type /batch-api yourself for the asynchronous Batch API. The agent cannot start that command itself, and it is not suited to in-place edits or tasks that need tool feedback.
- Test on one directory before running on the whole repo
- Name the exact file extension in the pattern
- Read the failed-files list and rerun only those files with a narrower request
What people use it for
- Adding the same license header to every source file in a folder
- Adding doc comments to all exported functions across a module
- Converting a set of .js files in a directory to TypeScript, with a per-file report
- Fixing one specific lint rule, such as replacing any types, across src/
Frequently asked questions
How do I install the batch agent skill?
Download the ZIP from this page and unzip it. Put the batch folder in ~/.claude/skills/ for personal use, or in a project's .claude/skills/ folder for one project. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
What do I need to run the batch skill?
You need Qwen Code or a compatible agent runtime that supports the tools glob, grep_search, read_file, edit, write_file, run_shell_command, task and ask_user_question. The source says the skill runs scripts and does not use the network.
Is the batch skill free to use?
The source lists the licence as Apache-2.0. The source does not mention pricing, so check the licence and your agent runtime's terms for any costs.
Can the batch skill break my code?
It edits files in place, so a bad instruction or a conflict between workers can change many files. Use version control or a backup, keep patterns narrow, and review the per-file summary and diff.
Why did some files fail or get skipped?
Common exclusions such as node_modules, test files, lock files, minified JS, binary files and files over 500KB are skipped automatically. Failures are reported per file with a reason, so you can rerun just those files with a narrower request.
Is the batch skill better than an asynchronous batch API?
They suit different jobs. /batch works on files in place with tool access and a per-file report. The skill may suggest /batch-api for many independent one-shot transforms that can wait minutes to hours, but that command is not suited to in-place edits.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a developer or team that needs the same change applied across many source files and wants a per-file success and failure report. Pick something else if your edits depend on each other across files, or if your codebase has no version control or backup, since the skill edits files in place and runs shell commands.
Download the skill