What is an agent harness?
A harness is the part of an agent that is not the model. A model takes text in and sends text out. It cannot run a command, open a file or remember yesterday. The harness does all of that: it calls the model in a loop, runs the tools the model asks for, decides what goes into the context window, saves state and checks the result.
The cleanest version of the definition comes from LangChain. In The Anatomy of an Agent Harness (March 10, 2026), Vivek Trivedy writes: "Agent = Model + Harness. If you're not the model, you're the harness." He defines a harness as "every piece of code, configuration, and execution logic that isn't the model itself."
Anthropic uses the word the same way. The Claude Code docs, in How Claude Code works, say Claude Code "is the layer around the model that provides the tools and manages the context the model sees. This surrounding layer is what the term agentic harness refers to." Anthropic's engineering blog calls the Claude Agent SDK "a powerful, general-purpose agent harness."
The term is young. When Harrison Chase of LangChain sorted its open source packages into frameworks, runtimes and harnesses on October 25, 2025, he wrote that "Agent Harness" was "a term I'm just starting to see be used more (I didn't come up with it)."
What does an agent harness include?
Trivedy lists five groups of parts, and Claude Code ships a version of each. The first column is his list. The last column shows where each part lives in Claude Code, per Anthropic's docs as of November 10, 2026.
| Harness part | What it does | In Claude Code |
|---|---|---|
| System prompts | Tell the model who it is and how to work | The built-in system prompt, plus your CLAUDE.md files |
| Tools, skills and MCP servers | Let the model act: read, edit, run, search, call other systems | Built-in tools, skills, and any MCP server you add |
| Bundled infrastructure | A filesystem, a sandbox and a browser to work in | Your project folder and shell, with permission modes on top |
| Orchestration logic | Starts helpers, hands work off, routes to other models | Subagents and agent teams |
| Hooks and middleware | Steps that always run, such as compaction, continuation and lint checks | Hooks, and automatic compaction near the context limit |
Trivedy also explains why the filesystem keeps coming up. Models can't keep "durable state across interactions" on their own, so harnesses give them files. In his words, the filesystem is "a natural collaboration surface. Multiple agents and humans can coordinate through shared files." That point returns in the board section below.
Agent harness vs framework vs runtime: what is the difference?
A framework helps you build an agent, a runtime keeps it running in production, and a harness comes ready to work. This is Chase's split, with his own examples:
| Layer | What it gives you | Examples Chase names |
|---|---|---|
| Framework | Abstractions: a standard agent loop, content blocks, middleware | LangChain, Vercel's AI SDK, CrewAI, OpenAI Agents SDK, Google ADK, LlamaIndex |
| Runtime | Durable execution, streaming, human-in-the-loop support, persistence | LangGraph, Temporal, Inngest |
| Harness | "Batteries included": default prompts, opinionated tool handling, planning tools, a filesystem | DeepAgents, Claude Agent SDK, and arguably every coding CLI |
He is open that "the lines are blurry" (LangGraph is both a runtime and a framework, he says). Use the table as a map, not a standard. A simple test: if you could hand it a task today and it would start working, it is a harness. If you would first have to write the loop, it is a framework.
What does a harness keep between sessions?
A long-running harness keeps a task list, a progress log and the code history, because every new session starts with an empty context. The Claude Code docs say: "Each new session starts with a fresh context window, without the conversation history from previous sessions." So anything the next session needs has to be written somewhere.
Anthropic's Effective harnesses for long-running agents (Justin Young, November 26, 2025) is the clearest worked example. It compares the problem to "engineers working in shifts, where each new engineer arrives with no memory of what happened on the previous shift." The harness has two prompts:
- An initializer agent runs once. It writes an
init.shscript that starts the dev server, aclaude-progress.txtfile "that keeps a log of what agents have done", an initial git commit, and a feature list. For their claude.ai clone the list had over 200 features, all marked as failing. - A coding agent runs in every later session. It reads the progress file and the git log, runs a basic end-to-end test, picks the highest-priority feature that isn't done, works on that one feature, then commits and updates the progress file.
Two details are worth copying. The feature list is JSON, because "the model is less likely to inappropriately change or overwrite JSON files compared to Markdown files", and agents may only change each feature's passes field. And the harness exists to stop two failures the team saw: an agent that tries to build everything at once, and a later agent that "would look around, see that progress had been made, and declare the job done."
What is harness engineering?
Harness engineering is improving the system around the model, one repeated mistake at a time. Trivedy calls it "how we build systems around models to turn them into work engines." Three ideas from people who do it:
- Guides and sensors. Birgitta Böckeler's Harness engineering for coding agent users (Thoughtworks, April 2, 2026) splits your outer harness into guides that steer the agent before it acts, like AGENTS.md and skills, and sensors that let it self-correct after, like tests, linters and AI code review. Your job is the loop: "Whenever an issue happens multiple times, the feedforward and feedback controls should be improved."
- Separate the worker from the judge. In Harness design for long-running application development (March 24, 2026), Prithvi Rajasekaran found agents grading their own work "reliably skew positive", so he added a separate evaluator agent. The planner, generator and evaluator talked through files. On his retro game maker test, the full harness cost $200 and took 6 hours, against $9 and 20 minutes for a single agent. That is "over 20x more expensive, but the difference in output quality was immediately apparent." How to set up and check that kind of judge is in our guide to LLM as a judge.
- Remove parts as models improve. The same post says "every component in a harness encodes an assumption about what the model can't do on its own", and those assumptions "can quickly go stale as models improve." When Opus 4.6 came out, he removed the sprint structure the first version needed.
Böckeler adds: "A good harness should not necessarily aim to fully eliminate human input, but to direct it to where our input is most important."
Where does a task board fit in an agent harness?
A board can hold the harness state that people need to see: the task list, the progress notes and the review step. In Anthropic's examples that state lives in files inside one repository, read by one agent loop. That works until a person needs to know what the agent did overnight, re-order the work, or check a result before it ships. Then the same three things are more useful on a board your agents and team share:
| Harness state in files | Same state on a Flux board |
|---|---|
| Feature list, one entry per feature | One card per feature in a Ready column, in priority order |
"passes": false with test steps | The steps written in the card description |
claude-progress.txt | A signed comment on the card at the end of each session |
"passes": true | The card moves to Needs review, and a person moves it to Done |
| Git history | Stays in git; put the card ID in each commit message |
Here is the example feature from Anthropic's post, rewritten as a card. The title is "New chat button creates a fresh conversation" and the description holds the steps:
Steps to check: 1. Open the main screen. 2. Click New Chat. 3. A new conversation opens with the welcome screen. 4. The conversation appears in the sidebar. Done when: all four steps pass in a real browser, not only in unit tests.
And here is their session-start routine, rewritten for the Flux MCP server. Put it in the agent's instruction file (CLAUDE.md or AGENTS.md). Flux's MCP server sends no instructions of its own, so the routine has to live there:
## Flux board: start of every session 1. Call get_board with board ID <your board's short ID>. Note the column IDs of Ready, In Progress and Needs review. 2. If a card is in In Progress, the last session left it unfinished. Call get_card on it and read every comment before you do anything. 3. Otherwise take the first card in Ready, call get_card, and move_card it to In Progress. 4. Run the smoke test in init.sh before you change any code. ## End of every session 5. Commit, and put the card's ID (like PROJ-42) in the message. 6. add_comment, starting with "[coder]": what changed, what you tested and how, and what is left. 7. Move the card to Needs review only if every step in its description passed. Never move a card to Done.
This routine assumes one agent working one board. We checked each step against Flux's code on November 10, 2026. Five things to know before you rely on it:
- "Never move a card to Done" is a rule, not a lock. Flux doesn't enforce column order. Any API key with the Write scope, owned by someone with the Member role or higher, can move a card to any column on the board. Anthropic hit the same limit with its feature file, which is why it used JSON and "strongly-worded instructions." A board doesn't make the rule enforceable, but it does make a broken rule easy to spot.
- Sign every comment. Comments posted with an API key show under the name of the person who made the key, and
get_cardreturns comments oldest first without author names. The[coder]prefix tells the next session and your team who wrote what. - Put the steps in the description.
get_cardreturns the card and its comments, but not checklist items or labels. - Use the UUID for writes.
get_boardlists each card's UUID and its PROJ-42 style ID. Pass the UUID toget_card,move_cardandadd_comment; a PROJ-42 ID doesn't work reliably inget_cardtoday. A card moved withmove_cardgoes to the bottom of its new column. - MCP changes are not in the activity log yet. Changes made in the app, through the REST API and by the AI assistant are logged; changes over MCP are not. Until they are, the signed comment and the commit are the record of what the agent did.
If you would rather run the loop from a script than from one long session, our Ralph loop guide covers a fresh session per card. For what each board tool costs in context, see context engineering for AI agents.