Skip to content

🟡 What is Harness Engineering?

💡 The core question of this document: How is "using a model well" different from "building a system with a model"?


1. What is a Harness?

The word "harness" comes from horse tack — the equipment used to safely control a horse's power and guide it in the right direction.

In AI, a harness is a structural system that wraps a language model. It's not the model itself, but an outer shell that provides context, tools, control flow, and memory so the model can operate correctly.

┌─────────────────────────────────────┐
│             Harness                  │
│  ┌───────────┐  ┌────────────────┐  │
│  │  Context  │  │  Tools/Perms   │  │
│  └───────────┘  └────────────────┘  │
│  ┌───────────┐  ┌────────────────┐  │
│  │  Memory   │  │  Exec Loop     │  │
│  └───────────┘  └────────────────┘  │
│           ┌──────────┐              │
│           │  Model   │ ← core engine│
│           └──────────┘              │
└─────────────────────────────────────┘

Analogy:

  • Model = Engine (powerful, but doesn't run on its own)
  • Harness = The entire car (wraps the engine, handles steering, safety, and fuel delivery)

2. Why Does the Harness Matter?

What happens with just a raw API?

python
# Raw API call — the simplest approach
response = anthropic.messages.create(
    model="claude-opus-4-5",
    messages=[{"role": "user", "content": "Review my code"}]
)

This uses less than 20% of the model's capability.

What's missingResult
No project contextReviews in the wrong language/framework
No file-reading toolsCan't see the actual code
No memoryCan't remember previous feedback
No permission controlRisk of modifying the wrong files
No execution loopAnswers once and stops

With a proper harness

Harness = Context + Tools + Memory + Permissions + Execution Loop

The same model can deliver 80%+ of its capability. The model didn't get smarter — you built a system that lets it work properly.

⚠️ Key mindset shift: The quality of an AI system depends more on harness design than on model performance.


3. The Rise of Harness Engineering

AI utilization has evolved through three phases.

Generation 1: Prompt Engineering (2022–2023)

"How should I phrase this to get a better answer?"

Better question → Better answer

Writing good prompts was the core skill. But prompts alone had limits for complex tasks.

Generation 2: Context Engineering (2024–)

"How do I give the model the right information at the right time?"

Prompt + relevant docs + history + system info → much better results

RAG (Retrieval-Augmented Generation), memory systems, and context window management became key topics.

Generation 3: Harness Engineering (2025–)

"How do I design a system where the model can work autonomously in a real environment?"

Context + Tools + Execution Loop + Memory + Permissions = Autonomous Agent System

The core skill is no longer just getting "good answers" — it's designing the entire system that lets the model complete real tasks.


4. Claude Code Itself Is a Harness

Think about what makes Claude Code different from a simple AI chat.

ComponentImplementation in Claude Code
ContextCLAUDE.md, .claude/rules/, automatic codebase reading
ToolsRead, Write, Edit, Bash, Grep, Glob, etc.
MemoryTODO.md, Plans.md, memory file system
Permission controlsettings.json allowedTools/deniedTools, Hooks
Execution loopConversation → Analysis → Tool execution → Reflect → Repeat

Claude Code wraps the Claude model in a harness specialized for coding tasks. It's the harness, not the model, that makes Claude Code what it is.

Customization through this lens

Writing CLAUDE.md          → Improving the context layer
Custom commands (/doc)     → Controlling the execution loop
Connecting MCP servers     → Extending the tools layer
Configuring Hooks          → Strengthening the permission layer

Customizing Claude Code = Designing the harness yourself.


5. Why Learn This Now?

AI model performance is rapidly converging. GPT-4o, Claude, and Gemini are all reaching similar capability levels.

What creates a difference now is not model choice but harness design skill.

10 years ago: Developers who wrote great algorithms had the edge
5 years ago:  Developers who mastered cloud infrastructure had the edge
Today:        Developers who design great AI harnesses have the edge

💡 Next step → Learn the practical 5-layer design method in Harness Design.

PRs welcome ✦