Harness Architecture
Designing the harness around the model, from the agent loop to a remote swarm.
decode
Free open-source course
The harness, not the model, makes a coding agent good.
Build one from scratch, from a bare-bones agent loop to a swarm of cloud agents.
By Decoding AI, in collaboration with Modal, Opik (by Comet), and Kitaru (by ZenML).
Then type /demo- and pick a demo — see what they do below. Full setup guide.
In LangChain's Terminal-Bench test, changing only the harness moved an agent from ~30th to top 5. The harness, not the model, wins.
That's the entire tool-calling agent. Everything else in this repo is the harness: tools, skills, permissions, sandbox, steering, memory, compaction, durable runtime, subagents, evals.
That's what you're here to build.
We spent months inside Claude Code (via its leaked source), OpenCode, Pi, and Aider, then distilled it into 8 articles and 4 videos where you'll build decode, your own coding agent, from scratch: one headless core, two modes, N agents in parallel.
From designing the harness to deploying a swarm of remote agents.
kill -9 a headless run, resume it from checkpoints, then deploy to GCP + Modal and run the same feature 5–10× in parallel.
Benchmarks, regression probes, and online evals: does it work, still work, keep working?
evals.mdReplay a recorded run with the model or a checkpoint swapped, then diff the two executions.
The articles and videos cover what the code can't. The why behind every decision.
Why a headless harness with two interface modes, TUI and Remote.
What the essential components of a coding agent are, and what is optional.
Why we plugged in 9 tools, no more, no less.
Why we need a durable runtime and replays.
What guardrails are actually useful.
Why compaction fires at ~80% of the window instead of at the limit.
Why you need benchmarks, regression tests and online evals.
Demo skills live under .decode/skills/. Type /demo- in the TUI, pick one, and watch the harness do real work.
The code is written in Python, with the following frameworks and libraries:
Otherwise, we build everything from scratch, to teach foundations that last, not frameworks that hide the hard parts.
You finish with a working coding agent that teaches you harness engineering patterns to steal for your own agentic applications.
If you stick to free tiers. Reading only? Everything's free, full stop.
One Python package; each module maps to one part of the architecture.
Self-paced, based on this repository plus the lessons that walk you through the code. No paywall. No platform.
Read the lessons on the Decoding AI Magazine, watch the videos on the Decoding AI Channel, run the code on your own machine, break it, fix it, and learn from the process.
Everything lives under running_the_code/. One core guide, plus one focused guide per side quest.
Questions or setup trouble: open a GitHub issue. Found a bug and know the fix? Fork, fix, run make ci (no API key needed), and open a pull request.
Special thanks to Modal, Opik (by Comet), and Kitaru (by ZenML) for sponsoring this open-source course and keeping it free.
Opik and Kitaru are open source. Consider starring their repositories: Opik on GitHub · Kitaru on GitHub.
No. The default Gemini provider has a free tier, OpenRouter routes across :free models, and Modal gives $30 in credits — see Cost Structure.
Accessibility: our audience knows Python. The course focuses on the design decisions, which transfer to any language.
Because adding custom logic to an existing harness is the easy part. Knowing what to add requires understanding the internals. That's the fundamentals, and it's what still makes AI engineers valuable. Build a coding agent once, and you're equipped to build a custom agent for any use case.
If you found this course useful, consider starring the repository so others can find it too.