local-swarm
Skill1 starsChanged 28 days agoMITView on GitHub
Delegate mechanical, low-judgment work (boilerplate, log or diff summarization, formatting, repetitive transforms, first-draft docs) to local or self-hosted models through the local-swarm-mcp MCP server, to save the main model's tokens. Use when the local-swarm-mcp MCP tools (delegate_task, spawn_task, ...) are available and a task is mechanical enough that a smaller model can do it and the result is cheap to check; also when the user asks to "use the local model", "delegate", "offload", or "save tokens". Do not use for architecture decisions, security-sensitive work, or anything whose correctness can't be verified quickly.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mazze93/claude-code-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mazze93/claude-code-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
If nothing is healthy, fall back to doing the work yourself.
- Very specific: line 60
Put the whole task in prompt, self-contained: it sees nothing of your conversation.
- Very specific: line 63
Use temperature: 0 for transforms and extraction (it is honored, not dropped).
- Very specific: line 66
Ask for one thing per call.
- Distinctive: line 71
Treat delegated output like a junior's first draft:
- Distinctive: line 73
Read it before using it. Check code compiles or tests pass, JSON parses, numbers and paths match the source.
- Distinctive: line 78
If the output is wrong twice, stop delegating that task and do it yourself.
- Distinctive: line 95
Don't treat that as data loss.
- Very specific: line 99
Never put secrets, tokens, or .env contents in a prompt.
- Very specific: line 100
Never call register_downstream_mcp_server (when offered at all) or register_backend_host unless the user asked for that specific server or …
- Very specific: line 103
Never point spawn_agent_task at downstream servers with destructive tools unless the user explicitly wants that.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Delegating to local models with local-swarm-mcp
local-swarm-mcp runs tasks on models the user hosts (Ollama, llama.cpp, vLLM, or any OpenAI-compatible endpoint). Those models are cheaper and weaker than you: delegate work that is mechanical and cheap to verify, and keep judgment for yourself. The server is a cost optimization, never a hard dependency - when it isn't usable, do the work yourself.
Tool names below are the bare MCP names. Each agent shows them with its
own prefix for the server (e.g. mcp__local-swarm-mcp__delegate_task in
Claude Code); match on the part after the server name.
1. Check availability first
list_backends- the first entry is the default used when you omitbackend. Empty list → no model is configured; skip delegation.health_check(optionally withbackend) - confirms the endpoint answers right now. A discovered host that went offline drops out oflist_backendson its next poll;list_backend_hostsshowsup.- If nothing is healthy, fall back to doing the work yourself. Don't retry in a loop or ask the user to start their GPU box unless they asked you to use the local model specifically.
2. Decide whether to delegate
Delegate when all of these hold:
- The task is mechanical: transform, summarize, extract, reformat, generate boilerplate from a clear spec.
- You can check the output faster than you could write it.
- The input contains no secrets, credentials, or data the user wouldn't
send to that backend (it may be a remote host - check
base_url).
classify_task_risk is a fast keyword check (destructive git/DB
operations, secrets, "architecture", "production", "security"). A
risk=high result means do it yourself; risk=low is not a
guarantee - still apply the rules above.
3. Pick the right tool
| Situation | Tool |
| One short request, you need the answer now | delegate_task |
| Long-running or several independent pieces | spawn_task per piece, then wait_task (or task_status) |
| Iterative work where later turns need earlier context | create_session → send_message … → close_session |
| A large blob is filling your context | estimate_tokens, then compact_context with preserve_instructions |
| Stash a big intermediate result outside your context | scratch_set / scratch_get / scratch_list / scratch_delete |
| The model must call tools itself (e.g. query a code index) | spawn_agent_task - see references/tools.md |
Prompting a small model well:
- Put the whole task in
prompt, self-contained: it sees nothing of your conversation. Usesystem_promptfor the output contract ("Reply with only the JSON, no prose"). - Use
temperature: 0for transforms and extraction (it is honored, not dropped); keep the default 0.2 for prose. - Set
max_tokensto what the answer needs; the default is 1024. - Ask for one thing per call. Split big jobs into several
spawn_tasks rather than one giant prompt.
4. Always verify the result
Treat delegated output like a junior's first draft:
- Read it before using it. Check code compiles or tests pass, JSON parses, numbers and paths match the source.
- For
spawn_agent_task, read thetranscriptin the finaltask_status/wait_taskresult to see which tools it actually called; don't trust a claim the transcript doesn't support. - If the output is wrong twice, stop delegating that task and do it yourself.
- Tell the user when a result came from the local model, if it matters to them.
5. Limits worth knowing
wait_taskreturns an error with asnapshot=of the task when itstimeout_seconds(default 120) passes; the task keeps running - wait again orcancel_taskit.- Finished tasks are dropped after an hour (at most 500 kept): fetch results you need promptly.
- Sessions keep only their last 40 messages.
- Requests queue when a backend host already has its maximum in flight
(default 4), so many parallel
spawn_tasks finish over time, not at once. scratch_*may answer "held by another local-swarm-mcp process" when another session or the daemon owns the store; it retries on every call. Don't treat that as data loss.
Never
- Never put secrets, tokens, or
.envcontents in a prompt. - Never call
register_downstream_mcp_server(when offered at all) orregister_backend_hostunless the user asked for that specific server or host: both make this server run commands or send data somewhere new. - Never point
spawn_agent_taskat downstream servers with destructive tools unless the user explicitly wants that; restrict it withmcp_servers.
For per-tool parameters, model capability notes, and troubleshooting, see references/tools.md, references/models.md, and references/troubleshooting.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

