The Agent Harness
A 12-part engineering guide to building autonomous AI agent infrastructure — Claude Code is our case study, your agent is the goal.
All Parts
What Is an Agent Harness? Why Your LLM Needs More Than an API Call (Part 1)
Most LLM apps fail because there's nothing holding the model together. Here's the architecture that makes autonomous agents work — the Agent Harness.
The Dialog Loop: The Heartbeat of Every Autonomous Agent (Part 2)
Every autonomous agent runs on a loop. Here's what that loop needs to do — and what Claude Code's implementation reveals about building one for production.
The Tool System: How Agents Act on the World (Part 3)
Without tools, an LLM can only produce text. The tool system engineering that turns Claude Code from a chatbot into an agent that acts safely and concurrently.
The Permission Pipeline: Safety That Doesn't Get in the Way (Part 4)
Autonomous agents need guardrails without constant interruption. Claude Code's permission pipeline: safety that scales with risk — not a blunt on/off switch.
Configuration as Architecture: The Multi-Layer Settings Problem (Part 5)
Agent harnesses need a config architecture, not a flat file. How Claude Code layers settings across six stakeholder types — users, projects, enterprises.
The Memory System: How Agents Remember Across Sessions (Part 6)
Every session starts fresh unless you build a memory system. How to store what matters, skip noise, and extract memories without blocking the main loop.
Context Management: The Compression Problem (Part 7)
Every long-running agent eventually hits the context window ceiling. The four-level compression architecture that keeps agents running, not crashing.
The Hook System: Extension Points That Don't Break the Core (Part 8)
Customize agent behavior without forking the core: 26 lifecycle events, 5 hook types, and a security model that keeps extension from becoming an attack surface.
Sub-Agents, Coordinators, and Skills: Multi-Agent Orchestration (Part 9)
Single agents hit ceilings. Multi-agent systems hit coordination instead — the Fork pattern, the Coordinator pattern, and skills + MCP as the extension layer.
Streaming Architecture: Building Agents That Feel Fast (Part 10)
An agent taking 10 seconds feels broken even when correct. Streaming isn't just UX — it's an architectural choice. How to build agents that feel fast.
Plan Mode: The Architecture of Thinking Before Acting (Part 11)
The most expensive agent mistakes happen in the first few turns. Plan Mode is the architectural pattern that prevents premature action.
Build Your Own Agent Harness: The Practical Blueprint (Part 12)
One post of synthesis after eleven of principles: three questions builders should answer, twelve design lessons, and the practical kit to start.