Harness

Agents Intermediate Also called: agent harness, scaffold
Definition

The software wrapped around an AI model that turns it into a working agent. It runs the tools, hands results back to the model, keeps the conversation trimmed so it fits in memory, and keeps the agent going on long tasks. Claude Code, Codex, and Cursor are harnesses. The model is the engine; the harness is the car.

In plain English

The model is the brain. The harness is the body: hands to click things, eyes to read the results, a notebook so it remembers where it was. The same brain in a better body is a better agent.1

In the real world

  • Claude Code, Codex, Cursor. Each is a harness with a model inside.
  • The “agent mode” in a chat app that can browse and run things.
  • The reason a task works in one tool and falls apart in another with the same model.

When to use it

When you’re comparing tools. Two products on the same model can feel completely different. The harness is the difference: what tools it has, how it manages the context window, what it asks permission for.

When not to use it

Don’t build your own because a blog post made it look easy. Anthropic’s own write-up is about how hard it is to keep an agent making progress across sessions.1 Buy one.

Good, bad, ugly

  • Good: a good harness makes an average model feel smart.
  • Bad: a bad harness makes a great model feel broken, and the model gets blamed.
  • Ugly: “we built our own agent” usually means “we built a worse harness than the free one.”

Key facts

Rule of thumb
Agent = model + harness
Examples
Claude Code, Codex, and Cursor are harnesses around models
It handles
Tools, permissions, memory, context, retries, and when to stop

Common questions

Why does the same model behave differently in different tools?

The harness. Different tools, different context management, different permissions. Same engine, different car.

Do I need to build one?

Almost never. You pick one. Claude Code, Codex, Cursor, and the agent features in chat apps are harnesses someone already built.

What does a harness do on long tasks?

It keeps the agent working across multiple context windows, summarizing or saving progress so a fresh session can pick up where the last one stopped. Anthropic calls this the long-running agent problem.

References

  1. Effective harnesses for long-running agentsAnthropic Engineering · 2025-11-26View source
  2. Building effective AI agentsAnthropic Engineering · 2024-12-19View source
Updated 2026-11-10 Reviewed by Elena Boyd Hallucination Knowledge cutoff