Live Demo · How It Works · Guide
nanocode agents in Cloudflare Durable Objects: one object per session, with the agent's journal in the object's own SQLite. A template and the source of nanocode.xyz/cloudflare.
- Durable. Every model call and tool call is journaled. An object that resets mid-turn is started again by its alarm and continues from the last checkpoint.
- No sandbox. Code Mode cells run beside the agent in the object: bash on a workspace kept in the same SQLite, git, Python (nanocode-ts's python.wasm, in the same object) and WebAssembly.
- One module. The runtime is nanocode-ts, the Rust SDK compiled to WebAssembly. This repository holds the Worker, its tools and the page.
npm install
npm run dev # wrangler dev, at http://localhost:8787
npm run drill # Crash a turn midway and check that it resumes
npm run deploy # Deploy the WorkerModel requests go through the account's AI Gateway (AI_GATEWAY_ID in wrangler.jsonc). DECISIONS.md records what each change established, with its measurements.