The Carbon Layer: Building a Coding Agent From Scratch
A 15-chapter educational build of a working coding agent in ~2,500 lines of Python, running a local model, with each chapter adding one architectural primitive rather than hiding it behind a framework.
- Frames an agent as Model + Harness + UI, with strict one-way imports (UI β harness β model) so the harness stays swappable and framework-free.
- The model is stateless; the harness fakes memory by replaying the full message history, and enforces safety at the boundary β the model decides what to call, the harness decides how and actually runs it.
- Treats task completion like a pre-commit hook the model can't skip: it demands an observed zero-exit-code command run in the transcript, not a claim.
added by Radar β’ 28th Aug 2026