Evolver: The Self-Improving AI Agent That Rewrites Its Own Code
19,383 downloads, 53 stars. Evolver by @autogame-17 is a meta-skill — a skill that modifies other skills. It reads your agent's runtime history, identifies patterns of failure or inefficiency, writes new code or memory updates, and applies them. In its default mode, it does this automatically, without waiting for you to notice something's wrong.
This is what people usually mean when they say "self-improving AI." Evolver is one of the few practical implementations of it.
The Problem It Solves
Agents accumulate technical debt silently. A tool call pattern that worked in March breaks in April. A memory file grows stale. An error gets swallowed and re-encountered three times in a week. Most agents don't notice because they don't introspect — they just try again.
Evolver watches the history. When it finds a pattern — crashes, repeated failures, inefficient approaches — it doesn't just flag it. It proposes a fix, validates it against a protocol, and applies it.
The key word is protocol-constrained. This isn't unchecked self-modification. Every evolution passes through the GEP (Gene Evolution Protocol) system, which tracks what changed, why, and what happened before.
How It Works
node index.js # Standard run (automated / "Mad Dog Mode")
node index.js --review # Human-in-the-loop: pause before applying changes
node index.js --loop # Continuous loop (for cron or background process)The evolution cycle:
- Scan — Reads memory files and runtime history
- Analyze — Identifies errors, crashes, repeated failures, or inefficiencies
- Propose — Generates a patch (code change, memory update, new strategy)
- Validate — Checks against GEP protocol constraints
- Apply — Writes the change to disk (in standard mode) or presents for review
Two modes handle different risk tolerances.
GEP Protocol — Auditable Evolution
What distinguishes Evolver from raw self-modification is the GEP (Gene Evolution Protocol) asset store:
assets/gep/genes.json # Reusable Gene definitions (stable patterns)
assets/gep/capsules.json # Success capsules (reasoning that worked)
assets/gep/events.jsonl # Append-only evolution event log (tree structure)
events.jsonl is an append-only log — every evolution is recorded with a parent ID, creating a tree of changes. If an evolution makes things worse, you have a full audit trail of what changed and can roll back.
capsules.json prevents re-reasoning from scratch. When an evolution succeeds, the reasoning gets captured and reused — it's a form of institutional memory for the evolution process itself.
Evolution Strategies
Evolver supports six named strategies:
| Strategy | Behavior |
|---|---|
balanced | Mix of fixes and optimizations (default) |
innovate | Prioritize new capabilities over fixes |
harden | Stability first — reduce risk |
repair-only | Only fix bugs, no refactoring |
early-stabilize | Aggressive stabilization in early runs |
steady-state | Light-touch optimization for stable agents |
auto | Agent selects strategy based on runtime state |
Set via environment variable:
EVOLVE_STRATEGY=repair-only node index.jsConfiguration
# Allow the evolver to modify its own source code
# WARNING: Can cause cascading failures. Controlled experiments only.
EVOLVE_ALLOW_SELF_MODIFY=false # default
# Back off if system is under load
EVOLVE_LOAD_MAX=2.0 # max 1-min load average
# Evolution strategy
EVOLVE_STRATEGY=balanced
# Report tool override (e.g., feishu-card for team notifications)
EVOLVE_REPORT_TOOL=messageThe EVOLVE_ALLOW_SELF_MODIFY flag deserves a pause. By default, Evolver can modify your other skills but not its own source code. Enabling this is explicitly described as risky — if the evolver introduces a bug in its own prompt generation, it may not be able to reason correctly to fix itself. Cascading failure territory.
Review Mode — Human in the Loop
For production or sensitive environments:
node index.js --reviewIn review mode, Evolver pauses after proposing each change and asks for confirmation before applying. You see exactly what it wants to change and why — then decide.
This is the recommended mode for:
- First runs in a new environment
- Any agent that manages critical data
- Situations where rollback is expensive
Real-World Use Cases
Automated bug repair — Run Evolver on a schedule after deploy. It scans the latest logs, identifies errors that repeated more than N times, and proposes targeted patches.
Memory hygiene — Stale memory files mislead agents. Evolver can identify outdated entries and update or remove them.
Performance optimization — If an agent repeatedly uses a slow approach when a faster one exists, Evolver detects the pattern and proposes a refactor.
Cron-based self-improvement — Combined with --loop:
# Run Evolver every night in review mode
0 2 * * * node /path/to/evolver/index.js --review >> /var/log/evolver.log 2>&1Safety Considerations
Evolver is explicit about its risks in its own documentation:
- Infinite recursion protection — Strict single-process logic prevents concurrent runs
- Git sync recommended — Always run with a git-sync cron alongside it so changes are versioned
- Load average backoff — Evolver won't run if system is under heavy load (
EVOLVE_LOAD_MAX) - Audit trail — All changes are in
events.jsonl; nothing is irreversibly applied without a log entry EVOLVE_ALLOW_SELF_MODIFY=falseby default — The most dangerous flag is off unless you explicitly enable it
The safety model is honest: self-modification is genuinely risky, these mitigations reduce but don't eliminate that risk, use --review in production.
Comparison
| Feature | Evolver | Manual Code Review | self-improving-agent |
|---|---|---|---|
| Automated analysis | ✅ | ❌ | ✅ |
| Auditable change log | ✅ GEP events.jsonl | Depends on git | Varies |
| Strategy selection | ✅ 6 strategies | ❌ | ❌ |
| Review mode | ✅ --review | N/A | Varies |
| Self-modification guard | ✅ explicit flag | N/A | Varies |
| Reusable success patterns | ✅ capsules.json | ❌ | ❌ |
The Bigger Picture
Evolver represents one real answer to the question "how do agents get better over time without human intervention?" Not through model updates or retraining, but through code-level evolution — patching the skills and memory that shape agent behavior.
The GEP protocol shows that the hard part isn't the self-modification itself. It's building the scaffolding that makes self-modification safe enough to run unattended. Audit trails, strategy constraints, load limits, self-modification guards — these aren't features, they're the thing that makes automated evolution viable outside of controlled experiments.
19,000+ downloads suggests the AI agent community is taking self-improvement seriously as a practical capability, not just a research concept.
View the skill on ClawHub: evolver