Insight · Harness Engineering
The harness is the operating system. The loop is just a program.
Most people optimize prompts. The highest performing teams optimize the harness · the permanent infrastructure that defines how an agent behaves before a single prompt runs. This is the practical architecture: seven files, five steps, three failure modes, and the order to build them in.
The core idea
Harness
Operating system
The permanent infrastructure that defines how the agent behaves: instructions, permissions, hooks, specialist agents, skills, tools, and memory. It exists before the work starts and survives after it ends.
Loop
Running program
The execution cycle that repeatedly moves work toward completion: goal, plan, act, verify, remember, continue or stop. A loop without a harness is improvisation at machine speed.
We wrote about the loop side in Stop Being the Loop. This is the other half · the system the loop runs on.
The harness
Seven files that decide how your agent behaves.
CLAUDE.md
Operating instructions
Permanent project instructions loaded into every session: architecture, conventions, approved commands, forbidden actions. Keep it under three hundred lines and prune it weekly · it is the system prompt for your project.
settings.json
Permissions
What the agent can execute without asking. A tight allow list (read, status, diff) and a hard deny list (force pushes, destructive deletes). Permissions are the difference between autonomy and anxiety.
hooks/
Automatic enforcement
Scripts that fire before or after tool use · format on every edit, lint after every change, log on every stop. Hooks guarantee every iteration ends in a clean state, whether or not the model remembers to.
agents/
Independent specialists
Verifier, researcher, planner, debugger. Each runs in a fresh context window. Asking one model to review its own work invites confirmation bias · separation is what makes verification real.
skills/
Reusable expertise
A prompt you have written three times is a skill waiting to be extracted. Skills load only when relevant, so a large library costs nothing until the moment it pays.
.mcp.json
Live systems
External tools · repositories, databases, browsers, documentation. Install only the servers you actually use. Every connection adds capability and complexity in equal measure.
MEMORY.md
Cross-session memory
Preferences, architecture decisions, lessons learned, recurring corrections. Memory should be curated, not appended forever · a memory file nobody prunes becomes noise nobody reads.
The loop
Five steps, run until done.
01
Specify the goal
A written definition of done, with verifiable conditions. Without it, the loop drifts and every iteration renegotiates what success means.
02
Plan, act, verify
Read the goal, pick the next task, implement it, then verify independently. The verifier must never be the same agent that did the work.
03
Write the state down
Every iteration updates a plan file on disk: current status, completed work, next action, known blockers. State on disk is what survives when context does not.
04
Schedule it
Cron, launchd, a queue worker. The scheduler stays dumb · run, log, restart. Business logic belongs inside the loop, never in the thing that fires it.
05
Persist everything
Timestamp, actions, results, verification, next task. Logs are not exhaust · they are the training data for the next version of the system.
The verification step is the entire difference between a loop and a hope. A prompt produces output. A loop checks the output against a bar you wrote down, fixes what fails, and only stops when the bar is met.
Where it breaks
Three failure modes, all structural.
Confident garbage
Cause · No verification.
Result · Incorrect work compounds quietly until something breaks in public.
Fix · An independent verifier agent with authority to reject.
Context rot
Cause · One enormous conversation.
Result · Hallucinations, forgotten requirements, accuracy that decays by the hour.
Fix · Fresh context every iteration. State lives on disk, not in the transcript.
The Ralph Wiggum loop
Cause · Progress never written down.
Result · Plan, do work, forget, repeat forever.
Fix · A persistent implementation plan the loop reads before every pass.
Minimum viable setup
Build it in this order.
Instructions and permissions first, verification immediately after, memory and specialization once the basics hold. The scheduler comes last · automating a loop that cannot verify itself just produces confident garbage on a timer.
01
CLAUDE.md
02
settings.json
03
a verifier agent
04
IMPLEMENTATION_PLAN.md
05
PROMPT.md
06
run.sh
07
MEMORY.md
08
skills/
09
MCP integrations
10
a scheduler
The mental model ladder: prompt engineering optimizes a conversation. Context engineering optimizes what the model sees. Loop engineering optimizes the cycle. Harness engineering builds the operating system all of it runs on.
Take it with you
The short version, ready to share.
Most people optimize prompts. The highest performing teams optimize the harness. There are two separate systems in every autonomous agent setup: The harness · the permanent infrastructure that defines how the agent behaves. Instructions, permissions, hooks, specialist agents, skills, tools, memory. The loop · the execution cycle that moves work toward completion. Goal, plan, act, verify, remember, repeat. Harness = operating system. Loop = running program. Three ways these systems fail: 1. Confident garbage · no verification, so wrong work compounds 2. Context rot · one giant conversation that slowly loses the plot 3. The Ralph Wiggum loop · progress never written down, so it plans, works, forgets, repeats The fixes are structural, not clever: an independent verifier, fresh context every iteration, state persisted on disk. Prompt engineering optimizes a conversation. Harness engineering builds an operating system for autonomous work. Full architecture: makebttr.com/insights/harness-engineering
Bttr. Field Brief
The brief Bttr. writes for senior buyers.
Monthly. One signal worth your time on Brand Operating Systems, AI search visibility, and the infrastructure buildout. No filler.
We design, build, and run digital systems for the science, aerospace, and biotech industries.