What an agent harness is
Why this matters
A model on its own only turns text into text. Everything that makes it an agent, the loop, the tools, the permissions, the memory, is software around it called a harness. Two products using the same model can differ enormously because of their harnesses. Claude Code is a model plus a very good harness. This phase teaches you to build one: to customize agents, debug them, and judge the ones you're offered.
- Tell the model apart from the harness, and list what a harness is responsible for
- Recognize the three meanings of "harness": agent, test and evaluation harnesses
- Choose between a hand-built loop, the SDK's tool runner, the Claude Agent SDK and managed agents
- Build a minimal harness with a scripted model, pluggable tools and an event log
Engine and car
Think of the model as an engine. It's the source of power, but an engine on a workbench goes nowhere. The harness is the rest of the car: wheels, brakes, fuel system, dashboard. A great engine in a bad car is a bad car.
A model call does exactly one thing: it reads a request (system prompt, messages, tool definitions) and returns a response (text, maybe tool_use blocks, and a stop_reason). Everything else is the harness:
| harness part | its job | lessons |
|---|---|---|
| the loop | call the model, run its tools, feed results back, know when to stop | core loop |
| tools | the actions on offer, their schemas and how they run | registry, files, execution |
| permissions | which actions need a person's approval | permissions |
| hooks and skills | let users and plugins change behavior; load know-how on demand | hooks and skills |
| context management | keep the conversation inside the window and cheap | context |
| memory and planning | carry work across long tasks and new sessions | memory and plans |
| subagents | hand off focused sub-tasks to fresh contexts | subagents |
| sessions and UI | stream output, allow interrupts, save and resume | sessions |
| observability and limits | logs, traces, costs, loop detection | production |
In plain words: the model only ever writes a reply. The harness is everything that acts on that reply.
You built the smallest possible harness in Phase 1's agent loop lesson, and a host in Phase 9. This phase builds the full set.