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.
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/swarmRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/langchain-ai/langchain-skills /tmp/langchain-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/langchain-skills/config/skills/swarm ~/.gemini/antigravity-cli/skills/swarmAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
