Nanocode – a hackable coding agent in one Python file A developer released nanocode v0.3.0, a hackable terminal coding agent contained in a single Python file, distributed via a curl or PowerShell install script that places the app, a private Python environment, config, memory and skills in ~/.nanocode. Nanocode runs on a Claude subscription through the Claude Agent SDK, any OpenRouter model, or local models via Ollama, and ships tools to read, edit and run code, plan and hand work to sub-agents, search the web through the user's own browser, use any MCP server, compare models side by side, and handle email. The project was inspired by 1rgs/nanocode, a minimal Claude Code alternative in roughly 250 lines, and has grown from it into a full agent that checks GitHub daily for updates and installs a private Python 3.12 via uv when Python 3.10 or newer is absent. A small, hackable coding agent for your terminal, in one Python file you can read and edit end to end. Website: car-mrazomor.github.io/nanocode-agent https://car-mrazomor.github.io/nanocode-agent/ It runs on: - your Claude subscription , through the Claude Agent SDK - any OpenRouter model : Claude, GLM, GPT, Gemini, DeepSeek, Kimi, or OpenRouter's auto router - local models through Ollama : free, private and offline With tools to read, edit and run code, plan and hand work to sub-agents, search the web through your own browser, use any MCP server, compare models side by side, and handle your email. Inspired by 1rgs/nanocode https://github.com/1rgs/nanocode , a minimal Claude Code alternative in ~250 lines. This project started from it and grew into a full agent. █▀▀▄ ▄▀▀▄ █▀▀▄ ▄▀▀▄ ▄▀▀▀ ▄▀▀▄ █▀▀▄ █▀▀▀ nanocode v0.3.0 █ █ █▀▀█ █ █ █ █ █ █ █ █ █ █▀▀ Opus 5.5 · Claude subscription ▀ ▀ ▀ ▀ ▀ ▀ ▀▀ ▀▀▀ ▀▀ ▀▀▀ ▀▀▀▀ ~/my-project Welcome back, Ivan · 2 memory files · 3 skills / commands · @ attach file · remember · /resume · /help macOS, Linux, WSL, Android Termux : curl -fsSL https://raw.githubusercontent.com/car-mrazomor/nanocode-agent/master/install.sh | sh Windows PowerShell : irm https://raw.githubusercontent.com/car-mrazomor/nanocode-agent/master/install.ps1 | iex Everything goes into ~/.nanocode : the app, a private Python environment, your config, memory and skills. Nothing else on your system is touched except one PATH line. Python: if you already have Python 3.10 or newer, the installer uses it. If you don't, it downloads a private Python 3.12 into ~/.nanocode/python using uv https://github.com/astral-sh/uv . That needs no admin rights and doesn't touch your system. On Android Termux it runs pkg install python instead. nanocode update latest nanocode and REA nanocode version your version, and whether there's a newer one nanocode uninstall remove the app, keep config, memory and skills nanocode uninstall --purge remove everything Updates: nanocode checks GitHub for a newer version once a day, in the background. When there is one, the start screen says /update to install v0.5.1 like OpenCode . Click it or type /update to choose Update installs in the background while you keep working or Skip no more reminders for that version . Once it's installed, /exit restarts nanocode on the new version. On Windows, Update closes nanocode first, installs, then you start it again. Outside the app, nanocode update does the same, and /version checks right away. To turn the check off, set "update check": false in ~/.nanocode/config.json or NANOCODE NO UPDATE CHECK=1 . cd your-project nanocode The first start runs a short setup: 1. Pick a provider. - Claude subscription uses your Max or Pro plan. Log in once with Claude Code https://claude.com/claude-code claude , then /login . - OpenRouter works with any cloud model and charges per token. Paste a key from openrouter.ai/keys https://openrouter.ai/keys . The default model is openrouter/auto-code . - Ollama runs local models. Install Ollama https://ollama.com/download and pull a model with tool support, such as ollama pull qwen3 . 2. Pick a model. 3. Choose whether nanocode asks before it edits files or runs commands. Your choices are saved in ~/.nanocode/config.json . To switch provider while nanocode is running, use /provider ollama or openrouter , claude . To change keys and defaults, run nanocode setup . To check that everything works, run nanocode doctor . Thinking is on by default medium . It's sent the way each provider expects: reasoning for OpenRouter, think for Ollama, and adaptive thinking with an effort level for Claude. Models that can't think or can't stop are sent the request without it. Type what you want done. nanocode reads, searches, edits, runs commands and tests, and shows diffs before it changes anything. After every response, a dim line shows how long it took, the tokens used and what it cost: ✻ Cooked for 11s · 12.3k in · 340 out · $0.0123 · done 19:06 The cost is OpenRouter's real price, or "free local " with Ollama. With your Claude subscription it's what the same usage would cost on the API, which your plan covers. | Command | What it does | |---|---| | /provider name | List providers, or switch Claude subscription, OpenRouter, Ollama | | /think level | How hard the model thinks: off , low , medium default or high . Shown under the prompt after the model, like OpenCode · medium ; click it to change | | /model name | List models with prices, or what's installed in Ollama , or switch. Tab completes | | /resume n | Continue a saved chat. Every chat is saved per project | | /recap | What happened this session files changed, commands run, cost and what's next | | /compact | Summarize a long chat to free up context | | /undo | Revert the last file change | | /learn | Review this chat and save lessons and skills for next time | | /memory , /skills | Show what nanocode knows | | /shells | Background shells: list them, or /shells stop