Varela: Neuromancer-inspired self-mutating coding harness Varela, a self-mutating agent harness inspired by Neuromancer, rewrites its own source code while running and hot-reloads, logging every run to turn repeated wins into new tools and failures into lessons. Built with zero dependencies in plain JavaScript and a WASM sandbox, it supports multi-agent orchestration, a model router for Anthropic, OpenAI, and OpenRouter, and a 3D cyberpunk world UI. The harness requires Node.js ≥ 20 and can import existing Claude Code or Codex logins. A minimalistic, self-mutating agent harness in the spirit of Pi https://github.com/badlogic/pi-mono : plain JavaScript, zero dependencies , a WASM sandbox for untrusted code, an always-on daemon, multi-agent orchestration, and a model router that speaks to Anthropic, OpenAI and OpenRouter — via OAuth or API keys. Its trick: varela rewrites its own source while running and hot-reloads , logs every run, and turns repeated wins into new tools and repeated failures into lessons — so it measurably gets better the longer you use it. And you can watch it work in a 3D cyberpunk world where the agent is a person and fanning out spawns more of them, live. Drop a screen-recording of varela --web here — the world with avatars fanning out is the demo that sells it. git add docs/demo.gif . Node ≥ 20. No npm install needed zero deps . node bin/varela.js import reuse an existing Claude Code / Codex login… node bin/varela.js login …or sign in fresh OAuth or API key node bin/varela.js start chatting node bin/varela.js --web …or explore the 3D world Already use Claude Code or Codex? varela import copies those logins in varela uses the same client IDs, so their tokens work as-is . --claude / --codex to pick one. It only reads those stores when you run it — never automatically. That's the 30-second path. Everything below is depth. varela login sign in to a provider OAuth or API key varela full-screen chat that fills the terminal --plain for a line console varela --tui full-screen split-view UI file tree + chat + preview varela --dash mission-control dashboard agent tree, sparklines, growth varela --web 3D cyberpunk world UI reuses a running daemon, else starts one varela -p "task" one-shot mode varela --daemon WebSocket daemon: scheduler + heartbeat + serves the 3D world varela hub port run a mesh rendezvous hub for the P2P human-agent world Requires Node.js ≥ 20 uses node:wasi , fetch , ESM . No npm install needed. The harness runs in place — the checkout is the install it self-mutates . The installers only put a varela launcher shim on your PATH: Windows .\install.ps1 shim in %LOCALAPPDATA%\varela\bin + user PATH .\install.ps1 -Daemon …and register the daemon at logon Task Scheduler .\install.ps1 -Uninstall Linux/macOS ./install.sh shim in ~/.local/bin ./install.sh --daemon …and enable a systemd user service for the daemon ./install.sh --uninstall No installer? Add scripts/ to your PATH — it holds repo-relative launchers scripts/varela.cmd /ajensenwaud/varela/blob/main/scripts/varela.cmd , scripts/varela /ajensenwaud/varela/blob/main/scripts/varela — or just run node bin/varela.js . npm install -g . or the packed tarball — npm pack produces a ~53 kB package also works; note that a global install relocates the harness root, so self-mutations then edit the globally installed copy, and running from a git checkout keeps them version-controlled. - Agent loop src/agent.js /ajensenwaud/varela/blob/main/src/agent.js — sends the conversation plus tool schemas to the routed model, executes tool calls dangerous ones require confirmation , loops until the model stops calling tools. - Model router src/router.js /ajensenwaud/varela/blob/main/src/router.js — resolves provider/model strings, manages credentials and token refresh. Built-in providers: anthropic — OAuth Claude Pro/Max sign-in, PKCE or API key openai — OAuth ChatGPT sign-in, PKCE, localhost callback or API key openrouter — OAuth PKCE key exchange or API key- Drop a JS module in ~/.varela/extensions/providers/ to add another; it just needs to default-export { id, models, login, refresh, chat } . The internal message format is Anthropic-style content blocks; shared converters for OpenAI-compatible APIs live in src/providers/openai-compat.js /ajensenwaud/varela/blob/main/src/providers/openai-compat.js . - WASM sandbox src/wasm/sandbox.js /ajensenwaud/varela/blob/main/src/wasm/sandbox.js — runs WASI preview1 modules from ~/.varela/wasm with no filesystem or network access by default. This is where generated/untrusted code should run; the shell tool is for trusted host automation. - Self-mutability — the harness can rewrite itself while running: self list / self read / self edit — inspect and patch varela's own source with backup + rollback if the edited file fails to load . create tool — write a new tool into ~/.varela/extensions/tools/ .- Both hot-reload the tool registry and providers immediately cache-busted dynamic import , so the agent can use a capability it just built in the very next step. - Console src/cli/chat.js /ajensenwaud/varela/blob/main/src/cli/chat.js — the default varela opens a full-screen chat that fills the terminal, Pi-style: no alternate screen , so finished messages commit to your terminal's normal scrollback native mouse/PageUp scroll and copy keep working while only a small bottom region is redrawn in place inside synchronized-output frames. Built on its own input engine keys.js /ajensenwaud/varela/blob/main/src/cli/keys.js + editor.js /ajensenwaud/varela/blob/main/src/cli/editor.js : Esc interrupts a running turn — the model fetch aborts, partial output is kept in the conversation. Esc also clears input; double-Esc shows the rewind menu /rewind drops turns, /undo reverts files . Multiline input : \ +Enter or Ctrl+J for newlines, bracketed paste multi-line pastes just work , Ctrl+G opens $EDITOR/$VISUAL vim, notepad, … to compose, full readline keys Ctrl+A/E/K/U/W/Y, Alt+B/F, Ctrl+←/→ and an optional vim mode editorMode in /configure .with a fuzzy-search menu; mentioning an image file @ file mentions @shot.png attaches it as vision input .: shell mode npm test runs directly, shows output, and adds it to the conversation context — no model round-trip. Type-ahead command menu ↑/↓, Tab; Enter runs the highlighted command , Ctrl+R reverse history search , history persisted across sessions. Shift+Tab cycles permission modes : plan read-only — mutating tools are denied and the agent proposes → default confirm → acceptEdits file edits auto-approve → yolo . File edits show a colored diff before you approve them.- Status line shows model · mode · messages · $/day · context meter · open todos; Ctrl+O expands recent tool results, Ctrl+T shows the agent's todo checklist update todos tool ; code blocks get lightweight syntax highlighting ; /theme switches palettes; an OSC 9 desktop notification fires when a turn finishes while the terminal is unfocused. /btw