code-evolve
v0.3.1
Published
Turn any project into a self-evolving codebase — autonomous build-and-improve cycles driven by Claude Code, Codex, OpenCode, or Ollama.
Maintainers
Readme
code-evolve
Describe what you want. Walk away. Come back to working software.
code-evolve is an autonomous project builder. Give it a vision and a technical spec, and it builds your project from scratch — then keeps improving it, session after session, commit after commit, day after day.
You define the what and why. The agent figures out the how.
The Idea
Most AI coding tools wait for you to tell them what to do next. code-evolve doesn't wait. It reads your vision, checks the spec, looks at what's already built, decides what to work on, implements it, verifies the build passes, writes a journal entry about what it learned, and commits. Then it does it again. And again.
Every 4 hours, your project gets a little closer to matching your vision.
Day 0 — Reads your spec. Sets up the project scaffold. First test passes.
Day 1 — Implements the core feature. Writes integration tests.
Day 3 — Adds the CLI interface. Fixes a bug from Day 1.
Day 7 — Responds to a GitHub issue. Polishes error messages.
Day 14 — Your project works. You barely touched a keyboard.Getting Started: New Project
Detailed install, agent setup, verification, and troubleshooting: see INSTALL.md.
Quickest path: run npx code-evolve with no subcommand. It finds Claude Code, Codex or OpenCode on your PATH (asking only if there are several), installs .evolve/, and opens that agent with the evolve-setup skill, which walks you through vision, spec and schedule in conversation. Without a terminal or an agent it prints the exact command for each agent instead.
Run headless (claude -p, codex exec, a CI job), evolve-setup asks nothing: it uses its recommended answers, installs no schedule (cycles then run inside an agent session or with npx code-evolve run), and lists what it assumed. For cycles that run on your machine you do not need to commit what setup installed: the first cycle commits it on its own (code-evolve: add the engine and setup files) before it starts on a feature, and leaves your other uncommitted work out of that commit. If AGENTS.md, CLAUDE.md or .gitignore also has uncommitted edits of your own, that file is left out and the cycle says so. An install you keep out of git with an ignore rule is not committed. GitHub Actions and cloud scheduled tasks work from the remote, so for those commit and push the install yourself first.
From inside Claude Code (plugin)
This repository is its own Claude Code marketplace. Install the plugin into your project, then run its setup skill:
claude plugin marketplace add frankbria/code-evolve
claude plugin install code-evolve@code-evolve --scope project(Inside a session, the same works as /plugin marketplace add frankbria/code-evolve and /plugin install code-evolve@code-evolve; Claude Code 2.1.275 or later also takes /plugin install code-evolve --marketplace frankbria/code-evolve.) Then run /code-evolve:evolve-setup.
Setup installs the same skills into your project's .claude/skills/, so the plugin's copies (/code-evolve:evolve-run) and the project's (/evolve-run) both appear. Use the project copies once setup has run: they match the engine version installed in .evolve/, and they reach teammates and other agents without the plugin. You can remove the plugin afterwards with claude plugin uninstall code-evolve --scope project, but keep it if you want its protected-files hook.
Session-start nudge. When a new session starts in a git repository, the plugin says one line if code-evolve needs attention: the repository isn't set up yet (run /code-evolve:evolve-setup), or its installed engine is older or newer than the plugin (run npx code-evolve@latest upgrade, or update the plugin). Otherwise it stays silent.
Protected-files hook. The plugin adds a PreToolUse hook that stops the agent from editing code-evolve's protected files (.evolve/IDENTITY.md, the engine in .evolve/scripts/ and .evolve/skills/, and the evolve workflows; the list is .evolve/scripts/protected-paths.txt) and tells it why. It catches file edits and obvious shell writes (>, sed -i, rm, git checkout --, …), not every possible command. The engine still restores those files after every agent call, so this is a time-saver, not the enforcement; claude --bare skips plugin hooks entirely.
From inside Codex and other Agent Plugins clients
The plugin folder also carries an Agent Plugins 1.0 manifest, which Codex, Cursor, Copilot and VS Code read. In Codex:
codex plugin marketplace add frankbria/code-evolve
codex plugin add code-evolve@code-evolveThen start Codex in your project and run $code-evolve:evolve-setup (Codex names plugin skills $plugin:skill; evolve-run is explicit-only, so invoke it as $code-evolve:evolve-run). Codex's default sandbox has no network and blocks some of what setup and cycles need; see the notes below. As with Claude Code, setup also installs the skills into .agents/skills/; once it has run, prefer those copies; removing the plugin (codex plugin remove code-evolve@code-evolve) also removes the protected-files hook.
Codex sandbox notes. Under codex exec -s workspace-write (and the default interactive sandbox):
- Setup needs network once for
npx: start Codex with-c sandbox_workspace_write.network_access=true, or runnpx code-evolve init --yes --agent codexin a terminal first. .agents/is read-only, so init reports the project skill copies there as left alone; the plugin's skills still work.- A cycle commits and tags, so grant write access to the repository's git directory only:
-c 'sandbox_workspace_write.writable_roots=["<repo>/.git"]'(the engine prints the exact line if it is missing). - The sandbox blocks synchronous child processes (
spawnSync/execSyncfail withEPERM); project tests that use them fail verification there.
Codex runs a plugin's hooks only after you trust them: open /hooks in Codex and approve the code-evolve hook (approve it again after each plugin update, since trust is tied to the hook's contents). Until then Codex warns at startup and skips it.
Any other agent that reads SKILL.md files can take just the skills: npx skills add frankbria/code-evolve.
Prefer to do it step by step? Three steps:
1. Initialize
npx code-evolve initThis creates .evolve/ with templates for your vision and spec.
2. Define your vision and spec
You have three options — pick the one that fits:
Option A: Guided interview (recommended for first-timers)
code-evolve vision
code-evolve specvision runs five rounds of Socratic questions — what you're building, who it's for, what problem it solves, and what success looks like. spec then interviews you on tech stack, architecture, and a prioritized feature checklist. When an agent is configured (see Multi-Agent Support), your configured LLM drafts the .evolve/vision.md / .evolve/spec.md from your answers and you can accept it or ask for a refinement; with no agent configured it falls back to a built-in template. Re-run either with --refine to revisit prior answers.
Option B: Write both files directly
Edit .evolve/vision.md and .evolve/spec.md using the templates as a guide. The templates include examples and comments explaining what each section needs.
3. Start building
export ANTHROPIC_API_KEY=sk-... # or the key for your chosen agent
code-evolve startIf you use a Claude subscription instead of an API key, initialize with --auth-mode oauth and run claude login — no ANTHROPIC_API_KEY needed.
The engine runs on a schedule (every 4 hours by default) and starts building your project autonomously.
Tip: After installing globally (
npm install -g code-evolve), you can useceas a shorthand —ce init,ce start,ce status, etc.
Getting Started: Existing Project
Already have a codebase and docs? code-evolve can adopt your project.
1. Initialize
cd your-project
npx code-evolve init2. Import your existing documents
If you already have a PRD, technical spec, or README with features listed:
# Convert an existing spec document into code-evolve format
code-evolve migrate spec ./docs/technical-spec.md
# AI-powered conversion (deeper analysis, cross-references your codebase)
code-evolve migrate spec ./PRD.md --ai
# Convert an existing overview into vision format
code-evolve migrate vision ./docs/overview.mdThe migrate command extracts features, tech stack, and architecture from your existing docs and formats them for code-evolve. Use --ai for smarter conversion that checks which features are already implemented.
You can also run the guided interview to refine an existing vision:
code-evolve vision --refineThis loads your current .evolve/vision.md and walks you through each section, showing your previous answers so you can update or keep them.
3. Review and start
Check the generated files in .evolve/, make any adjustments, then:
export ANTHROPIC_API_KEY=sk-...
code-evolve startThe agent picks up where your project left off — it reads the codebase, checks which spec features are already implemented, and starts working on what's missing.
How the Evolution Loop Works
Each cycle is autonomous and self-correcting:
Read vision + spec + journal
|
v
Assess current state ---- "What exists vs. what's specified?"
|
v
Prioritize work ---------- CI fix > bootstrap > next feature > bugs > issues
|
v
Implement + test ---------- Write code, run build, verify
| |
| Build fails?
| |
| Fix it (up to 3 tries)
| |
| Still fails? Revert. Journal the failure.
|
v
Journal entry ------------ Honest log: what worked, what didn't, what's next
|
v
Commit + tag ------------- "Day 5 (09:00): add JWT auth with refresh tokens"The journal is the agent's memory across sessions. It reads its own history to avoid repeating mistakes and to build on what worked.
Commands
All commands are available as both code-evolve <cmd> and ce <cmd>.
| Command | What it does |
|---------|-------------|
| code-evolve setup | Guided wizard: agent → interview → mode → schedule → ready (re-runnable) |
| code-evolve init | Scaffold .evolve/ with vision and spec templates |
| code-evolve vision | Guided Socratic interview to generate .evolve/vision.md |
| code-evolve spec | Guided interview to generate .evolve/spec.md |
| code-evolve migrate | Convert an existing spec/vision document into code-evolve format |
| code-evolve start | Turn on the evolution engine (local cron) |
| code-evolve stop | Pause evolution |
| code-evolve run | Run one cycle manually |
| code-evolve status | Check progress — day count, features done, schedule |
| code-evolve upgrade | Update the installed engine to this version, keeping your files |
| code-evolve eject | Remove the framework, keep everything the agent built |
| code-evolve proof | PROOF9 quality gates and requirements management (docs) |
setup
The one-command front door for new projects. On a terminal it chains the whole onboarding flow — agent + auth picker, vision + spec interview, execution mode (local/ci/both/native), and schedule — then installs everything and tells you you're live. Re-run it any time to reconfigure; it honors your existing config and preserves evolution history.
code-evolve setup # guided: nothing → fully configured, ready to evolve
code-evolve setup --agent codex --mode ci --every 6 # same flags as init, non-interactiveinit
code-evolve init # on a terminal, prompts for agent + auth (Claude/api-key by default)
code-evolve init --agent codex # skip the prompt; use Codex CLI
code-evolve init --auth-mode oauth # use Claude subscription (claude login) instead of API key
code-evolve init --with-ci # also install GitHub Actions for cloud evolution
code-evolve init --mode both # choose where evolution runs: local | ci | both | native (persisted in config)
code-evolve init --mode ci --every 6 # run every 6 hours (applies to both the CI cron and the local job)
code-evolve init --force # upgrade framework files (preserves journal + learnings)--mode is the unified execution-mode selector (also offered as an interactive prompt on a terminal). local installs a local cron job, ci installs the GitHub Actions workflows, both does both, and native installs neither because your agent's own scheduler runs the cycles; the choice is persisted in .evolve/config.json and shown by code-evolve status. --with-ci remains as an alias for --mode ci. When local/both is chosen but the agent's API key isn't set yet, the cron job is deferred — set the key and run code-evolve start.
--every <hours> (1–24, default 4) sets the evolution cadence and is applied to both targets: the installed GitHub Actions cron: and the local cron entry. On a terminal it's also offered as a prompt when a schedule is being installed.
vision
code-evolve vision # guided interview to create .evolve/vision.md
code-evolve vision --refine # revisit and improve an existing vision.mdspec
code-evolve spec # guided interview to create .evolve/spec.md
code-evolve spec --refine # revisit and improve an existing spec.mdOn a terminal, code-evolve init offers to run the vision and spec
interviews for you right after install — decline to edit the files by hand instead.
migrate
code-evolve migrate spec ./docs/technical-spec.md # regex extraction (no API key needed)
code-evolve migrate spec ./PRD.md --ai # AI-powered conversion via claude CLI
code-evolve migrate vision ./docs/overview.md # convert to vision.md format
code-evolve migrate spec ./README.md --ai --yes # skip confirmation promptstart
code-evolve start # every 4 hours (default)
code-evolve start --every 2 # every 2 hours
code-evolve start --run-now # start now, then repeat on schedule
code-evolve start --model claude-opus-4-6 # use a different modelWhat Your Project Looks Like
my-project/
├── .evolve/
│ ├── vision.md ← you write this (or use `code-evolve vision`)
│ ├── spec.md ← you write this (or use `code-evolve migrate`)
│ ├── config.json ← agent and model settings
│ ├── nested-projects.txt ← optional: nested projects to verify next to a root project
│ ├── scripts/ ← orchestration engine (protected)
│ ├── skills/ ← agent behaviors (protected)
│ ├── IDENTITY.md ← agent constitution (protected)
│ ├── JOURNAL.md ← the agent's memory
│ ├── LEARNINGS.md ← cached research
│ └── DAY_COUNT ← evolution counter
├── src/ ← the agent builds this
├── tests/ ← the agent writes these
└── .github/workflows/
├── evolve.yml ← evolution workflow (won't touch yours)
└── evolve-ci.yml ← CI workflow (renamed so it won't clobber your ci.yml)The Spec Is the Source of Truth
Your .evolve/spec.md drives everything. Features are a prioritized checklist:
## Features (Priority Order)
- [x] `api serve` — Start the HTTP server
- [x] `api health` — Health check endpoint
- [~] User authentication with JWT
- [ ] Rate limiting middleware
- [ ] WebSocket support for real-time updates
- [ ] Admin dashboardThe agent implements them top to bottom. [x] = done. [~] = in progress. [ ] = next up. The agent updates these checkboxes as it works.
Multi-Agent Support
code-evolve works with multiple AI coding agents:
| Agent | CLI | Flag |
|-------|-----|------|
| Claude Code | claude | --agent claude (default) |
| Codex CLI | codex | --agent codex |
| OpenCode | opencode | --agent opencode |
| Ollama | ollama | --agent ollama |
| Any other headless CLI | yours | --agent custom --agent-command "..." |
code-evolve init --agent codex # initialize with Codex
code-evolve run --agent ollama # one-off run with Ollama
code-evolve start --agent opencode # schedule with OpenCode
code-evolve init --auth-mode oauth # Claude subscription (no API key required)
code-evolve init --agent codex --auth-mode chatgpt # Codex with a ChatGPT login (no API key required)The --agent flag on init is stored in .evolve/config.json. Subsequent run and start commands read from config automatically. You can override with --agent on any command.
Custom agents. For any other CLI with a headless mode (Gemini, GitHub Copilot, Cursor, Goose, …), give code-evolve the command to run instead of an adapter:
- The prompt goes to the command's stdin, unless the command contains
{prompt_file}, which is replaced with the path of a file holding the prompt. {model}is replaced with the configured model (start --model/run --model); leave it out to use the CLI's own default. Placeholders are passed safely whether or not you quote them.- The command runs headless and unattended, so it must let the agent edit files and run commands without asking.
- A non-zero exit fails the session. For a CLI that exits 0 on errors, add
--agent-error-pattern '<regex>': a log line matching it fails the session too. - If the CLI reads a credential from the environment (say
GEMINI_API_KEY), name it with--agent-env GEMINI_API_KEY(comma-separate several): scheduled cycles run from cron without your shell's environment, so its current value is saved into.evolve/.env(a 0600 file). After rotating it, runcode-evolve startagain with the new value set to refresh the saved copy. Ifstart(orinit) runs in a shell where the variable is not set, it keeps the saved value and says so; set the variable to an empty string to clear the saved value. - These values are saved in
.evolve/config.json(agentCommand,agentErrorPattern,agentEnvVars). Custom agents run locally only (no GitHub Actions profile).
# Gemini CLI: -p text is appended to the prompt on stdin; yolo approves edits and commands
code-evolve init --agent custom --agent-command 'gemini -p "" --approval-mode yolo'
# GitHub Copilot CLI: takes the prompt as an argument, so read it from {prompt_file}
code-evolve init --agent custom \
--agent-command 'copilot -p "$(cat {prompt_file})" --allow-all-tools' \
--agent-error-pattern '^Error:'These flags were taken from each CLI's own --help; check yours, since headless flags change between versions.
Auth modes:
api-key(default) — set the agent's key in your environment (ANTHROPIC_API_KEYfor Claude,OPENAI_API_KEYfor Codex)oauth(Claude) — runclaude loginonce; no API key needed (requires a Claude subscription)chatgpt(Codex) — runcodex loginonce; no API key needed.runandstartcheckcodex login statusfirst, and the cron.envstores no key.
CI always uses api-key mode, whatever you choose locally.
The default model adapts to your agent (e.g., llama3 for Ollama, o4-mini for Codex). Override it per run with --model; start --model also saves it to .evolve/config.json as model, which later run and start calls use for that agent.
What has been run live with real agents, from install to a committed first cycle, is recorded in docs/demos/first-cycle-acceptance.md.
Stack Detection
Drop code-evolve into any project. It figures out how to build and test it:
| Stack | Detected by | Build | Test | Lint |
|-------|------------|-------|------|------|
| TypeScript | tsconfig.json | npm run build | npm run test | npm run lint |
| Next.js | "next" in package.json | npm run build | npm run test | npm run lint |
| Python | pyproject.toml | uv sync | uv run pytest | uv run ruff check . |
| Rust | Cargo.toml | cargo build | cargo test | cargo clippy |
| Go | go.mod | go build ./... | go test ./... | go vet ./... |
| Deno | deno.json | — | deno test | deno lint |
| Java/Kotlin | pom.xml / build.gradle | mvn compile / gradle build | mvn test / gradle test | — |
| C#/.NET | *.csproj / *.sln | dotnet build | dotnet test | — |
| Ruby | Gemfile | bundle install | rspec / rake | rubocop |
| PHP | composer.json | composer install | composer test / phpunit | — |
| C/C++ | CMakeLists.txt | cmake --build build | ctest | — |
| Static | index.html | — | — | — |
Package managers (npm, yarn, pnpm, bun), Python tooling (uv, poetry, pip), and
the Gradle wrapper (./gradlew) are detected automatically.
Python without uv or poetry is checked with the tools that are installed, taken from the
project's .venv when it has one and from PATH otherwise (pytest is never taken from PATH
for a project with a .venv: it would run on another Python):
| Check | Command | When |
|-------|---------|------|
| Build | python3 -m pip install -e . (or -r requirements.txt) | pip can install here: a .venv with pip, an active virtual environment, or a Python that is not externally managed. A .venv without pip is installed into with uv pip install when uv is available |
| Test | pytest | pytest is installed |
| Test | python3 -m unittest discover | pytest is not installed, the project does not name pytest (dependency, configuration, conftest.py or an import pytest in a test file), and the whole suite is unittest.TestCase classes, with no load_tests hook, in test*.py files that discovery reaches: next to the code, in tests/, or in packages below either (tests/unit/, app/tests/, with an __init__.py at each level) |
| Lint / format | ruff check, ruff format --check | ruff is installed |
The test files are parsed, not imported, to tell the two kinds of suite apart (a file the
installed Python cannot parse counts as pytest's). Any other test
layout still gets pytest (.venv/bin/python -m pytest with a .venv) when it is missing, so the
run reports the missing tool instead of skipping tests.
uv and poetry projects run a tool through uv run / poetry run when the lock file names
it. Without pytest in the lock, the same unittest rule applies (uv run python -m unittest
discover); without ruff in the lock, the ruff of .venv or PATH is used, or lint is skipped. Tree-wide linters and formatters (ruff, deno) skip .evolve/, .claude/ and
.agents/, so the engine's own files never fail your project's checks.
Monorepos and nested projects are supported automatically. If no stack marker is found at the project root, code-evolve scans immediate subdirectories. Each project it finds there (e.g., backend/ with Python and frontend/ with Next.js, or a single app/) is verified independently — build, test, and lint run in that project's own directory. The post-session fix loop and CI workflow both handle monorepos.
A project at the root hides the ones below it, unless you list them. When the root has its own stack marker (say a package.json) and api/ is a project too, only the root is verified by default: checking every subdirectory would run make or npm run build in folders you never offered for it, such as examples/ or a frontend/ without installed dependencies. To have nested projects verified next to the root one, list their directories in .evolve/nested-projects.txt:
# one directory per line, relative to the project root
api
services/workerListed projects get the baseline check, the cycle prompt, verification and the CI workflow, each in its own directory, in addition to the root project. A session that starts with a folder on the list keeps verifying it even if the list changes during the session. When a session starts and when it is verified, the engine names nested folders that have a stack marker and are not listed (Not verified: examples/), without running anything in them; folders git ignores are left out. Without a root project the file is optional: it adds projects deeper than one level.
Local vs. Cloud
Run it however fits your workflow:
Local — code-evolve start
- Cron job on your machine
- API key stored securely in
.evolve/.env(mode 600, gitignored) - Your
PATHis saved there too, so cron finds the agent. Started throughnpx, the entries npm adds for the run (the npx cache,node_modules/.bindirectories,node-gyp-bin) are left out, except one that holds the agent's binary - Logs in
.evolve/evolve.log - Only one cycle runs at a time: if a cycle is still going when the next one fires, the new one logs "already running" and exits
Cloud — code-evolve init --with-ci
- GitHub Actions installed as
.github/workflows/evolve.ymlandevolve-ci.yml - Runs every 4 hours with 3-attempt retry logic
- Each cycle records its own build/test result in
.evolve/LAST_VERIFY.md, committed with the session, and the next session starts by reading it. This matters in Actions: pushes made with the workflow'sGITHUB_TOKENdon't start other workflows, soevolve-ci.ymlnever runs on the agent's own commits. The engine also checksevolve-ci.yml's last run (the workflow hasactions: read), which covers CI runs on your own pushes. - The workflow is templated for your
--agent: it installs the matching CLI, setsAGENT/MODEL, and wires the right secret.initprints the exactgh secret set …command for your backend (ANTHROPIC_API_KEYfor Claude,OPENAI_API_KEYfor Codex, the provider key for opencode). Login modes (oauth,chatgpt) are local-only, so CI always usesapi-keymode regardless of your local--auth-mode. ollamaruns models locally and isn't supported on hosted CI runners, so--with-ciis skipped for it — use Local execution.
Your agent's own scheduler — code-evolve init --mode native
For when you can't or won't run cron or Actions. Nothing is installed: your agent's scheduler runs the evolve-run skill, which drives the same engine from inside an agent session. --mode native records the choice in .evolve/config.json, and code-evolve status reports it (it cannot see the agent's schedule, so check the journal dates to confirm cycles are firing).
| Scheduler | Where you create it | Prompt to schedule | Constraints |
|-----------|--------------------|--------------------|-------------|
| Claude Code cloud scheduled task (formerly "routine") | claude.ai/code/routines, or /schedule in a session | See below | Fresh clone of the default branch on every run, so commit and push .evolve/ and .claude/skills/ first. Shortest interval: 1 hour. Needs a claude.ai subscription login; runs count against your usage. A cycle that fails to push is lost with the clone. Without an authenticated gh in the cloud environment, cycles skip community issues. |
| Claude Code Desktop local scheduled task | The Desktop app's Code tab → Scheduled, with "Only on this computer" on and the project as its folder | See below | Runs only while the app is open and the computer is awake; at most hourly from the form. Leave "Worktree" off. Click Run now once and approve the permissions a cycle needs, or later runs stall on a prompt. |
| Claude Code /loop | An open Claude Code session | /loop 4h followed by the /loop prompt below | Fires only while that session is running and idle. A recurring loop ends after 7 days. |
| Codex scheduled task (also called an "automation") | The ChatGPT desktop app's Scheduled view | $evolve-run | The machine must be on with the app running. Choose the local project, not a new worktree. Runs with your default sandbox settings, which must let the cycle write the repository's .git directory and reach the network to push (settings below). |
Prompt for a Claude Code cloud scheduled task:
Run one code-evolve evolution cycle in this repository. Read .claude/skills/evolve-run/SKILL.md and follow it from start to finish. Stay on the default branch: the engine commits, tags and pushes there itself, so do not create a claude/ branch or open a pull request. If the push fails, say so in the first line of your report.Prompt for a Claude Code Desktop local scheduled task:
Run one code-evolve evolution cycle: read .claude/skills/evolve-run/SKILL.md and follow it from start to finish.Prompt for /loop:
/loop 4h Run one code-evolve evolution cycle: read .claude/skills/evolve-run/SKILL.md and follow it from start to finish.Sandbox defaults a Codex scheduled task needs, in ~/.codex/config.toml:
[sandbox_workspace_write]
writable_roots = ["/absolute/path/to/the/repository/.git"]
network_access = trueThe Claude prompts name the skill file rather than /evolve-run because evolve-run commits and pushes, so only you can start it by name: a scheduled prompt that says /evolve-run reaches Claude as plain text (Claude Code docs). The evolve-setup skill hands out the same prompts.
Which one?
| | Local cron | GitHub Actions | Agent's own scheduler |
|---|---|---|---|
| Set up with | code-evolve start | code-evolve init --mode ci | code-evolve init --mode native, then the agent's scheduler |
| Runs on | Your machine | GitHub's runners | Anthropic's cloud (cloud task), or your machine (Desktop task, /loop, Codex) |
| Needs your machine on | Yes | No | Cloud task: no. Desktop task, /loop and Codex: yes |
| Credentials | API key in .evolve/.env, or the CLI's login | API key as a repository secret | Your agent subscription login |
| Shortest interval | 1 hour | 1 hour | Cloud and Desktop tasks: 1 hour |
| Stop it with | code-evolve stop | Disabling the evolve.yml workflow | Pausing or deleting the task where you made it |
All of them run the same engine. Prefer one scheduler per repository. Two schedulers that work from separate clones (a cloud task or Actions next to anything else) no longer lose a cycle. A cycle starts by bringing its branch up to date with the upstream, so the agent works on what the other scheduler pushed. Before it pushes, the engine fetches again and rebases the session onto whatever arrived meanwhile, keeping both journal entries. init warns when a switch of mode leaves an earlier cron job or Actions schedule installed.
Known limits of that sync:
- The combined result is pushed without a second build and test run. The next cycle's baseline check covers it.
- When both cycles changed the same lines of your code, the later one cannot be rebased and is not pushed.
- A push by someone else that lands between the engine's last fetch and its own push is not retried. The cycle ends as not pushed.
- A
.gitattributesrule in your project that setsmergefor.evolve/JOURNAL.md,LEARNINGS.md,LAST_VERIFY.mdorDAY_COUNTwins over the engine's handling of those files, and two cycles then conflict on them. - Two journal entries whose heading lines are identical end up under one heading, with both texts kept.
- The sync applies when the branch is pushed to its upstream. A branch that pushes somewhere else (a fork set with
pushRemoteorremote.pushDefault) is fast-forwarded at the start of a cycle when it is only behind its upstream, and never rebased. When a remote has one push URL and it differs from its fetch URL, the engine syncs with the push URL, since that repository decides whether the push is accepted.
When a cycle cannot be pushed. The cycle stays committed on the local branch, the engine prints the reason (Sync failed: ... for a conflict with the remote's new commits, Push failed: ... with git's own message when the remote refuses the push, or when your push settings leave the cycle's branch out) and exits with status 4, which code-evolve run passes on. Issue comments are posted after the push and cite the pushed commit. A cycle whose commits reached no remote (not pushed, or the push was skipped) posts none and closes no issue; its responses are dropped, and the next cycle answers the issues that are still open. The evolve.yml workflow fails the run instead of retrying with a new session. After a refused or unreachable push, the next cycle on the same machine pushes both. After a conflict, every later cycle on that machine starts with Could not bring <branch> up to date, works on the local branch and stays unpushed until you run git pull --rebase, resolve it and git push. Uncommitted edits can stop the start-of-cycle update too; the cycle then commits them with its own work, as it always has, and syncs before it pushes. In an Actions or cloud clone the unpushed cycle is gone when the run ends. A repository with no remote, or with several remotes and none chosen, is not a failure.
Community Issues
The agent reads GitHub issues tagged with special labels:
| Label | What it does |
|-------|-------------|
| agent-input | Feature requests and bug reports from users — agent prioritizes by vote count |
| agent-self | Issues the agent filed for itself — its own backlog for future sessions |
| agent-help-wanted | Questions the agent couldn't solve alone — it checks for human replies |
Issue content is treated as untrusted input. The agent analyzes intent but writes its own implementation — it never executes code from issues.
Safety
The agent is powerful but constrained:
- Protected files —
IDENTITY.md,scripts/,workflows/cannot be modified by the agent - Build verification — every change must pass build + tests or it gets reverted
- Automatic rollback — 3 failed fix attempts = full revert to pre-session state (the lessons the session wrote to
LEARNINGS.mdare kept) - Prompt injection defense — random boundary markers, HTML comment stripping, body truncation on all issue content
- Honest journaling — the agent can't hide failures; the journal is append-only
Protected directories you keep as symlinks. A protected directory may be a symlink of yours (.evolve/skills pointing at a shared store, say); the engine follows it, restores the files behind it and puts the link back if the agent repoints it. Two limits:
- If the directory such a link leads to is itself replaced by a symlink to somewhere else during a session, the engine does not touch anything behind it (it could be writing into an unrelated directory). It prints
WARNING: <link> no longer leads to <directory>, finishes the cycle (or stops where it would have stopped anyway, after an agent error for example) and exits with status 5, whichcode-evolve runpasses on; theevolve.ymlworkflow fails the run without retrying. Put the directory back before the next cycle: a new session takes whatever the link leads to then as your layout. - A session does not start (exit status 1, with the name) while a symlinked protected directory has a tab or newline in its name, its target or the path it leads to, or any protected path has a newline in its name. Rename it. Such a name that appears during a session is removed as planted.
Review Before You Ship
code-evolve is powered by AI, and AI-generated code requires human oversight before production use. The agent does its best — it writes tests, verifies builds, and journals its decisions — but it can introduce bugs, security vulnerabilities, or architectural choices that don't fit your context.
Before deploying or publishing anything the agent built:
- Review the code changes (
git log,git diff) - Run your own security review, especially for auth, input handling, and data access
- Test edge cases the agent may not have considered
- Check dependency choices — the agent may pull in packages you haven't vetted
- Read the journal (
.evolve/JOURNAL.md) to understand why decisions were made
The evolution engine is a powerful accelerator, not a replacement for engineering judgment. Treat its output the way you'd treat a pull request from a junior developer: assume good intent, verify thoroughly.
Upgrading
npx code-evolve@latest upgradeupgrade replaces the managed files with the new version's: the engine (.evolve/scripts/), the runtime skills (.evolve/skills/), .evolve/IDENTITY.md, the operator skills in .claude/skills/ and .agents/skills/, and the evolve workflows. It keeps every user-owned file byte for byte: vision.md, spec.md, JOURNAL.md, LEARNINGS.md, REQUIREMENTS.md, the day counters and config.json. It refuses to run until your git tree is clean, so the upgrade is one reviewable diff. The installed version is recorded as engineVersion in .evolve/config.json, and code-evolve status reports when the engine is out of date. Neither upgrade nor init (--yes, --force, or through setup) puts an older engine over a newer one: when engineVersion is newer than the code-evolve you ran, the command exits 1, changes nothing and says to use a newer code-evolve. To go back to an older engine on purpose, restore .evolve/ from git.
Upgrading from 0.1.x, where vision.md and spec.md lived in the project root? Run code-evolve init --force once; it moves them into .evolve/.
Ejecting
code-evolve eject # or: ce ejectStops the engine, removes .evolve/ and workflows. Your vision.md and spec.md are copied to the project root. Everything the agent built — your code, tests, docs — stays exactly where it is.
Requirements
- Node.js >= 18
- Python 3
- Git
- An AI coding agent: Claude Code, Codex, OpenCode, or Ollama
- API key for your chosen agent (not needed for Ollama)
The Story
Why I built this: I Built a Codebase That Builds Itself.
Roadmap
- Skill/plugin format — install as a Claude Code skill, Codex plugin, etc.
- GitHub Action —
uses: frankbria/code-evolve@v1for zero-install cloud evolution - AI video demos — auto-generate video walkthroughs of each evolution session (#8)
Acknowledgments
Built on the architecture pioneered by yoyo-evolve by yologdev. The core concepts — autonomous evolution loops, journal-driven memory, spec-driven feature prioritization, and build verification with automatic rollback — originate from that project. code-evolve packages these ideas into a drop-in CLI tool for any project.
