You've now learned what a Large Language Model is and how to talk to it through an API. But something's still missing from the story. When you chat with ChatGPT or Claude, you're not talking to a bare model. There's a whole layer of software in between, and it's called a harness.

The horse-and-harness analogy

Analogy

A horse alone doesn't pull a carriage. It has strength, sure. It can walk, sure. But for that strength to become useful, to pull a wagon, carry loads, walk in a straight line, it needs a harness. The harness connects the strength to the world. It's the same with AI.

A language model is, at its core, a function that generates text. Nothing more. It can't search the internet on its own, can't open a file, can't send an email, can't run code, can't remember what was discussed ten minutes ago. It generates text. Full stop.

For this bare capability to become a real tool, someone has to build around it: save a chat history, give the model tools to use, evaluate the responses, add safety filters, draw a user interface. That whole shell is the harness.

What exactly is a harness?

A harness is the software shell around an AI model that controls:

Key takeaway

The model is the engine. The harness is everything around it: body, steering wheel, brakes, dashboard, seatbelt. Only both together make a car you can actually get into.

Real-world examples

Here's the key insight: the same model can live inside many different harnesses. You probably already know several without realizing it.

01

ChatGPT.com

A web harness around GPT models. Saves chats, knows tools like web search and image generation, offers a friendly interface.

02

Claude Desktop

A desktop harness around Claude. Can connect to local programs (via MCP), display files, hold long histories.

03

Claude Code

A command-line harness that gives Claude direct access to your file system, Git, and the shell. Built specifically for programming work.

04

Cursor / GitHub Copilot

Code-editor harnesses that plug in various models and integrate them directly into your editor, with file context, tab completion, code diffs.

If you can't find Claude on ChatGPT.com, that's not about the model, it's about the harness.

Why the same model suddenly behaves differently

This is where a lot of beginners get puzzled. You use Claude in the web chat and it feels friendly and explanatory. You use the very same Claude in Claude Code, and it suddenly writes more tersely, more technically, wants to use tools, asks for file paths. Does the model have two personalities?

No. The harness gives the model a different role at the start of every conversation. In the web chat, the system prompt effectively says: "You are a helpful assistant, answer in a friendly, explanatory way." In Claude Code it says: "You are a software engineer assistant, be direct, precise, use these tools, follow these rules." Different script, different behavior, same actor.

Example

A restaurant could use the Anthropic SDK to build its own reservation chatbot. The harness would then be: a web widget on the restaurant's site, a system prompt ("You book tables for Restaurant Sonne"), tools for database queries ("Is Saturday 7pm free?"), safety rules (no unrelated topics, no language switching). The same Claude model as in ChatGPT-like products, just with a different harness.

The agent loop, the heart of the harness

When a harness gives an AI tools, a small loop runs in the background called the agent loop. It's surprisingly simple, and it's the entire "magic" behind AI agents:

Step 1. Call the model

The harness sends the model the current history and a list of all available tools ("You may read, search, execute, write"). Then it asks: "What do you do next?"

Step 2. Read the response

The model responds either with text ("Here's your answer: ...") or with a tool request ("Please run the tool read_file with the argument note.txt").

Step 3. Run the tool

If the model wants to use a tool, the harness executes the action, it opens the file, searches the web, writes something. The model itself does nothing. The harness is the hand.

Step 4. Feed back the result

The harness appends the result ("File content: ...") to the history and calls the model again. The model now sees: "Ah, the file contains this."

Step 5. Repeat or finish

The loop keeps running until the model says: "I'm done" and returns only text. Then the harness shows that text to the user.

That's the entire architecture behind programs like Claude Code or Cursor. A loop that queries the model, executes its tool requests, and feeds back the result, over and over, until the task is done.

The agent loop
What actually happens between your prompt and the finished answer.
The model doesn't think in one go. The harness repeats this loop over and over, until the AI itself says "I'm done".

What makes a good harness

Not all harnesses are equal. What separates a good one from a bad one?

Careful

A harness can make the same model either very useful or very dangerous. A harness without permission checks that gives the model free access to your file system or your bank account is a problem. More on this in the chapter on Safety.

Harness is not the same as agent

The terms are sometimes mixed up, but they're not the same thing. A harness is the shell. An agent is what emerges when the harness gives the model real agency (tools, multiple steps, independent decisions). More on this in the next chapter.

Remember it this way: every agent runs inside a harness. But not every harness creates an agent, a simple web chat without tools is already a harness too, just a minimal one.

Key takeaway

If someone asks you: "Which model is the best?", that's only half the question. Just as important is: which harness does it run in? A mid-sized model in a good harness often beats the biggest model without tools.

In three sentences

What you know now

  • A harness is the software shell around an AI model. System prompt, tools, history, safety, and interface together.
  • The same model behaves completely differently in different harnesses. ChatGPT.com, Claude Code, and Cursor are different harnesses around, in part, the same models.
  • Inside, an agent loop runs: ask the model, execute its tool request, feed back the result, repeat until done.