Modern coding agents are mostly harness, not model. This repo walks you through every layer of that harness — provider wrappers, context budgets, memory, tools, MCP, subagents — as a sequence of small lessons with runnable code. Read the markdown. Edit the source. Watch the loop turn.
Swap the model in any popular coding agent and most of its character stays the same. The personality, the failure modes, the way it recovers — those live in the harness: the loop, the prompts, the tool surface, the budget rules. Harness engineering is the discipline of designing that scaffolding deliberately, instead of copying it from a tutorial.
A working coding agent in Go — streaming, tool use, file edits, an MCP client, subagents, prompt caching, and a real TUI by the end.
A production system. The point is to see every wire. We trade robustness for legibility — every file is meant to be read end-to-end.
This is the system you'll build, piece by piece. Hover any node to focus it — every box maps to a lesson, a file, and a few hundred lines of code.
Each lesson is a markdown file in /follow_along that walks through one part of the harness already living in the repo. The code is the final version — the lessons explain how each piece was built and why. Read in order for the full tour, or jump to whichever chapter you need.
Once you've read the lessons and want to add your own piece, these guides give you the step-by-step — what file to create, which interface to implement, what changes in main.go. Each assumes you already know the why; this is just the how.
read_file, ask once per shell command, deny writes outside the working directory.git diff.Each exercise is a self-contained task that builds on an existing extension point — Provider, Tool, Compaction, Memory, Subagent. There's no canonical solution; the value is in the trade-offs you make along the way.
memory.Store and prove the existing harness doesn't know the difference.RenderTranscript function into a Renderer interface with multiple implementations, and add an /export command.# 1. clone the repo git clone https://github.com/betta-tech/byo-coding-agent && cd byo-coding-agent # 2. set a provider key (any will do) export ANTHROPIC_API_KEY="sk-ant-..." # 3. run the harness go run .
New to harness engineering? Start with §00 — what and why, then open 00-introduction and work forward.