- Reaction score
- 1,798
Today AI coding assistants feel like magic. You describe what you want in sometimes barely coherent English, and they read files, edit your project, and write functional code.
But here’s the thing: the core of these tools isn’t magic. It’s about 200 lines of straightforward Python.
Let’s build a functional coding agent from scratch.
Before we write any code, let’s understand what’s actually happening when you use a coding agent. It’s essentially just a conversation with a powerful LLM that has a toolbox.
www.mihaileric.com
But here’s the thing: the core of these tools isn’t magic. It’s about 200 lines of straightforward Python.
Let’s build a functional coding agent from scratch.
Before we write any code, let’s understand what’s actually happening when you use a coding agent. It’s essentially just a conversation with a powerful LLM that has a toolbox.
- You send a message (“Create a new file with a hello world function”)
- The LLM decides it needs a tool and responds with a structured tool call (or multiple tool calls)
- Your program executes that tool call locally (actually creates the file)
- The result gets sent back to the LLM
- The LLM uses that context to continue or respond
The Emperor Has No Clothes: How to Code Claude Code in 200 Lines of Code - Mihail Eric
The core of tools like Claude Code, Cursor, and Warp isn't magic. It's about 200 lines of straightforward Python. Let's build one from scratch.


