Guides · Nov 29, 2026
What is an agent harness?
What an agent harness is, how Claude Code and Codex use one, and why it matters.
Built by Simon + Claude
TL;DR
- A harness is everything around the model, the instructions, tools, memory, permissions and the loop, that turns it into an AI agent.
- The harness decides what the same model can do, so the model and the harness are two separate choices.
- Open Claude Code or Codex in a folder you work in and ask it to explain its own harness in plain words.
When Daisy Hollman from the Claude Code team at Anthropic joined us on stage at Build Day in September, she talked about her work on the harness behind Claude Code. She also said she thinks the way developers work with coding agents today is how knowledge workers will work with agents in the future.
So the harness is worth understanding even if you never write code. Claude is the model, and Claude Code is the harness around it that turns it into an agent.
The five parts of a harness
Anthropic's Claude Code glossary describes the harness as everything that turns a model "into a capable coding agent". Vivek Trivedy at LangChain sums it up as "Agent = Model + Harness".
Think of a car, where the model is the engine and the harness is the rest of the car. The five parts are in green. Skills and hooks add to them, and the Claude Code section explains both.
How the harness works
Say you ask for a competitor analysis from four annual reports in a folder.
The model reads the task and decides the next step, which is to open the first report. The harness opens the file and hands the text back. The model decides again, and this loop runs report by report until the analysis is written and saved in the folder.
Anthropic describes the same split. The model reasons, the tools act, and Claude Code is the layer that provides the tools and manages what the model sees.
At the end the model may want to delete its early drafts. Before a risky step like that, the harness can stop and ask you first. That rule lives in the harness, so it holds whichever model is inside.
Why the harness matters
The harness decides what the same model can do for you. Give it your files, the right tools and notes from last time, and it can finish a task and check its own work before it hands it over.
So the model and the harness are two choices. Claude models run in Claude Code, and also inside Cursor and Copilot Cowork. When you compare AI tools, it helps to ask which model is inside and which harness is around it, because both change the result.
Claude Code
Claude Code is Anthropic's harness around Claude. Despite the name it is an everything agent, and Anthropic says it can also help with things like research and writing documents. Here it is at work on the competitor analysis.
You choose how much it may do without asking, from asking before every change to working on its own while a separate check blocks risky steps.
Three things extend the five parts. Skills are saved ways of doing a task, loaded when that task comes up. Hooks are steps that run by themselves at set moments, such as checking the totals after every save. Subagents are helpers that take one part of a task and report back.
Codex
Codex is OpenAI's harness. OpenAI presents it for software work first, but it is an everything agent too and can work on the reports in a folder in the same way.
OpenAI says Codex uses one open-source harness in its app, in the terminal and in code editors. The Codex app is now part of the ChatGPT desktop app, where Codex sits beside Chat and Work.
OpenAI recommends starting with the setting Ask for approval, where Codex works freely inside the folder you open. It asks before it edits files outside that folder or runs a command that goes online.
Codex reads its project instructions from a file called AGENTS.md. Claude Code reads it too when there is no CLAUDE.md in the folder or in the folders above it, so a team that uses both can keep one instructions file.
Codex also has skills, hooks and subagents, and the same five parts as Claude Code with some differences in how they work.
Other popular harnesses
Claude Code and Codex are everything agents, for code and for other work too. Below them are the other big harnesses as of November 2026. GitHub Copilot, Cursor, OpenCode and Google Antigravity are mostly for coding. Claude Cowork, Copilot Cowork and ChatGPT Work are for everyday work, and OpenClaw is an open-source personal agent.
What is Claude Cowork? goes through Cowork, and Microsoft Copilot vs Claude compares those two.
Where to start
Open Claude Code or Codex in a folder you already work in, and ask it to explain its own harness.
YouExplain in plain words, for someone who does not write code, how your harness works in this folder. Which instructions do you read, which tools can you use, what do you remember between sessions, and what do you have to ask me about first?
Hold the answer up against the five parts in this guide. If it reads no instructions file, that is the first part to fill in, and our guide to CLAUDE.md shows how.
Questions we get
Is ChatGPT a harness? ChatGPT is an app with a harness inside it. GPT is the model, and ChatGPT adds the tools, memory and permissions that let it work with your files and connected apps. In ChatGPT Work it can also take several steps on its own.
Is a harness the same as an agent? No, the agent is the model and the harness together. The harness is the part around the model, which is why harnesses such as Cursor and OpenCode can run models from several companies.
Do we need to build our own? No, for most teams the work is in what goes into an existing harness, the instructions, skills and connectors. Developers who want a harness inside their own software can use Anthropic's Claude Agent SDK or Claude Managed Agents, in beta, or OpenAI's Codex SDK.