agent-routing
Decide which model, effort level, and cascade shape each subagent gets, and how to keep improvement loops safe…
Improves a program against an automatic scorer by running rounds of cheap Haiku 5.5 swarms, where each proposer suggests one short idea and one writer per swarm turns the ideas into a new program that is scored and kept in an archive, all metered to a dollar cap through headless
Claude Code
$ npx -y skills add oaustegard/claude-skills --skill evolving-with-swarms --agent claude-code
Codex
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a codex -y
Cursor
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a cursor -y
Gemini CLI
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a gemini-cli -y
GitHub Copilot
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a github-copilot -y
OpenCode
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a opencode -y
Windsurf
$ npx skills add oaustegard/claude-skills --skill evolving-with-swarms -a windsurf -y
name: evolving-with-swarms description: Improves a program against an automatic scorer by running rounds of cheap Haiku 5.5 swarms, where each proposer suggests one short idea and one writer per swarm turns the ideas into a new program that is scored and kept in an archive, all metered to a dollar cap through headless claude -p. Use for "evolve this program against my evaluator", "optimize this function's score cheaply", "OpenEvolve-style search on a budget", "AlphaEvolve-style construction search with Haiku", "run a swarm to maximize this score", "search for a better heuristic or construction", or any program whose quality a script can score, when the budget is small. Ships the driver, a gateway with a dollar cap and a usage-window pause, a sandbox hook for model-written code, an example problem and an offline selftest; runs from Claude Code on the web or the desktop. metadata: version: 0.1.1
Each round, `scripts/evolve.py` runs K swarms in parallel. A swarm is N proposer calls, each reading one parent program and one focus x thinking-style prompt and replying with an idea of at most 45 words, then one writer call that turns the ideas and the parents into a complete program. The program is scored by your evaluator as soon as it exists and joins the archive the next round draws parents from: refine one of the best two, combine three of the best ten, explore two from anywhere, start fresh from the initial program. Every model call goes through headless `claude -p`, is priced at list rates from its `modelUsage`, and counts against a dollar cap.
The design is a text-only version of SwarmEvolve (Jiang and Karniadakis, arXiv 2611.08483), whose agents think inside an open model's activations, which an API model does not expose.
Measured 2026-11-09 against stock OpenEvolve on Sonnet 5.5, three seeds per arm, three problems ([references/evidence-2026-11.md](references/evidence-2026-11.md)):
| | swarm (defaults) | Sonnet loop, best effort per problem | |---|---|---| | $ to 99% of reference, circle packing | $0.013–0.019 | $0.32–0.44 | | $ to 99%, hexagon packing | $0.035–0.060 | $0.53–0.58 | | $ to 99%, Heilbronn triangle | $0.09–0.50 | $0.77–1.02 | | best at $0.25 | above every paired Sonnet seed on all three | | | final score at $3 | swarm stops at 60 min, about $1 | the same finals, in 7–42 minutes |
Use the swarm when the budget is small or the goal is "good, cheaply". When the last 0.1% matters, the money is there, and wall-clock time counts, a Sonnet loop at the problem's best effort level gets to the same place faster.
| situation | use instead | |---|---| | hundreds of failing tests to drive to green | `swarming-to-green` | | choosing a model or effort for one subagent or a cascade | `agent-routing` | | many independent tasks with checkable outputs, not one program to improve | `dispatching-subagents` (headless runner) | | quality only a person or a judge model can rate | no scorer, no search: write the scorer first, or use a judged loop | | claude.ai chat, where there is no `claude` binary | `orchestrating-chat-agents` |
Abandon a run mid-way when:
problem allows: the scorer has a hole and the search is now optimising the hole;
parenting the same program: the archive has converged, and more rounds buy nothing;
| rule | banned when | earned when | |---|---|---| | writer at effort medium | — | effort low on a problem already known to be easy (circle packing: low reached 0.999 cheaper) | | N=8 proposers per swarm | the problem is new and N=0 has not been tried | an N=0 control on this problem lost to N=8 (on circle packing the writer alone nearly tied) | | no sandbox prefix | the evaluator imports model-written code on a machine with secrets or network | a throwaway container with no credentials, and the user agreed |
1. **Make a problem directory.** Copy `assets/example/` and replace its four files:
score under `score_key` (default `combined_score`) and an `error` key on failure;
2. **Score the initial program by hand** and read the dict:
python3 -c "import importlib.util as u; s=u.spec_from_file_location('e','evaluator.py'); e=u.module_from_spec(s); s.loader.exec_module(e); print(e.evaluate('initial_program.py'))"A score of 0 with no `error`, or a missing `score_key`, means the contract is wrong; fix it before spending anything. 3. **Set `score_max`** from a bound you can prove (a known optimum, an area or volume bound), slightly above it. Scores above it count as 0 and are flagged. Leave it unset only when no bound exists, and then re-check the best program independently. 4. **Choose the sandbox.** The evaluator imports and runs model-written code.
[sandbox]
prefix = ["sh", "/home/user/claude-workspace/scripts/jail.sh", "-C", "{run_dir}", "--"]
chown_uid = 65534and put `--run-dir` under `/tmp/jail/<name>/` (mkdir and `chmod 755` it first). Launch through a script file: the hub's jail_route guard refuses a Bash command that names `/tmp/jail/` next to `python3`.
(add numpy or what the evaluator needs to the image).
A collection of Claude skills distributed as a Claude Code plugin marketplace. Skills are primarily designed for the Claude.ai PaaS skill compute environment; mileage will vary if used as Claude Code Agent Skills.
Decide which model, effort level, and cascade shape each subagent gets, and how to keep improvement loops safe…
Cross-context adversarial review for deliverables before shipping. Use when producing blog posts, technical recommendations,…
Convenes expert panels for problem-solving. Use when user mentions panel, experts, multiple perspectives, MECE, DMAIC, RAPID, Six…
Routes, triages, flags and rates a piece of text with a probability for every option: which department or queue a ticket goes to,…
Delegates work to a subagent or spawned session by writing only the task, while a PreToolUse hook pages the parent transcript…
Chooses how to launch subagents from Claude Code (the Agent tool, a Workflow script, or headless claude -p children) and runs a…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent…
Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…