evolve
Population-based evolutionary search for code optimization. Maintains k candidates, evaluates against a fitness function, selects survivors, breeds new candidates via LLM mutation and crossover until fitness converges.
npx skills add majiayu000/claude-skill-registry --skill evolve-corygabrielsen-skills --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Implements a population-based evolutionary search to optimize code. It maintains a population of k candidates, evaluates each against a user-provided fitness command, selects the top survivors, and breeds new candidates via LLM-driven mutation and crossover until the fitness converges.
How it works
- Activation initializes by parsing args: fitness command, target files, population size (-k), max generations (-g), and stale limit (-s). It validates the fitness command by running it once and ensuring the last stdout line is a number.
- Seed (Generation 1) creates an initial population by spawning k agents in parallel, each writing to a separate branch evolve/gen1-{id} with a distinct focus lens to drive diversity.
- Evaluate runs the fitness command on each candidate branch in sequence, recording the numeric score from the last line of stdout and marking non-zero exit codes as invalid (-inf score). Branches return to the base after evaluation.
- Select sorts candidates by fitness, keeps the top ceil(k/2) as survivors, and deletes the rest, recording lineage in state.
- Report presents a leaderboard with candidate details, delta from baseline, and fitness trend, and requires human input via AskUserQuestion before continuing.
- Breed creates new candidates to bring the population back to k, assigning operators (roughly 50% point mutation, 25% crossover, 25% fresh random), spawning agents in parallel to generate evolve/gen{N+1}-{id} branches from parents, then evaluating in the next cycle.
- Loop continues until convergence, a budget is exhausted, or a winner is selected; convergence is defined by a fitness plateau or reaching max_generations.
When to use it
Use when you want to explore multiple potential code optimizations in parallel, leverage LLM-driven mutations and crossovers, and require human oversight at key checkpoints (leaderboard review and final winner disposition).
What it can touch
- Tools: claude-code is declared for use by the skill.
- The process touches git branches (evolve/gen*-*) for seeds, mutations, and survivors, and reads/writes target files specified by --files or prompted during activation.
Caveats
- Fitness validation is required to avoid wasted generations if the fitness command is broken.
- Target files may be prompted if not provided; ensure access to the repository state.
- The architecture relies on LLMs for mutation and crossover, which may introduce non-determinism and require careful interpretation of results.
# Evolve You don't find the best implementation by improving one. You find it by improving many and keeping the winners. ## Why This Works Hill climbing improves a single candidate and hopes it's in the right basin. Evolutionary search maintains a population — multiple candidates exploring different regions of the solution space simultaneously. Selection keeps the best, mutation explores nearby, crossover combines good ideas, and fresh random prevents the population from collapsing to a local optimum. LLMs make vastly better mutation operators than random perturbation. They understand code semantics, so mutations are meaningful — not "flip a bit" but "swap the sorting algorithm" or "add a caching layer." This turns evolutionary search from brute force into intelligent exploration. ## Relationship to Existing Skills | Aspect | `loop-codex-review` | `spike` | `evolve` | | -------------- | ------------------------- | -------------------- | ------------------------------ | | **Candidates** | 1 (hill climbing) | N (one-shot) | k per generation (iterated) | | **Fitness** | Binary (clean/issues) | Human judgment | Quantitative (scalar score) | | **Iteration** | Review-fix loop | None | Ge
- Why This Works
- Relationship to Existing Skills
- Core Concept
- On Activation
- State Schema
- Phase: Initialize
- Do:
- Don't:
- Fitness validation
- Args examples
- Phase: Seed (Generation 1)
- Focus Lenses
- Agent prompt template (seed)
- Phase: Evaluate
if [ $exit_code -ne 0 ]; then echo "Fitness command failed (exit $exit_code)" exit 1 fi echo "$score" | grep -qE '^-?[0-9]+\.?[0-9]*$' git checkout "$BRANCH" if [ $exit_code -eq 0 ]; then else git checkout "$BASE_BRANCH" git checkout $BASE_BRANCH
What does the evolve skill do?
Population-based evolutionary search for code optimization. Maintains k candidates, evaluates against a fitness function, selects survivors, breeds new candidates via LLM mutation and crossover until fitness converges.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill evolve-corygabrielsen-skills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
