Ugrás a fő tartalomhoz

Agent Harnesses: Claude Code, OpenCode, T3 Code, Codex

Basic

Applies to: every engineer starting on a client engagement · Time to learn: 30 min reading + 15 min exercise · Lever: context, feedback, and guardrails (the harness carries all three)

The model is only part of what you use. The program around it, the harness, decides which tools the model can call, how permissions work, and how context is managed. This page compares the main harnesses (as of 2026-10), explains OpenCode and T3 Code, and shows how to set up a repo so you can switch harness without rewriting anything.

TL;DR
  • A harness is model + tools + loop + permissions + context management. Two harnesses with the same model can behave very differently.
  • T3 Code is not a harness itself: it is a GUI that runs harnesses such as Claude Code and Codex.
  • Stay harness-agnostic: AGENTS.md as the source of truth, skills in the open SKILL.md format, MCP servers configured per tool.
  • On a client engagement, start from constraints: data residency, approved providers, and whether local models are required. OpenCode can use local models.
  • For scripts and CI, use the headless mode of your harness (claude -p, opencode run).

Why it matters in the AI age​

Clients differ. One approves only a single cloud provider, another requires models inside its own network, a third has no policy yet. If your team knowledge lives in one tool's private format, you start over each time. If it lives in open formats (AGENTS.md, SKILL.md, MCP), you carry it from client to client and from tool to tool.

Core concepts​

What a harness is​

PartWhat it doesExample
ModelDecides the next stepClaude, GPT, a local model
ToolsRead and edit files, run commands, call MCP serversBash, Edit, MCP tools
LoopCalls the model, runs the tools, feeds results backUntil done or you stop it
PermissionsDecide what runs without askingClaude Code: allow, ask, deny rules
Context managementLoads instructions, compacts or clears history/clear, /compact, subagents

Anthropic's harness-design post makes the key point: every harness component encodes an assumption about what the model cannot do alone, so harnesses change as models improve.

Comparison (as of 2026-10)​

HarnessWhat it isLicenseProvidersProject instructionsInstall
Claude CodeTerminal CLI, IDE extensions, desktop app, web; one engine for allProprietaryAnthropic models (see the docs for cloud routes)CLAUDE.md; reads AGENTS.md when no CLAUDE.md exists; @AGENTS.md import works everywherecurl -fsSL https://claude.ai/install.sh | bash
OpenCodeOpen-source terminal agent, with desktop app (beta) and IDE extensionMIT75+ providers, custom OpenAI-compatible endpoints, local modelsAGENTS.md; falls back to CLAUDE.mdsee below
Codex CLIOpenAI's open-source terminal agentApache-2.0OpenAIAGENTS.md, discovered from the repo root down to the current directorynpm install -g @openai/codex
T3 CodeGUI that runs other harnessesMITWhatever the installed harness usesWhatever the harness usessee below

One-liners for other tools you will meet:

  • Cursor (editor and CLI agent): terminal agent with interactive and print modes and Agent, Plan, and Ask modes; reads AGENTS.md in the root and subdirectories.
  • GitHub Copilot cloud agent: runs in an ephemeral cloud environment, works in the background, creates branches and pull requests; reads AGENTS.md, CLAUDE.md, and GEMINI.md.
  • Gemini CLI: open-source terminal agent for Gemini models (Apache-2.0); reads GEMINI.md by default and reads AGENTS.md only if you list it under context.fileName in its settings.

OpenCode​

OpenCode is an open-source (MIT) coding agent for the terminal with a desktop app (beta) and an IDE extension. Repo: anomalyco/opencode.

TopicDetail
ProvidersThe docs list "75+ LLM providers" including Anthropic, OpenAI, Amazon Bedrock, Google Vertex AI, GitHub Copilot, OpenRouter, and Ollama. Custom OpenAI-compatible providers are supported.
Configopencode.json or opencode.jsonc in the project root; global file at ~/.config/opencode/opencode.json; OPENCODE_CONFIG sets a custom path
Agentsbuild (default, full access), plan (read-only, asks before bash), general (subagent, call with @general); switch with Tab
InstructionsAGENTS.md at the project root or ~/.config/opencode/AGENTS.md; /init creates it; an instructions array accepts paths and globs
Claude Code fallbackReads CLAUDE.md when no AGENTS.md exists; disable with OPENCODE_DISABLE_CLAUDE_CODE=1
MCPConfigured under the mcp key, local or remote
Pluginsplugin option (npm packages) or files in .opencode/plugins/
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-5",
"instructions": ["AGENTS.md"]
}

To use a local or self-hosted model, run /connect, choose "Other", then add a provider entry with options.baseURL and models in opencode.json, and check it with /models. This is what makes OpenCode the usual choice when a client requires models inside its own network (see the Agentic AI Platforms page for serving options).

T3 Code​

