The anatomy of a harness
You build — a bare harness: a model client, a message array, and a hand-rolled loop that runs until the model stops asking for work.
Build the layer that turns a model into an agent. A language model only takes text in and puts text out — everything that makes it act (edit files, run commands, remember, recover) lives in the harness. This is a five-module, hands-on course that builds that layer from a bare loop to a production-grade harness: the anatomy, tools & the execution environment, context engineering, durability & orchestration, and the internals of real harnesses (pi, Hermes, Claude Code) — with a capstone where you assemble your own pi-style harness. Every module ends with something you build.
Why "just call the API" fails — transactional inference vs a real agent. Dissecting Claude Code, pi, and Hermes layer by layer. Prompt vs context vs harness engineering — precise boundaries. The agent loop from first principles: messages, turns, stop conditions, streaming.
Tool schemas as contracts: read, write, edit, bash, search. Streaming tool calls into a terminal UI. Permission gates and approval modes — why Claude Code asks before rm. Sandboxing and the blast-radius problem; code-mode vs tool-mode.
Context budgets: what goes in every turn, what gets evicted. Compaction and summarization — surviving long sessions without losing the plot. Memory systems: session state, persistent memory files, the CLAUDE.md pattern. System prompts as infrastructure, not prose.
Durable execution: checkpointing every model turn and tool call, replay on restart. Self-healing loops: retries, failure classification, resumable sessions. Sub-agents and handoffs — when one context can't hold the job. Supervision and human-in-the-loop: plans, approvals, escalation.
pi internals: extensions, models.json, the minimal-surface philosophy. Hermes internals: a research lab's harness design choices. Claude Code internals: skills, hooks, MCP, sub-agent types. Evaluating a harness — how you know yours actually works.