Workshop: Build Your Own CLI Coding Agent from Scratch
Last month, on Feb 18th, around 50 people joined my Workshop: Build Your Own CLI Coding Agent from Scratch.
We iteratively implemented the core agent loop present in all coding agents like Claude Code and Codex. We started with a skeleton repo with a basic input loop and no LLM. Over multiple phases, we added the Anthropic API, implemented tools (read file, edit file), and tested the coding agent on its own codebase after each phase.
The biggest “aha” moment was Phase 4, where the agent loop closes and the LLM starts chaining tool calls autonomously. People went from “I’m building a chatbot” to “oh, this is an agent”. See the demo in the attached gif.
I’ve converted this workshop into a self-paced exercise. So if you want to get a better understanding of what goes on inside the coding agents, give this a try.
Follow the instructions in this GitHub repository to get started: https://github.com/primaprashant/alduin
You should be able to finish it in ~3-5 hours. You will create your own coding agent which you can use on other project and codebases as well. You will implement the following 7 phases:
- LLM in the loop: replace the canned response with an actual LLM call
- Read file tool: implement the tool + pass its schema to the LLM + detect tool use in the response
- Tool execution: execute the tool the LLM requested and display the result
- Agent loop: the inner loop where tool results go back to the LLM until no more tool calls
- Edit file tool: create and edit files
- Bash tool: execute shell commands with user confirmation
- Memory: use the agent to build the agent, add AGENTS .md support for persistent memory across sessions
Each phase has hints and a reference implementation if you get stuck.
Demo of the CLI coding agent we built in the workshop: