Experiment
How a harness works
An interactive walk from a next-token predictor to a coding harness that runs many agents.
Finished
I wanted to understand what a coding harness actually adds to a model, so I had Claude build a guided explainer around pi, an open-source harness whose code I could read end to end.
It climbs eight layers, from the model predicting a token to a parent agent delegating to parallel subagents. Along the way there are small interactive figures: sampling a tool call token by token, stepping through the agent loop, a reliability model that shows why feedback from tests matters, context growth and compaction, and a scheduler for subagent work.
It also includes a rough map from pi to Claude Code and a reading order for the source. The page cites pi at a specific commit, so some details may have moved since.
The figures are drawn with JavaScript; without it the explanatory text still reads, but the diagrams are blank.