Get updates
Guide

Coding agent harness, explained

A harness is the program wrapped around a model: it runs the loop, offers tools, enforces permissions and loads your project rules. Same model, different harness or settings, different results.

Checked against official docs on Oct 18, 202620 sourcesNo affiliate links

Model, harness, framework

  • Model: predicts text and tool calls. Sonnet, GPT, Gemini, GLM, a local model.
  • Harness: a ready-to-run agent program around a model. It reads your files, calls tools, asks permission and loops until the task is done. Claude Code, Codex CLI, OpenCode, goose, Aider and Gemini CLI are harnesses.
  • Framework: a library for building your own agent, such as LangGraph or an agents SDK. You write the loop; a harness ships one.

The six parts of a rig

PartClaude CodeCodex CLIOpenCodegooseGemini CLI
Project rulesCLAUDE.md (or AGENTS.md)AGENTS.mdAGENTS.mdAGENTS.md, .goosehintsGEMINI.md
MCP toolsclaude mcp add, .mcp.jsoncodex mcp add, config.toml"mcp" in opencode.jsonextensions: in config.yamlmcpServers in settings.json
Permissionsallow/deny rules + permission modes--sandbox read-only / workspace-write"permission" allow/ask/deny——
Specialist agents.claude/agents/*.md subagents—agents (--agent)recipes—
Headless runclaude -pcodex execopencode rungoose rungemini -p
Machine output--output-format json--json (JSONL)--format jsonrecipe response schema--output-format json

"—" means we didn't verify an equivalent in the official docs on Oct 18, 2026, not that none exists.

How to choose one

  1. Start with the models you can use. Claude plan → Claude Code. ChatGPT plan → Codex (or OpenCode with ChatGPT sign-in). Local or mixed → OpenCode, goose or Aider.
  2. Then the job. Unattended CI wants clean headless flags; private files want a local model and tight permissions; long documents want reviewable changes.
  3. Then portability. Keep rules in AGENTS.md and you can switch harnesses without rewriting them. See AGENTS.md vs CLAUDE.md.

FAQ

What is a coding agent harness?

The program that runs a model as an agent: it loads project rules, offers tools such as file edits, shell and MCP servers, enforces permissions and loops until the task is done. Claude Code, Codex CLI and OpenCode are examples.

Is a harness the same as an agent framework?

No. A framework (LangGraph, an agents SDK) is a library you build an agent with. A harness is a finished agent you configure.

Does the harness change benchmark scores?

Leaderboards like Artificial Analysis score harness + model pairs. Within one harness, effort settings alone move Claude Code with Sonnet 5.5 from 42.1 to 68.4 on AA's index.

Sources

  1. Artificial Analysis: Coding Agent Index v1.5 · checked Oct 18, 2026
  2. Claude Code docs: CLAUDE.md, AGENTS.md and memory · checked Oct 18, 2026
  3. Claude Code docs: MCP · checked Oct 18, 2026
  4. Claude Code docs: permissions · checked Oct 18, 2026
  5. Claude Code docs: subagents · checked Oct 18, 2026
  6. Claude Code docs: run Claude Code programmatically · checked Oct 18, 2026
  7. Codex docs: AGENTS.md · checked Oct 18, 2026
  8. Codex docs: MCP · checked Oct 18, 2026
  9. Codex docs: non-interactive mode · checked Oct 18, 2026
  10. OpenCode 1 docs: rules · checked Oct 18, 2026
  11. OpenCode 1 docs: MCP servers · checked Oct 18, 2026
  12. OpenCode 1 docs: permissions · checked Oct 18, 2026
  13. OpenCode 1 docs: CLI · checked Oct 18, 2026
  14. goose docs: .goosehints and AGENTS.md · checked Oct 18, 2026
  15. goose docs: extensions (MCP) · checked Oct 18, 2026
  16. goose docs: CLI commands · checked Oct 18, 2026
  17. goose docs: recipe reference · checked Oct 18, 2026
  18. Gemini CLI docs: GEMINI.md · checked Oct 18, 2026
  19. Gemini CLI docs: MCP servers · checked Oct 18, 2026
  20. Gemini CLI docs: headless mode · checked Oct 18, 2026

Spotted something out of date? Email sternberg@mail.grokbot.com.

Related