The plain definition
A language model, on its own, takes text in and gives text out. You ask a question, it answers. It cannot open your files, run a test, look at a web page or remember yesterday. It has no hands.
A harness gives it hands. It is an ordinary program that sits around the model and does four jobs:
- It loops: it sends the model your request, runs whatever the model asks for, feeds the result back, and repeats until the work is done.
- It offers tools: a shell, file access, a browser, connections to other services.
- It enforces permissions: which tools the model may use, and which actions need your approval first.
- It manages context and memory: what the model is shown on each turn, and what is kept for next time.
Put together, the model can act, not only answer. Ask a chatbot how to fix a failing test and it describes a fix. Ask a harness and it opens the file, makes the change, runs the test, reads the failure, tries again, and tells you what happened.
A harness is a language model plus a loop, tools, permissions, context and memory, packaged as a program you can point at real work.
The word comes from the same idea as a test harness or a climbing harness: the thing that holds the powerful part in place and connects it safely to the job. Vendors also say "coding agent", "agent runtime" or "agentic tool". They mostly mean the same thing. This site says harness because it names the part you operate. The model is rented; the harness is where your setup lives.
Despite the usual name "coding agent", a harness is not limited to code. The same loop can edit documents, process spreadsheets, research a topic, file tickets or run a business routine, as long as the tools exist. Code is simply where harnesses started, because code is easy to run and easy to check.
The loop
Everything else on this page hangs off one cycle. The harness runs it many times for a single request.
The loop ends when the model gives a final answer, you stop it, or a limit is hit.
Take a request like "the signup form accepts empty emails, fix it". Round one: the model asks to search the code for the form. Round two: it reads two files. Round three: it edits the validation. Round four: it runs the tests, and one fails. Round five: it reads the failure and corrects the edit. Round six: the tests pass, and it replies with a summary. Six trips round the loop, and you typed one sentence.
Two properties of this loop explain most of what you will see in practice. First, each turn is only as good as what the model can see, so what goes into the context matters more than clever wording. Second, errors compound: a wrong assumption in round two shapes everything after it. That is why checking, not just starting, is the skill.
The parts, one by one
The model
The language model is the part that reasons and writes. Most harnesses are built around one vendor's models; others let you plug in many, including models running on your own machine. The model sets the ceiling on how well the harness can plan, read code and recover from mistakes. The harness sets how much of that ability reaches your work.
The agent loop
The loop is the cycle above. Details differ: some harnesses let the model call several tools at once; some pause for a plan you approve before any change; some stop after a set number of steps. Many can run headless, meaning without a person watching, so they can be started from a script or a scheduler.
Tools
A tool is a named action the model may request, with a description of what it does. Common ones:
- Shell. Run commands: install packages, run tests, start servers, use git. This is the most powerful tool and the one that needs the most care.
- Files. Read, search and edit files in a project folder.
- Browser. Open pages, click, read what is on screen, check that a web app works.
- Web search and fetch. Read documentation or look something up.
- MCP servers. The Model Context Protocol is an open standard for connecting an AI tool to outside data and services, such as a ticket tracker, a design file or a database [1]. Add an MCP server and the harness gains the tools it offers, with no change to the harness itself.
The set of tools is the set of things the harness can do. Remove the shell and it can still edit but cannot run anything. Add a browser and it can check its own work on a screen.
Permissions and approval modes
Because tools change real things, the harness decides which calls go ahead. Typical modes:
- Ask for everything. Every command and every edit waits for you. Safe, slow.
- Ask for risky things. Reading is free; editing and running commands need approval, or match an allow-list you set.
- Plan first. The agent may read and think, then presents a plan. Nothing changes until you accept it.
- Run freely. Everything goes ahead without asking. Fast, and only sensible inside a sandbox, such as a throwaway container or a branch you can discard.
Good practice is to widen permissions as you gain trust in a particular task, not once for all tasks. Some tools also add a sandbox, a fenced area where commands cannot reach beyond the project. Not every harness has either feature; some run with all of your own user's privileges, and say so.
Context window and compaction
The model does not remember in the way you do. On every turn it is shown a bundle of text: your instructions, the conversation so far, the tool results it has gathered. That bundle must fit the context window, which has a fixed size.
Long jobs fill it. A harness then does compaction: it replaces older material with a summary, or drops bulky tool output, so work can continue. Compaction loses detail. A rule you gave in the first message may be summarised away, and the agent drifts. Experienced operators keep the important rules in files that are re-read, instead of trusting the conversation to hold them. The free Context module is about exactly this.
Memory and instruction files
Memory is whatever survives past one conversation. The simplest form is an instruction file in your project, a plain text file the harness reads at the start of every session: your coding standards, how to run the tests, what not to touch. Claude Code reads CLAUDE.md, and can read an AGENTS.md if that is what your repository already has [2]. AGENTS.md is a convention shared by several tools, so one file can serve more than one harness.
Some harnesses also keep automatic memory: notes the agent writes for itself, or a searchable store of past sessions. Treat these like any notes. They help, and they can go stale or wrong, so read them now and then.
Hooks
A hook is a rule the harness runs for you at a set moment: before a tool call, after a file edit, when the agent says it is finished. For example: format every edited file, refuse any command that touches a secrets file, or run the tests before the agent may stop. Claude Code documents hooks as shell commands that run before or after its actions [2]. The difference from an instruction is important. An instruction in a file is a request the model may forget. A hook is code that runs every time, whatever the model decides.
Skills
A skill is a packaged routine, usually a folder with a description and steps, that the agent loads when it is relevant: "review this pull request", "publish the release". It is how you teach a harness a repeatable job once. Our free skills are an example for Claude Code.
Subagents and parallel sessions
A subagent is a second agent that the first one starts for a narrow job, with its own fresh context. It reads thirty files, then returns a short answer, so the main conversation stays small [2]. This keeps context clean and lets several pieces of work run at once.
Separately, you can run several full sessions side by side, each on its own copy of the project so they do not overwrite each other. Past two or three, the hard part is no longer starting them. It is keeping track of what each is doing and which ones are waiting for you. That is the problem our HOPE console addresses, and the Decomposition module teaches how to split work so sessions do not collide.
Harness, chatbot, autocomplete
People mix these up. They are different tools with different risks.
| Autocomplete | Chatbot | Harness | |
|---|---|---|---|
| What it does | Suggests the next few words or lines as you type | Answers questions and drafts text in a conversation | Carries out multi-step work using tools |
| Who acts | You accept or ignore each suggestion | You copy its output where it belongs | It acts; you brief, approve and check |
| Sees your files | The open file, nearby code | Only what you paste in | The project, by searching and reading |
| Checks its work | No | No | Can run tests and read the result |
| Main risk | A bad line you accepted | A wrong answer you believed | A wrong action taken at scale |
The lines blur. Many chat apps now offer a code-running or browsing feature, and many editors mix autocomplete, chat and an agent in one window. The test is simple: when you give it a task, can it take several steps on its own, using tools, without you carrying results back and forth? If yes, a harness is at work.
The main kinds
The loop is the same everywhere. What differs is where the harness runs and how you reach it.
Terminal harnesses
Programs you start in a terminal inside your project folder. They are the most direct: full access to the shell, easy to script, easy to run on a remote machine. They suit developers, and anyone willing to learn a few commands. Examples: Claude Code, Codex CLI, Aider, opencode, Hermes Agent.
IDE agents
Agents inside a code editor, or editors built around an agent. You see diffs next to your code and accept or reject them as you go. Easier to start with if you already live in an editor. Examples: Cursor, Windsurf, GitHub Copilot's agent mode, and extensions such as Cline.
Cloud and background agents
The agent runs on the provider's machines, not yours. You hand it a task, often a repository and a description, and it works while you do something else, then returns a pull request or a report. Good for jobs that run long or in parallel; the trade-off is that your code and prompts go to someone else's computer. Examples: Devin, Jules, GitHub Copilot's cloud agent, Codex cloud.
Open frameworks you self-host
Open-source harnesses you run yourself, with the model of your choice, including local models. You get control and no vendor lock-in, and you take on setup and upkeep. Examples: OpenHands, goose, Hermes Agent, Pi. Some of these also run on a server and answer you through chat apps, so the agent is always on.
Many products span kinds: the same engine behind a terminal tool may also power a desktop app and a cloud mode. The comparison page lists popular ones in each group, with licences and pricing models as their makers published them.
What a harness is good at
- Work that can be checked. Fix a failing test, add a field, move code to a new library, write a migration. A test or a build says whether it worked.
- Reading much, fast. Finding where something is defined, tracing a bug through twenty files, summarising an unfamiliar codebase.
- Tedious, repeated change. Renames, formatting, boilerplate, updating many files the same way.
- First drafts of whole things. A page, a script, a small tool, a document, from a clear brief.
- Several jobs at once. Different sessions on different tasks while you review the finished ones.
- Routine on a schedule. Triage, reports, checks that run overnight.
Where it fails
Know these before you hand over anything that matters.
- It does what you said, not what you meant. A vague brief gets a confident, plausible, wrong result. Most failures start in the request.
- It can claim success that did not happen. "All tests pass" must come with the test output. Ask for evidence, and read it.
- Context drift. Long sessions forget earlier rules after compaction, repeat mistakes, or contradict themselves.
- Silent scope creep. It may change files you did not mention, or delete a test to make a build pass. Review the diff, not only the summary.
- Irreversible actions. Deleting data, sending messages, pushing to production, spending money. Anything that cannot be undone must sit behind an approval or a hook.
- Secrets and untrusted text. A harness reads files and web pages, and text in them can try to steer it. Keep secrets out of reach and treat fetched content as data, not as orders.
- Cost and runaway loops. A long autonomous run can use a great deal of paid usage. Set limits, and watch the first runs.
- Judgement. It does not know your customer, your politics or what you would regret. Decisions that need taste or accountability stay with a person.
Why the person running it matters
Two people can use the same harness and the same model and get very different results. One writes a clear brief with a definition of done, gives the agent the right files and rules, splits the work, asks for evidence, steps in at the right moment, and sets guardrails. The other types a wish and accepts whatever comes back.
That difference is the skill of operating a harness. It is not the same as writing code, and it is not the same as writing clever prompts. It is closer to managing a very fast, very literal colleague who never gets tired and never pushes back. What operating a harness means explains it, and why it is worth learning whatever your job is. Companies that run harnesses at scale will want someone accountable for the result, which is what the operator profession is about.
Quick questions
Do I need to be a programmer?
For a terminal harness it helps to be comfortable with a terminal and with the idea of a project folder. For non-code work, or with a harness that has a desktop app, much less. You do need to be able to check the result. If you cannot tell whether it is right, the harness cannot help you with that.
Is a harness the same as an AI agent?
Nearly. "Agent" often means the model-plus-loop behaving autonomously; "harness" names the program around the model that makes that possible and controls it. When you read about an agent that can use a computer, a harness is doing the work behind it.
Does the harness or the model matter more?
Both, and in different ways. A stronger model plans and recovers better. A better harness gives it better context, safer tools and cleaner feedback. The same model can feel very different in two harnesses.
Is it safe to run on my own computer?
It can be, with care. Start in a folder under version control, keep approvals on, keep secrets out of the project, and only loosen permissions inside a sandbox or a disposable branch. Safety here is mostly a matter of setup, which is what the Guardrails module covers.
Which one should I start with?
Whichever fits where you already work, and whose pricing you understand. See popular harnesses, then follow getting started.
Sources
Facts about specific products on this page come from the makers' own documentation. The rest describes how harnesses work in general.
- Claude Code overview, Anthropic docs: describes MCP as an open standard for connecting AI tools to external data sources.
- Claude Code overview, Anthropic docs: CLAUDE.md, reading AGENTS.md, hooks, subagents, skills.