Module 1 · Agent Loop, Harness & System DesignTopic 1.2

The harness and Claude Code

What wraps the loop (tools, context, permissions, memory), then Claude Code as your build partner.

About 15 minYour steps ↓

Watch first · 4 min

Chapters · 3:54

Remember

  • The model asks. The harness runs it.
  • Context is cost. Clear it between tasks.
  • Read it before you approve it.
  • Plan first. Build small. Read it.

The harness: what wraps the loop

In 1.1 you stepped through a loop with one tool. Claude Code is the same loop, wrapped in a lot more software. That wrapper is the harness. The book's working definition (Book §3.1):

An agent harness is the runtime scaffolding that turns a base language model into an autonomous agent. It manages the agent loop, the tools the model can call, the permissions around those tools, and the context that moves in and out of each turn.

The model is the brain; the harness is the body. And the harness is the part you can change.

The four components (Book §3.3)

ComponentIn Claude CodeIn the Parcelly agent from 1.1
Toolsread/write/edit files, run commands, search, web fetch, plus anything added via MCPlookup_order
Contextsystem prompt, chat history, CLAUDE.md, open files, tool resultsthe conversation
Permissionsasks before running commands, deleting, pushing, networknone (it trusted every call)
MemoryCLAUDE.md, skills, slash commandsnone
The model sits in the middle, surrounded by the four parts of the harness: tools, context, permissions and memory. You talk to the harness, never to the model directly.
The model is the brain; the harness is the body. All four parts are code around the model, and all four are yours to change.

When a Claude Code session feels wrong, it's almost always one of those four levers. Every customisation you'll meet in 1.3 and 1.4 (CLAUDE.md, Skills, MCP, Subagents) is a change to the harness, not the model.

The landscape (Book §3.4)

Claude Code, Cursor, Cline, Codex CLI, Lovable and opencode are all harnesses around the same loop, with different trade-offs in surface, models and openness. In production you'll often swap the build-time harness (Claude Code) for a run-time one (the Claude Agent SDK, or your own) with the same model underneath. That's a conversation for Module 1's live sessions, and for Module 2, where you build a harness of your own.

Claude Code as a partner, not a vending machine

The skill isn't typing prompts. It's directing:

  • Plan first. Use plan mode for anything bigger than a one-file change. Read the plan, push back, then let it build.
  • Scope small. One feature per request.
  • Read what it wrote. Book §3.11 Reading Code You Didn't Write is the most underrated section for PMs. Ask "walk me through this file" until you could explain it to a client.
  • Watch permissions. Read what it wants to run before you approve it, and ask when you can't tell.
  • /clear between tasks, because context is cost and confusion.
  • Interrupt a flailing loop. If it's retrying the same fix, stop it (Esc) and re-plan.

This topic's steps put plan mode to work on one small build: a tip splitter, planned first, then built.

After this you'll be able to

  • Name the four harness components and spot which one a problem comes from
  • Direct Claude Code through a small build: plan first, then approve

Try it

Hands-on, in your browser.

Demo

Agent Architectures: a hands-on tour

One task (build a task manager) run four ways: single skill, sub-agent, orchestrator, production agent with hooks and MCP.

What to look for: Open Module 04, Production Agent: loop, hooks and MCP tools in one picture.

Open demo ↗

Want more?

Optional.