PlugWiki

swarm Skill (LangChain): Run Many Independent Items in Parallel

Runs one instruction over many files or records in parallel, one row per item, then lets the agent summarize the results.

Installs
9.1K
on skills.sh
Stars
1.3K
on GitHub
Files
8
besides SKILL.md
Updated
Oct 2026
last repo commit

swarm makes the agent build a table (one row per file or record), run an instruction template on every row with sub-agents or direct model calls, and merge structured results back into the table. Afterward it counts or filters the rows with plain JavaScript.

Who can use it: only agents running in a LangChain-style runtime that provides the @langchain/quickjs code interpreter with the swarm_task tool (SKILL.md frontmatter lists swarm_task read_file write_file edit_file glob as required). The scripts throw an error if swarm_task is not configured. Neither SKILL.md nor the README says Claude Code or Codex provides that tool, so installing the skill there does not make it work.

Good for

  • Developers whose LangChain agent runtime provides the @langchain/quickjs interpreter and the swarm_task tool
  • Teams running one instruction over many files or records, such as a security review of src/**/*.ts, inside that runtime
  • Not for plain Claude Code or Codex users: SKILL.md names no way to get swarm_task there

Install swarm

Claude Code

  1. 1

    Copy this prompt.

    Install the swarm skill in Claude Code. Run this command:
    
    /plugin marketplace add langchain-ai/langchain-skills
    /plugin install langchain-skills@langchain-skills
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Installing the skill is not enough, and it is meant for a LangChain-style agent runtime, not plain Claude Code. SKILL.md says it requires the @langchain/quickjs code interpreter with the swarm_task tool, and the scripts stop with an error if swarm_task is missing. Neither file says Claude Code provides them. The plugin installs the repo's skills (22 in the repo tree, 21 per the README); its plugin.json lists only skills, with no hooks.

From the project README. Source.

What's in the skill

When it loads

Dispatches many independent items in parallel: create a table, fan out to subagents, aggregate results. One row = one unit of work.

Sections in SKILL.md

  1. Flow
  2. Choosing a source
  3. When to use subagentType
  4. Instruction + context
  5. Structured output
  6. Batching
  7. Aggregation
  8. Chaining passes
  9. Action-only tasks
  10. Filtering
  11. Technical notes
  12. API Reference
  13. create(source)
  14. run(tableId, options)
  15. rows(tableId, options?)

Key facts

Installs on skills.sh
9,114 (Nov 2, 2026)
Last commit
Oct 29, 2026

What it includes

  • Builds a table from a glob, a file list or ready-made records

    Returns a handle with id, row count and columns. glob and filePaths give one row per file; tasks gives one row per record you pass.

    Try: “Review every file in src/**/*.ts for security issues”

    Files · create

  • Sends an instruction template to every row and merges results back

    Needs instruction and responseSchema. Optional: context, filter, subagentType, batchSize and concurrency (default 10, clamped 1 to 10). Returns completed, failed, skipped and failures.

    Runs code · run

  • Reads rows back for counting, filtering or summarizing in plain JS

    Options: filter, columns, limit. SKILL.md says not to spawn more sub-agents for aggregation.

    Read · rows

  • Without it each row is a direct model call; with it, a full agent loop

    Omit it for classification and extraction; set it when the task needs tools, files or multi-step reasoning. The direct call is described as cheaper and faster.

    Runs code · subagentType

  • Groups rows to keep dispatches under 10, or you set the size

    Auto-batching applies by default. A number or a per-row function is allowed; sizes are clamped to 1 to 50.

    batchSize

  • Reruns only failed rows with exists: false, or any column match

    Filters support equals, notEquals, in, exists, and, or. Chained runs add columns to the same table.

    filter and retry

  • Sub-agents can write files or apply fixes instead of returning data

    The example adds missing JSDoc to every exported function across src/**/*.ts, with a retry for rows that failed.

    Write · Action-only tasks

From the official docs

Permissions

Medium risk

A single run can send many model or sub-agent calls, and action tasks let sub-agents edit files across a whole glob. Try a small table first and keep your work under version control.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • One run can make many model calls

    run dispatches an instruction to every row, up to 10 at once, in batches. Cost and quota depend on your agent setup, so start with a few rows. github.com

  • Sub-agents can edit many files

    The action-only example adds JSDoc to every exported function across src/**/*.ts. Use a narrow glob and review the diff. github.com

  • It keeps table files on disk

    SKILL.md tells the agent never to write to .swarm/ directly; tables are created through create(). The script keeps up to 5 tables per session. github.com

Technical details
Scopes
  • Reads files matched by your glob

  • Sub-agents can edit those files for action tasks

  • Table files stored under .swarm/

Questions

What does the swarm skill do?

It splits a big job into rows, runs the same instruction on each row in parallel, and merges the results into one table. It suits labeling, extraction and reviewing many files.

How do I install swarm in Claude Code?

The install box shows the commands, but installing is not enough. SKILL.md says the skill requires the @langchain/quickjs code interpreter with the swarm_task tool, and the scripts raise an error if swarm_task is missing. The README does not say how to provide either.

Who can actually use swarm?

Only agents running in a LangChain-style runtime that supplies the @langchain/quickjs interpreter and the swarm_task tool. Neither SKILL.md nor the README says Claude Code, Codex or the Claude app provide them, so do not expect it to run there. We list no Claude app route because it needs a local QuickJS interpreter.

When should I set subagentType?

Only when each row needs tools, file access or multi-step reasoning. For classification and extraction, SKILL.md says to omit it, because a direct model call is cheaper and faster.

How many things run at once?

Up to 10 at a time by default, and the setting is clamped to 1 to 10. Auto-batching keeps the number of dispatches under 10 unless you set batchSize.

Can it change my files?

Yes, if you ask for an action task with a subagent. SKILL.md's example has subagents add JSDoc to every exported function in src/**/*.ts. Use version control and try a small glob first.

Is swarm safe?

It bundles 8 TypeScript scripts and fans one instruction out to many model or subagent calls, so a run can use a lot of your model quota. Sub-agents can edit files when you give them an action task. Try a small table first.

Information

updated Nov 2, 2026

Folder
config/skills/swarm

langchain-ai/langchain-skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. github.com · github.com
  2. github.com · github.com
  3. github.com · github.com
  4. github.com · github.com
  5. github.com · github.com

Updated Nov 2, 2026.