SherlockLiu Logo SherlockLiu
The Agent Harness
Engineering · Architecture

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.

Series progress
12 / 12 parts
Start Reading

All Parts

1

What Is an Agent Harness? Why Your LLM Needs More Than an API Call (Part 1)

Apr 03, 2026 14 min

Most LLM apps fail because there's nothing holding the model together. Here's the architecture that makes autonomous agents work — the Agent Harness.

2

The Dialog Loop: The Heartbeat of Every Autonomous Agent (Part 2)

Apr 05, 2026 15 min

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.

3

The Tool System: How Agents Act on the World (Part 3)

Apr 07, 2026 16 min

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.

4

The Permission Pipeline: Safety That Doesn't Get in the Way (Part 4)

Apr 09, 2026 15 min

Autonomous agents need guardrails without constant interruption. Claude Code's permission pipeline: safety that scales with risk — not a blunt on/off switch.

5

Configuration as Architecture: The Multi-Layer Settings Problem (Part 5)

Apr 11, 2026 13 min

Agent harnesses need a config architecture, not a flat file. How Claude Code layers settings across six stakeholder types — users, projects, enterprises.

6

The Memory System: How Agents Remember Across Sessions (Part 6)

Apr 13, 2026 14 min

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.

7

Context Management: The Compression Problem (Part 7)

Apr 15, 2026 14 min

Every long-running agent eventually hits the context window ceiling. The four-level compression architecture that keeps agents running, not crashing.

8

The Hook System: Extension Points That Don't Break the Core (Part 8)

Apr 17, 2026 16 min

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.

9

Sub-Agents, Coordinators, and Skills: Multi-Agent Orchestration (Part 9)

Apr 19, 2026 18 min

Single agents hit ceilings. Multi-agent systems hit coordination instead — the Fork pattern, the Coordinator pattern, and skills + MCP as the extension layer.

10

Streaming Architecture: Building Agents That Feel Fast (Part 10)

Apr 21, 2026 15 min

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.

11

Plan Mode: The Architecture of Thinking Before Acting (Part 11)

Apr 23, 2026 14 min

The most expensive agent mistakes happen in the first few turns. Plan Mode is the architectural pattern that prevents premature action.

12

Build Your Own Agent Harness: The Practical Blueprint (Part 12)

Apr 25, 2026 16 min

One post of synthesis after eleven of principles: three questions builders should answer, twelve design lessons, and the practical kit to start.