Build your own coding agent
An eight-step workshop that builds a working code-editing agent from a bare API call, because the magic is an illusion.
Built for a live talk at the Ballarat Hackerspace BRAIN meetup (July 2026). The whole trick behind tools like Claude Code is an LLM, a loop, and a few hundred lines anyone can read, and I found that most developers using these tools every day have never seen the loop. So I built it as eight runnable steps, each adding exactly one idea, starting from a single API call and ending with an agent that edits real files on disk. The diff between neighbouring steps is the lesson: run a diff between step three and step four and the entire concept of tool calling fits on one screen.
One idea per step
It starts with a single API call ("it's autocomplete, nothing more"), adds a loop and a list ("memory is an array we resend"), then tool calling, first with no code at all, just an agreed text format where you play the harness by hand and paste file contents back to the model yourself. Doing the harness's job manually for five minutes teaches more about how agents work than a semester of diagrams. By step five it edits real files, and the finale has it decode a ROT13 message it wrote itself, using tools it was only just given.
See the wires
Every step has a /verbose mode that prints the exact strings crossing the wire: the full request, the raw response, the tool call as it arrives. The code the model writes shows up as a JSON argument before the file exists anywhere. Once you've watched the payloads, the mysticism dies on its own. There is no inner world in there, just text going out and text coming back, and a small program deciding what to do with it.
Same loop, any brain
The last step turns the model into three environment variables: base URL, model name, API key. The identical file runs against Claude, DeepSeek, GLM, models on Groq at a thousand tokens a second, and a local Qwen on my own laptop via Ollama with no network at all. That's the real takeaway of the whole workshop. The harness is yours, it's a few hundred lines, and the brain is a plug you can swap while the loop keeps running.
Why teach it this way
Because dependency-free code is honest. The repo uses the provider SDK and nothing else: no agent framework, no orchestration library, no abstractions to take on faith. Every capability that shows up in step eight is traceable to a line someone in the room watched get written. When a tool inevitably misbehaves at 11pm, the people who built this loop once know where to look, and the people who only ever installed frameworks don't.