---
title: "Harness engineering: the model doesn't matter, the “environment” is everything"
url: "https://zuey.me/articles/harness-engineering-model-khong-quan-trong-moi-truong-moi-la-tat-ca?lang=en"
locale: en
access: members
full_text: false
published_at: "2026-03-18T06:29:22.000Z"
tags: ["AI Agents", "Claude Code", "Context Engineering", "Programming"]
translations:
  vi: "https://zuey.me/articles/harness-engineering-model-khong-quan-trong-moi-truong-moi-la-tat-ca.md?lang=vi"
  zh: "https://zuey.me/articles/harness-engineering-model-khong-quan-trong-moi-truong-moi-la-tat-ca.md?lang=zh"
  ko: "https://zuey.me/articles/harness-engineering-model-khong-quan-trong-moi-truong-moi-la-tat-ca.md?lang=ko"
  ja: "https://zuey.me/articles/harness-engineering-model-khong-quan-trong-moi-truong-moi-la-tat-ca.md?lang=ja"
---
# Harness engineering: the model doesn't matter, the “environment” is everything

> Same Claude Opus model, yet it feels way better inside Claude Code than in other tools? It's not a nerf, folks. What makes the difference is the harness - the entire environment the model works inside.

[X: https://x.com/rohit4verse/status/2033945654377283643](https://x.com/rohit4verse/status/2033945654377283643)

> You've probably wondered: “why is it the same Claude Opus model, yet it seems so much better in Claude Code/Claude Desktop than in Antigravity or OpenCode?” - this post explains why.

It's not because Anthropic hands out “juiced-up” models or nerfs them for those other tools. It's the exact same model.

And if you're still arguing online about “is GPT-5 or Claude Opus better”… you're arguing about the wrong thing.

The thing that actually makes the difference has a name: **Harness Engineering.**

**The model is just the brain. The harness is what decides what that brain can do.**

This is the context engineering I've talked about many times - but taken to a whole new level.

> **INFO:** **TL;DR:** Same model, better harness, massive difference. SWE-agent gained 64% in performance just by changing the interface. Anthropic uses a 2-agent architecture so the agent runs reliably across many context windows. OpenAI built ~1 million lines of code without anyone writing a single line by hand.

---

### Table of contents

1. What is a harness? (and why it's not a system prompt)
2. SWE-agent - the first evidence: same model, 64% better performance
3. How Anthropic built the harness for Claude Code
4. OpenAI - 1 million lines of code, 0 written by hand
5. The 7-layer taxonomy of agent harnesses
6. 5 design patterns that keep showing up in every great team
7. [Side rant] How this relates to ClaudeKit and the reality in Vietnam
8. Wrapping up

---

### 1/ What is a harness? (and why it's not a system prompt)

This is the crux that a lot of people get wrong.

A harness is **not** a system prompt. It's not a wrapper around an API call. It's not an eval framework or a prompt template.

A harness is **the entire environment** an LLM operates inside - including:

- The tools the model can call
- The format of the information the model receives
- How conversation history is compressed and managed
- Guardrails that catch errors before they spread
- Scaffolding that lets the model “hand off” work to the next session

The word “harness” was chosen very deliberately. The horse (the model) is strong and fast, but it has no idea where to run. The harness is what steers all that power.

---

### 2/ SWE-agent - same model, 64% better performance

In 2024, the Princeton NLP group (John Yang, Carlos Jimenez and colleagues) published a hugely important paper at NeurIPS 2024: **SWE-agent**.

The paper introduced the concept of an **Agent-Computer Interface (ACI)** - an abstraction layer sitting between the LLM agent and the computer environment. Just like HCI (Human-Computer Interface) is designed for human brains, ACI is designed for the LLM's “brain”.

The result? **Same GPT-4 model, same task, same compute budget:**

- With a plain bash shell: solved **3.97%** of issues on SWE-bench
- With a custom ACI: solved **12.47%** of issues

**SWE-agent: % of SWE-bench issues solved (same GPT-4)** (bar chart)

| Label | % of issues solved |
| --- | --- |
| Plain bash shell | 3.97 |
| Custom ACI | 12.47 |

A **64% relative performance** gain. No model change. No prompt change. Only the *interface* changed.

Let me explain why this number is insane: 64% isn't a marginal gain. It's the difference between “a tool that works” and “a tool you throw away”.

#### What's in SWE-agent's ACI?

4 main components, each reflecting a deep insight into how LLMs fail:

**a/ Search with capped results (capped search)**

Instead of returning 10,000 lines of grep output (flooding the context window), the ACI caps results at 50. If there are more than 50, it tells the agent to “narrow your search”.

Sounds so simple it's almost… insulting. But it's one of the highest-leverage changes in the whole paper. Why? Because agents are like people - when confused, they search all over the place, and the more they search the noisier it gets, and the noisier it gets the dumber they get. Capped search forces the agent to think more specifically instead of “grepping the whole world”.

**b/ A file viewer that shows 100 lines, with state and line numbers**

They tested several configurations: 30 lines (too few, loses context), the full file (too much, loses focus). 100 lines was the sweet spot.

And a small but extremely important detail: **show the line number before every line of code**. Because when the agent needs to write “edit lines 47-52”, it has to read the line numbers directly instead of counting. Reducing the model's cognitive load = freeing up capacity for solving the real problem.

**c/ An editor with a built-in linter**

After every edit, the tool automatically runs a linter. If the edit causes a syntax error, it gets **rejected immediately** before being applied, with a clear error message.

Why does it matter? Because without a linter, the agent might introduce a syntax error → run tests → see a failure for some other reason (not that syntax error) → chase the wrong bug → burn the whole context window → freeze up.

**d/ Context management - compressing old observations**

Observations older than the last 5 steps get compressed into a 1-line summary. This keeps the context focused on the most recent information instead of being “buried” in the full history.

---

### 3/ How Anthropic built the harness for Claude Code

If SWE-agent solves the “single session” problem, Anthropic faced a much harder one: **what happens when a task is too big to fit in one context window?**

And that's the reality of most real software projects. A web app has hundreds of files, thousands of functions, a test suite, config, docs, dependencies. Even a 200K token context window isn't enough.

> **INFO:** Oh, and by now Opus comes with a 1M context window by default, so I barely use compact anymore.

#### Two classic failure patterns

Anthropic documented 2 kinds of failures when letting a model run on its own across many context windows:

**Pattern 1: Doing too much at once.** The agent gets the prompt “build a claude.ai clone” → tries to implement every feature → runs out of context window halfway → the next session inherits a pile of half-finished code, no docs, no idea what's done → burns context trying to make sense of the mess instead of moving forward.

**Pattern 2: Declaring victory too early.** The agent looks around, sees code already exists → concludes “it's done” → stops while the app is still incomplete. This isn't stupidity - it's reasonable inference from incomplete information. The agent simply has no way of knowing what “done” means for this project.

---

*Phần còn lại dành cho thành viên có quyền đọc toàn bài (Knowledges, Kết hợp, Cộng đồng) — see plans at https://zuey.me/pricing*
