Build a Coding Agent
Learn the core foundations of AI coding assistants from scratch: model basics, API key security, why use OpenRouter as a universal model router, tool schemas, and the autonomous ReAct loop.
Python · TypeScript
Read stdin, filter by pattern and honour exit codes. The gateway to Unix tooling.
Build it in your language
The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.
grep is the perfect Unix tool: it does one thing, it does it fast, and it composes with everything else. Rebuilding it teaches as much about design philosophy as it does about code.
You'll build a clone that searches by pattern in stdin and in files, with the flags you actually use (-i, -v, -n, -c, -r), and with correct behaviour in the part nobody looks at but everybody depends on: exit codes.
7 stages across 3 phases. Every stage comes with its guide and its tests: you move on when they pass.
Read stdin, search for a literal string and print the matches.
-i, -v, -n, -c, several files at once, and correct exit codes.
Character classes, anchors and recursive directory search.
Learn the core foundations of AI coding assistants from scratch: model basics, API key security, why use OpenRouter as a universal model router, tool schemas, and the autonomous ReAct loop.
Python · TypeScript
Blobs, trees and commits. Discover that Git is a content-addressed object store, and little else.
Go · Python · Rust