What is an agent harness? Claude Code, Codex, Cursor, Grok

By

An agent harness is the program around a model: files, a shell, permissions, and the loop. How Claude Code defines it, and what Codex, Cursor and Grok document.

An agent harness is the program wrapped around a model so it can work in a repository. The model picks the next step. The harness is what can read a file, run a command, ask you first, and send the result back.

How to make AI harnesses talk less is the post that owns the practical half: the switches that cut preamble and tool noise in Claude Code, Codex, and Cursor. This entry is the short definition, and which of the four tools uses the word.

How an agent harness works

A model that only returns text is not acting on the repo. The harness gives it tools, runs the tool it chose, and puts the output where the model can see it on the next step. Permission checks sit in that wrapper. So does the decision about which instruction files to attach.

Claude Code’s glossary is the page that defines the word. The harness supplies file access, shell execution, permission gating, memory loading, and the loop that chains actions together. Claude Code is the harness. Claude is the model inside it.

What an agent harness does with one stepThe model chooses a file edit or a command. The harness checks permissions, runs that step, and sends the result back to the model.Model chooses a fileedit or a commandHarness checkspermissionsHarness runs thestepResult goes back tothe model

The same model in two harnesses gets different tools and different instructions. That is why a benchmark of the model alone is not a benchmark of the product. How AI models are measured says this, and so does the hands-on comparison in which model to use for coding.

Agent harnesses in each tool

Claude Code Codex Cursor Grok Build
Uses the word harness Yes. Claude Code is the harness, Claude is the model Not on the agent guide or the config reference Not on the agent page. The page lists instructions, tools, and a model The overview does not. Settings call Claude and Cursor config folders “harness directories” when Grok scans them
What it wraps around the model File access, shell, permission gating, memory, the loop A model, tools, and guardrails with human oversight System prompt and rules, tools, the model you pick A coding agent: TUI, grok -p, or ACP. The overview does not inventory the tools
A control that is the harness, not the model Permission mode, hooks, CLAUDE.md Approval mode, sandbox, AGENTS.md Run mode, rules Permission mode, sandbox, project rules

Claude Code

The glossary entry is “Agentic harness”. It lists the pieces: tools, context management, and the execution environment. Memory loading is part of that list. So is permission gating.

You change the harness when you change a permission mode, a hook, or an instruction file. You change the model when you pick a different Claude. The agent loop is the cycle inside the harness, not a second product. See the glossary.

OpenAI Codex

The agent guide does not use the word harness. It splits an agent into a model, tools, and guardrails with human oversight. Local commands run in a sandbox until you approve a step outside it. That sandbox and the approval policy are the wrapper.

AGENTS.md is the instruction file the wrapper loads. It is not the model. See Working with agents.

Cursor

The agent page does not use the word harness. It says an agent is three components: instructions (the system prompt and rules), tools, and the model you pick. Cursor tunes the instructions and tools for each model.

Tools listed there include search, web, rules, reading files, edits, the terminal, the browser, image generation, and questions. There is no limit on how many tool calls one task can make. The run mode decides which of those calls need you. See Cursor Agent.

Grok Build

The overview calls Grok Build a coding agent you run as a TUI, with grok -p, or through ACP in another app. It does not call that program a harness, and it does not list file and shell tools one by one.

The settings reference uses “harness directories” for a narrower thing. Under Claude and Cursor compatibility, Grok can scan those products’ skills, rules, agent definitions, MCP config, and hooks. The folders belong to Claude Code and Cursor. Grok is reading them. See Grok Build and the settings reference.

Details checked against each vendor’s documentation in November 2026.

A real example

One task, and the part of it that is the harness rather than the model:

The RSS feed keeps 30 items. Change the limit in src/pages/rss.xml.ts to 20. Run npm run build. Do not edit any other feed field.

The model decides to open src/pages/rss.xml.ts and then to run npm run build. The harness is what opens the file, applies the edit, and runs the command, after the permission check your mode requires. Swap the model and that wrapper stays. Swap the tool, from Claude Code to Codex to Cursor to Grok Build, and the permission prompt and the sandbox change with it.

How to make AI harnesses talk less is the same split applied to output. The model writes the preamble. The harness decides whether you see the reasoning summary and the tool log.

When to use the word

Use it when you are talking about the program, not the model. “The harness blocked the command” is a permission or sandbox fact. “The model refused” is the text it generated. Those have different fixes.

Use the product name when you are telling someone what to install. Claude Code’s docs are the ones that need the word, because they use it. Codex, Cursor, and Grok Build describe the same wrapper with “agent”, “tools”, and “permissions”.

Skip it when you mean a coding agent as a whole product. The harness is the wrapper. The agent is the wrapper plus the model plus the session you are in.

Pitfalls

A model comparison that ignores the harness measures a mixture. The posts on benchmarks and on picking a coding model both treat the tools and the system prompt as part of the result. Changing Cursor’s model picker does not turn Cursor into Claude Code.

Grok’s “harness directories” setting sounds like a mode switch. It is a scanner for Claude and Cursor config folders. Turning GROK_CLAUDE_SKILLS_ENABLED off stops that scan. It does not turn off Grok.

Codex’s guide never says the sandbox is a harness. If you are writing config, use the keys the reference lists. Do not invent a harness table because Claude Code has the word.

  • Coding agent: A coding agent uses a model and tools to read a repo, edit files and run commands in a loop. How Claude Code, Codex, Cursor and Grok Build each do that job.
  • Agentic coding: Agentic coding means directing an agent that reads your repo, edits files and runs commands. How that loop works in Claude Code, Codex, Cursor and Grok Build.
  • Permission modes: Permission modes decide what a coding agent can do without asking. The modes in Claude Code, Codex, Cursor and Grok Build, and what YOLO mode really skips.
  • Agent loop: The agent loop is the cycle a coding agent repeats: look, act, check, and go again. How Claude Code names that cycle, and what the other tools document.

All AI glossary entries →

Want me to talk about your product? You can sponsor this site.