Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

swarm

Skill by langchain-ai

Swarm runs many independent items in parallel and merges the results back into a table. It is for agents that classify, extract, label or review large sets of files or records inside the @langchain/quickjs interpreter.

  • Score 86
  • 1.4k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install swarm

Built from the published package, never by AI.

git clone --depth 1 https://github.com/langchain-ai/langchain-skills /tmp/langchain-skills && mkdir -p ~/.claude/skills && cp -r /tmp/langchain-skills/config/skills/swarm ~/.claude/skills/swarm

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install swarm in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Swarm is an agent skill that processes many independent items in parallel. You create a table from files, a glob pattern, or pre-parsed records, with one row per item. Then run dispatches an instruction template across the rows and merges the structured results back into the table as new columns.

Each dispatch is either a direct model call or, when subagentType is set, a full agentic loop with a named subagent. Batching is automatic by default and keeps total dispatches under 10 for larger tables. Failed rows can be retried with a filter, and rows() supports plain JavaScript aggregation. It is aimed at developers using the @langchain/quickjs code interpreter with the swarm_task tool.

Written from the project's SKILL.md and checked against it.

What it can do

  • createBuilds a table handle from a glob, a file list, or custom task records.
  • runDispatches an instruction template across rows and merges results into the table.
  • rowsRetrieves rows with filters and column projection for inspection or aggregation.
  • Structured outputUses a required responseSchema so schema properties become row columns.
  • BatchingGroups rows automatically or with a batchSize number or function.
  • Subagent dispatchRuns a named subagent with tools when subagentType is set.
  • Retry failed rowsReruns only rows matching a filter such as exists false.
  • Chained passesLets later run calls add columns to the same table in place.

What you need

  • @langchain/quickjs code interpreter
  • swarm_task PTC tool
  • read_file, write_file, edit_file and glob PTC tools

Try asking

  • Classify the sentiment of every record in this JSONL file using swarm.
  • Review every TypeScript file under src for security issues with swarm.
  • Retry only the rows that failed in my last swarm run.

Good to know

  • Concurrency is clamped to 1 to 10 concurrent dispatches.
  • Batch sizes are clamped to 1 to 50.
  • Console output is capped at about 5 KB.
  • Row ids must be unique, and create() rejects duplicate ids.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: config/skills/swarm/SKILL.md, config/skills/swarm/scripts/batching.ts, config/skills/swarm/scripts/executor.ts, config/skills/swarm/scripts/filter.ts, config/skills/swarm/scripts/index.ts, config/skills/swarm/scripts/interpolate.ts, config/skills/swarm/scripts/table.ts, config/skills/swarm/scripts/types.ts, config/skills/swarm/scripts/utils.ts. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to swarm

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

swarm: common questions

What is one row in a swarm table?

One row is one unit of work. For file sources each row is one file, and for task sources each row is one record you pass in.

When should I set subagentType?

Omit it for classification, extraction and labeling where one model call with structured output is enough. Set it when the task needs tools, file access or multi-step reasoning.

How do I rerun only the failed items?

Call run again with a filter such as column result and exists false, so only unprocessed rows are dispatched.

How do I install swarm?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is swarm free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is swarm safe to use?

It scores 86 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to swarm?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

Add to stack

Loading.