What is Claude Code? The model, the harness, and why the difference matters
· Updated
People say "Claude Code" and "Claude" as if they were the same thing. They aren't, and the difference explains a lot about why AI tools that use the same model can feel so different.
Two pieces: the model and the harness
The model is the part that thinks. Claude comes in a few sizes (Opus, Sonnet and Haiku), and it runs on Anthropic's servers or through cloud providers like Amazon Bedrock or Google Cloud. On its own, a model takes text in and gives text back. It can't open a file, run a command or remember yesterday.
The harness is everything around the model that turns that text into work. Claude Code is a harness. Anthropic's docs describe it as the layer around the model that provides the tools and manages the context.
LangChain's Vivek Trivedy puts it simply: if you're not the model, you're the harness.
What the harness actually does
When you ask Claude Code to "add a checkout page to my site", the harness:
- Gathers context. It loads your project's instruction file (
CLAUDE.md), notes it has kept from earlier sessions, and the files that look relevant. - Gives the model tools. Reading and editing files, running terminal commands, searching, browsing, plus any tools you connect through MCP.
- Runs the loop. The model asks for an action, the harness carries it out, and the result goes back to the model, which decides what to do next. This repeats until the work is done or it needs you.
- Enforces permissions. You choose what runs without asking: nothing, file edits only, or more. Hooks can block an action outright, whatever the model decides.
- Manages memory. A model can only hold so much at once. When a session gets long, the harness summarizes older parts (compaction) so the work can continue.
- Splits up work. It can hand a side task to a subagent with a clean slate, or load a skill, a packaged set of instructions for one kind of job.
Anthropic's own description of an agent is short: a model using tools in a loop, guided by what happens. The model supplies judgment. The harness supplies hands, eyes and memory.
Where it runs
The harness runs on your computer by default: in the terminal, in VS Code or JetBrains, or in the desktop app. You can also run sessions in the cloud at claude.ai/code. Either way, the model itself runs remotely; only the harness is local.
Anthropic also offers the harness on its own as the Claude Agent SDK, a library that lets you build your own agent on the same loop, tools and permissions.
Same model, different harness, different results
This is the interesting part. Swap the harness and the same model does noticeably better or worse.
Terminal-Bench 2.0, a benchmark of hard command-line tasks, ran the same models through several harnesses (Merrill et al., 2026):
- GPT-5: 49.6% in OpenAI's Codex CLI, 41.5% in OpenHands, 35.2% in Terminus 2 (a deliberately minimal harness), 33.9% in Mini-SWE-Agent.
- Claude Haiku 4.5: 28.3% in Terminus 2, 27.5% in Claude Code, but 13.3% in OpenHands.
- Claude Opus 4.5: 57.8% in Terminus 2, 52.1% in Claude Code, 51.9% in OpenHands.
- Claude Sonnet 4.5: between 40.1% and 42.8% in all four harnesses it was tested in.
Three things stand out:
- The gap can be big. GPT-5 swung almost 16 points on the same tasks. Haiku more than halved in one harness.
- The maker's harness isn't always best. For the Claude models, the minimal Terminus 2 scored at or above Claude Code.
- Sometimes it barely matters. Sonnet 4.5 landed within 3 points everywhere.
Harness builders see the same thing from the other side. LangChain reported raising its agent's Terminal-Bench 2.0 score from 52.8% to 66.5% while keeping the model fixed. They added a check-your-work step before finishing, told the agent about its environment up front, and caught it when it kept editing the same file.
Anthropic says the same about its own work. When it built its SWE-bench agent, it spent more time improving the tools than the prompt, and one small change (requiring full file paths) removed a whole class of mistakes.
So what does a harness need?
A recent paper on what makes a harness a harness boils it down to four parts:
- A loop that keeps going until the job is done.
- Tools the model can call.
- Context management: what the model sees, and what it forgets.
- Controls: permissions, limits, and when to stop and ask.
Claude Code, Codex CLI, Aider, Cline and OpenHands all have these four. They differ in how they do each one.
How to build your own
You can build a small harness yourself in an afternoon. You need six things:
- A model. Claude, or a model from OpenAI, Google or anyone else with an API that supports tool calls.
- Tools. Plain functions in your code (read a file, run a command, look something up), each described to the model with a name, a sentence about what it does, and the inputs it takes.
- A loop. Send the task, run whatever tools the model asks for, send back the results, and repeat until the model says it's done.
- Context management. Decide what goes in: instructions, the relevant files, notes from last time. Decide what comes out when the conversation gets too long.
- Permissions. Decide which tools run on their own and which ask a person first. A command that deletes files should never run unasked.
- An interface. A terminal, a chat box, a Slack bot: wherever people talk to it.
The loop, in about 40 lines
Here is a minimal agent with one tool, written in Python with Anthropic's SDK. It asks before running each command, which is the smallest possible permission system.
import subprocess
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
tools = [{
"name": "run_command",
"description": "Run a shell command and return its output.",
"input_schema": {
"type": "object",
"properties": {"command": {"type": "string"}},
"required": ["command"],
},
}]
def run_command(command):
if input(f"Run `{command}`? [y/N] ") != "y":
return "The user declined to run this command.", True
result = subprocess.run(command, shell=True, capture_output=True, text=True)
return (result.stdout + result.stderr)[-5000:], result.returncode != 0
messages = [{"role": "user", "content": "How many Python files are in this folder?"}]
while True:
response = client.messages.create(
model="claude-sonnet-5-5", max_tokens=4096, tools=tools, messages=messages
)
messages.append({"role": "assistant", "content": response.content})
if response.stop_reason != "tool_use":
break
results = []
for block in response.content:
if block.type == "tool_use":
output, failed = run_command(**block.input)
results.append({"type": "tool_result", "tool_use_id": block.id,
"content": output, "is_error": failed})
messages.append({"role": "user", "content": results})
print(response.content[-1].text)
That's the whole idea of an agent. Three rules from Anthropic's docs that trip people up:
- Every tool request in a reply needs its own result back, including the ones that failed (mark those
is_error). - Send the model's reply back exactly as it came, and put the tool results first in your next message.
- Send the same tool list on every call.
Everything else in a real harness is about doing these steps well. Better tool descriptions, smarter choices about which files to show the model, a check-your-work step before it finishes, and notes that carry over to the next session all add up. That's the kind of difference behind the gaps above.
Shortcuts
You don't have to write the loop yourself:
- Anthropic's tool runner. The Python SDK can run the loop for you: write plain functions, mark them with
@beta_tool, and callclient.beta.messages.tool_runner(...). Write the loop yourself when you need approval steps or custom logging. - The Claude Agent SDK. This gives you Claude Code's own harness as a library: its file and terminal tools, permissions, hooks and context management. Install it with
pip install claude-agent-sdk:
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
async def main():
async for message in query(
prompt="Review utils.py for crash bugs and fix them.",
options=ClaudeAgentOptions(
allowed_tools=["Read", "Edit", "Glob"],
permission_mode="acceptEdits",
),
):
if isinstance(message, ResultMessage):
print(message.subtype)
asyncio.run(main())
allowed_tools lists the tools that run without asking; it doesn't stop the agent seeing other tools. permission_mode="acceptEdits" lets it edit files without asking each time.
Building your own makes sense when you want a different interface, your own tools, or tighter control over what the agent sees and remembers. If you just want a coding agent, the existing ones are already well tuned.
If you can own the data center, why pay for Claude?
If the harness is just software, and open-weight models are free to download, a fair question follows: once you can buy a box that runs a good open model on your desk, why subscribe to anything?
Those boxes exist now. NVIDIA and AMD both sell what they call personal AI supercomputers: small computers built around one job, running AI models, with a lot of fast memory shared by the processor and the graphics chip. Prices below are from late 2026 reports and have moved a lot with memory shortages, so check before you buy.
The small boxes, about the size of a hardcover book:
- NVIDIA DGX Spark: 128 GB of memory. It launched at $3,999 in October 2025, and later reports put it at $4,699 or more. Dell, HP, ASUS, Acer, Gigabyte and MSI sell their own versions. NVIDIA says one runs models up to 200 billion parameters, and you can cable two together for up to 400 billion.
- AMD Ryzen AI Halo: AMD's answer, also 128 GB, announced at $3,999 and sold in the US through Micro Center.
On these, OpenAI's open model gpt-oss-120b writes about 50 to 60 tokens (roughly, word pieces) a second in community tests. That's faster than you can read.
The big one, about the size of a desktop tower:
- NVIDIA DGX Station: 748 GB of memory, sold by Dell, HP, ASUS, Supermicro and others, from about $97,000 to $125,000. It's the only desk-side box that can hold the largest open models, around a trillion parameters. Early reports put a trillion-parameter model at about 40 to 50 tokens a second.
You can point Claude Code itself at a model running on one of these. Ollama, a free tool for running models locally, speaks the same language as Anthropic's API, so you change one setting and the same harness drives your own model.
So why pay? Four catches, as of late 2026.
1. The best open models don't fit in the small boxes. The strongest open-weight models, like Kimi K2.6 (about a trillion parameters) and the largest GLM and DeepSeek models, need hundreds of gigabytes. Even four linked Sparks fall short. Under $10,000, you get a smaller model, or a big one squeezed so hard it loses quality. The models that do compete need the $100,000 box.
2. Open models are a few months behind, and the gap isn't shrinking. Epoch AI, which tracks this, found the best open models trail the best closed ones by about four months, a gap that hasn't narrowed since late 2025. On agentic coding tests like Terminal-Bench 2.0, top open models score in the mid-60s while the best closed ones reach the low 80s.
3. Agents read a lot. A coding agent re-reads your instructions, files and the conversation so far on every step. A Spark reads prompts at roughly 1,200 to 2,600 tokens a second, so a 100,000-token context means waiting about 40 seconds to a minute and a half before each reply even starts. Hosted models do it in seconds, and they run many agents at once where your box runs one or two.
4. The money doesn't add up yet. A $4,699 Spark is about 20 years of Claude Pro at $20 a month. A $100,000 Station is over 80 years of Claude Max at $100 a month. And you can rent the strongest open models from hosting companies for a fraction of Claude's per-token price, without buying anything.
Owning the box still wins on some things: your code and data never leave the building, it works offline, there are no usage limits, and the cost is fixed once you've paid. For a company with private data and steady heavy use, that math can work, which is exactly who the Station is for.
Small models doing one job are a different story. Local AI already wins where the task is narrow, needs an instant answer, or shouldn't leave the device. Speech-to-text is the clearest case. Moonshine, an open-source speech model co-created by Pete Warden, turns speech into text on the device as you talk. Its 245-million-parameter streaming model scores a 6.65% word error rate on English, against 7.44% for OpenAI's Whisper Large v3, which is six times its size. It answers in about 59 milliseconds on a MacBook Pro and 174 on an iPad, by the team's own benchmarks. It's free under the MIT license and runs on iOS, Android, the web (WebAssembly) and a Raspberry Pi. Warden's point is that voice only feels natural at around 200 milliseconds, and a round trip to a cloud service often takes a couple of seconds. A coding agent is the opposite job: it reads everything and needs the strongest reasoning available, so that's where the big hosted models still earn their price.
My guess: for a while, most people doing hard work will keep paying for the best model, because "a few months behind" matters when the best model is the one that finishes the job. But notice what's happening underneath. If any model can sit inside any harness, the model becomes swappable. What you'll actually choose is the harness: how well it knows your project, what it remembers, and how it checks its own work.
Why this matters if you're building with AI
When you compare AI tools, comparing the models only tells you part of the story. Two products can use the same Claude model and give you very different results, because one feeds it better context, gives it better tools, or remembers what you told it last week.
That last one is why Domfly exists. Most builders start every session cold, so you re-explain what you're making and what you already decided. That isn't the model's fault. Forgetting is a harness problem, and so is fixing it.
Further reading
- How Claude Code works, Anthropic docs
- Claude Agent SDK overview, Anthropic docs
- Build a tool-using agent, Anthropic docs
- Tool runner, Anthropic docs
- Agent SDK quickstart, Anthropic docs
- Building effective agents, Anthropic
- Effective context engineering for AI agents, Anthropic
- Effective harnesses for long-running agents, Anthropic
- Terminal-Bench: benchmarking agents on hard, realistic tasks in command line interfaces, Merrill et al.
- Improving deep agents with harness engineering, LangChain
- Open vs closed model gap, Epoch AI
- NVIDIA DGX Spark, NVIDIA
- Claude Code with Ollama, Ollama docs
- What makes a harness a harness, arXiv
- Pete Warden on local AI, open models and voice interfaces, The Data Exchange podcast
- Moonshine vs Whisper benchmarks, Moonshine docs
- Moonshine on GitHub (license, platforms)