T3 Code (repo: https://github.com/pingdotgg/t3code) is, in the repo's words, "the open-source control plane for coding agents." It does not replace Claude Code or Codex. It is a GUI that runs them on your machine, so install and sign in to each harness first. Available as a web app, desktop app, and mobile apps. License: MIT.

CapabilityWhat it gives you
ThreadsEach thread can be bound to its own git worktree and branch, so parallel tasks do not collide
DelegationAn agent in a thread can delegate child tasks to other providers and models and track them
Pull requestsLinks and watches pull requests from a thread
SchedulingSchedules recurring or webhook-triggered agent tasks
PreviewsRenders HTML previews and can drive a browser preview
Early-stage software

The T3 Code README says the project is "very very early" and to "expect bugs." Use it for non-critical work first, and keep your repo setup independent of it (the next section shows how).

How to do it​

1. Make AGENTS.md the source of truth​

AGENTS.md is an open format stewarded by the Agentic AI Foundation under the Linux Foundation; the agents.md site lists Codex, OpenCode, Cursor, Copilot, and many others as supporters. Details of what goes in it are on AGENTS.md, CLAUDE.md, and Rules.

For Claude Code, add a CLAUDE.md that imports it:

CLAUDE.md
@AGENTS.md

## Claude Code
- Use plan mode for changes that touch more than one module.

A symlink (ln -s AGENTS.md CLAUDE.md) also works, but the Claude Code docs note that Edit and Write refuse to write through it and Windows checkouts can break it. Prefer the import.

Claude Code reads AGENTS.md natively only when no CLAUDE.md exists in the working directory or above, and only CLAUDE.md is read if one exists. Do not rely on native reading in a repo that already has a CLAUDE.md.

2. Write skills in the open format​

A skill is a folder with a SKILL.md that has YAML frontmatter with name and description. Claude Code reads .claude/skills/<name>/SKILL.md; Codex reads .agents/skills. Keep one source and link it into each location. See Skills and Skill Creation.

one skill source, two harness locations
mkdir -p .agents/skills .claude/skills
ln -s ../../.agents/skills/release-notes .claude/skills/release-notes

3. Configure MCP per tool​

MCP is an open protocol, but each harness has its own config file. Keep one short list of servers in AGENTS.md and translate it.

HarnessWhere MCP servers are configured
Claude Code.mcp.json (project, shared), ~/.claude.json (local and user scopes)
OpenCodemcp key in opencode.json
Codex~/.codex/config.toml (check the Codex docs for the MCP table syntax)

Which servers to add, and how many, is covered in MCP Servers.

4. Install​

Claude Code (native installer)
curl -fsSL https://claude.ai/install.sh | bash
# or: brew install --cask claude-code
OpenCode
curl -fsSL https://opencode.ai/v2/install | bash
# or: brew install opencode, or: mise use -g opencode
Codex CLI
npm install -g @openai/codex
# or: brew install --cask codex
T3 Code (needs at least one harness installed and signed in)
curl -fsSL https://t3.codes/install.sh | sh # macOS and Linux
npx t3@latest # try without installing
t3 # start the server and open the web app

Sign in with claude auth login, codex login, or opencode auth. OpenCode's docs mention both an OpenCode 1 and an OpenCode 2 install path and warn that mixing them can conflict, so use one method per machine.

5. Headless and CI mode​

HarnessCommandNotes
Claude Codeclaude -p "..."Works with pipes: tail -200 app.log | claude -p "explain the errors". The Agent SDK is the programmatic route.
OpenCodeopencode run "..."--format json returns raw events; --model provider/model; --auto auto-approves permissions not explicitly denied. opencode serve plus --attach avoids MCP cold-start on each run.
Codexsee the Codex documentationNon-interactive usage was not verified for this page

In CI, give a headless agent the same guardrails as a human: a read-only or tightly scoped permission set, no production credentials, and the repo's normal gates after it finishes. See Hooks, Pre-commit, and Quality Gates.

6. Choose a harness for an engagement​

Question to ask the clientIf the answer is...Then
Which model providers are approved?One cloud provider (for example Bedrock or Vertex AI)Pick a harness that supports it: Claude Code and OpenCode both list these providers; confirm in current docs
Where may code and prompts go?Must stay inside the networkOpenCode with a local or self-hosted OpenAI-compatible endpoint
Is a managed policy needed?Yes, for permissions and settingsClaude Code supports managed settings that take precedence over user and project settings
Can we install tools on laptops?NoUse the client's approved IDE or the cloud agent they already license
Are several agents in parallel useful?YesA GUI such as T3 Code, or git worktrees in any harness (see Execution Plans)

Ask these questions in the first week and record the answers in the repo's AGENTS.md or a short decision note.

Best practices​

  • Put commands, conventions, and gotchas in AGENTS.md and keep tool-specific settings in tool-specific files.
  • Commit shared settings (.claude/settings.json, .mcp.json, opencode.json); keep personal ones gitignored.
  • Use the same lint, test, and build commands in every harness; define them once in mise.toml tasks (see The Agent-Ready Toolchain).
  • Re-evaluate your harness choice every few months; this area moves quickly.

Pitfalls to design around​

  • Write instructions once. If you maintain AGENTS.md and a full copy in CLAUDE.md, they drift; import instead.
  • Check each harness's discovery rules. Claude Code skips AGENTS.md when a CLAUDE.md or CLAUDE.local.md is present; Codex stops adding instruction files at its size limit (32 KiB by default per its docs).
  • Treat third-party skills and MCP servers as code you install: read them first, and pin versions.
  • Install the CLI harness before asking a GUI such as T3 Code to use it; the GUI runs the harness, it does not replace it.

Try it​

Lab 15 minutes on a real repo

  1. Create or trim AGENTS.md to the build, test, and lint commands plus five conventions.
  2. Add CLAUDE.md containing @AGENTS.md.
  3. Start Claude Code and ask "What commands test this project?" Then start OpenCode in the same repo and ask the same question. Both should answer from AGENTS.md.
  4. Run one headless command in each: claude -p "list the test commands" and opencode run "list the test commands".
  5. Write down which harness fits your current client and why, using the table above.

Checklist​

  • AGENTS.md exists and is the single source of project instructions.
  • CLAUDE.md imports AGENTS.md (or the repo has no CLAUDE.md).
  • Skills live in one folder and are linked for each harness in use.
  • MCP servers are listed once and configured per tool, pinned and least-privilege.
  • I know the client's approved providers and data-residency rules.
  • A headless command works in my chosen harness.

Sources​