nanocode-ts - a minimalistic coding agent implementation in TypeScript.
This repo is for my learning purposes. If you'd like to learn how coding agents work, the best way is to use a coding agent like Claude Code and ask it to build a minimalistic implementation step by step. You can use a prompt like this:
I'd like to understand how coding agents like Claude Code and Codex work. Please, create a plan on how to build a minimalistic coding agent step by step, so I can follow the plan.
- For each step, mention what I will learn and how I can play with it to understand it better.
- Make sure that code generated by the plan is straightforward and easy to understand.
- Each step should bring me closer to the final result. Don't introduce tools or features that won't stay in the final version.
- Please use TypeScript as I'm familiar with this language.
- Use OpenRouter as LLM provider.
- Don't introduce third-party libraries, only built-in node.js packages.
- Tools:
read,write,edit,glob,grepandbash - Colored terminal output
- LLM call stats: execution time, token usage, cost per call
- Safety:
- Confirm execution of
bashcommands - Avoid infinite agentic loop
- Confirm execution of
cp .env.example .env
# Set `OPENROUTER_API_KEY` inside `.env`
npm i
npm start/new- Clear conversation/exit- Quit
- nanocode - Python implementation of a minimal coding agent in ~250 lines of code from Rahul.
- Deep Dive into LLMs like ChatGPT - the best video explaining how LLMs work by Andrej Karpathy - a must-watch.
MIT
