Harness Architecture
Engineering notes from four real agent harnesses: what to borrow, what to avoid, and why.
What this book covers
Section titled “What this book covers”The book is organized by agent engineering module. Each chapter answers 5 questions:
- What problem does this module solve inside an agent system?
- How does Codex, Claude Code, OpenClaw, and Hermes each solve it?
- What do they agree on, and why do the differences exist?
- If you build your own agent, what to borrow and what to avoid?
- Can one architecture diagram explain the runtime?
Four reference systems
Section titled “Four reference systems”- Codex (OpenAI): local and cloud coding agent. Use it to study the closed-loop coding cycle and three-OS sandbox.
- Claude Code (Anthropic): agentic coding tool. Use it to study developer UX and the skill engine.
- OpenClaw: multi-channel personal agent control plane. Use it to study session routing and sandbox boundaries.
- Hermes (Nous Research): long-running, self-improving agent. Use it to study engineering restraint, memory, and out-of-process security.
How to read
Section titled “How to read”- Building an agent from scratch: start at 01 · Overview and read in order.
- Copying a specific subsystem: jump to the chapter. Each §6 “Build Recipe” lists minimal, advanced, and avoid options.
- Researching one system: see System Profiles. One page per system, with five things worth copying.
- Each chapter’s §9 points to specific files and line numbers under
REF/.
22 chapters total: an overview, plus one chapter each on agent loop, context, tool system, verifier, file edit, shell, git, code review, subagents, session, permissions, sandbox, multi-channel entry, observability/cost, memory, skills, cron, self-improvement, security, todo-list progress, and execution-state surfaces.
Companion Skill: load the book into Claude or Cursor
Section titled “Companion Skill: load the book into Claude or Cursor”For implementation work, the book is packaged as a working index. The build-your-own-agent skill compresses the source-backed conclusions into a Claude Code / Cursor skill you can load with one command:
- 10 iron laws (every reference system obeys them) and an 8-axis spectrum for design decisions;
- 12-file Python scaffold ready to reuse;
- 9 reference docs: build, diagnose, selection, refactor, security, production deploy, interview prep, cross-skill;
- A lint script that statically checks your scaffold against the 10 laws. Drop it into CI.
See Companion Skill for install and one-line invocation patterns.