AI Harnesses

AI Harnesses

The best AI harness for coding in 2026: 9 harnesses compared

Claude Code, Codex CLI, Cursor, Aider, OpenCode and more compared. The best AI harness per situation, also with a local model or a subscription you already have.

AI LLM AI Agents Harness Claude Code Codex Cursor Open Source

Lots of names, little overview

A new coding agent or agent framework appears every month. If you are looking for a harness, the names hide the differences.

Sort by what you want to control

There are three kinds of harness: ready-made tools, open-source harnesses you set up yourself, and SDKs you build one with. The choice follows from how much of the harness you want in your own hands.

A choice that fits the task

Once you know which kind you need, you compare three or four options and pick on what matters: the model, the control, and where your data goes.

The short answer

The best AI harness for coding is Claude Code or Codex CLI if you work in the terminal, and Cursor if you work in an editor. If you want to pick the model yourself, take an open-source harness such as Aider, Cline, or OpenCode. And if you are building an agent for something other than code, you start from an SDK such as the Claude Agent SDK, the OpenAI Agents SDK, LangGraph, or Pydantic AI.

A harness is the software around a language model that turns it into a working agent: the loop, the tools, the context management, and the limits. How that works is covered in what is an AI harness. This piece answers the question that comes next: which harnesses exist, and which one fits you?

The best AI harness per situation

No harness wins every task. Per situation, the pick is clear.

⚡

You write code in the terminal

Take Claude Code or Codex CLI. Both are strong at tasks that touch many files, and both read an instruction file from your repo. The gap between the two is smaller than the gap a good instruction file makes.

🖱️

You prefer working in an editor

Take Cursor. You see every change as it lands and pick a model from several providers per task. If you work in VS Code and don't want a new editor, Cline is the open-source alternative.

🔓

You want to pick the model yourself, or keep everything local

Take Aider, Cline, or OpenCode. You decide which model runs and where your data goes, local models included.

🧱

Your task is not code

An agent for customer questions, quotes, or your own systems is built on an SDK. Take the Claude Agent SDK or the OpenAI Agents SDK for a quick start, LangGraph if you want every step pinned down.

💳

You already pay for ChatGPT, Claude, Gemini, or Copilot

Start with the harness that comes with your subscription. Claude Code is part of Claude Pro and Max, Codex CLI of ChatGPT Plus and up, Copilot CLI of GitHub Copilot. Antigravity CLI, the successor to Gemini CLI, comes with Google AI Pro and also works, within limits, for free with a Google account. You pay nothing extra and test on your own code right away.

🧭

You don't know yet

Start with Claude Code or Cursor on a real task from your own work. You learn quickly where it gets in your way, and only then do you know what your own harness needs to do.

Picked one? Make it work in your codebase

Every harness only pays off with instructions, tests, and limits that fit your own code. That is called harness engineering, and it makes a bigger difference than the choice between two tools. Need an agent for something other than code? We build those.

All 9 harnesses in one table

All nine from this article side by side: where you work with it, which model runs inside, whether the code is open, and what you pay. Prices and plans change often, so check the current price with the maker.

Harness Works in Model Open source Cost
Claude Code (Anthropic) Terminal, editor, and desktop app Claude, local via Ollama No Included in Claude Pro and Max, or pay per token through the API
Codex CLI (OpenAI) Terminal and editor OpenAI models, local via Ollama or LM Studio Yes Included in ChatGPT Plus and up, or through the API
Gemini CLI (Google) Terminal Gemini Yes Through Gemini Code Assist or the API. With a Google account, now through its successor Antigravity CLI
Cursor (Anysphere) Its own editor Models from several providers No Its own subscription, with a free tier
GitHub Copilot (GitHub) Your editor, the terminal, and GitHub itself Models from several providers Partly: the chat in VS Code Copilot subscription, with a free tier
Aider Terminal Almost any model, local included Yes Free, you only pay for the model
OpenHands A web interface, with the agent in a container Any model, local included Yes Free to run yourself, or as a cloud service
Cline VS Code Any model through your own API key, local included Yes Free, you only pay for the model
OpenCode Terminal Models from many providers, local included Yes Free, you only pay for the model

Three kinds of harness

The list of names gets manageable once you sort it by one question: how much of the harness do you run yourself?

1

Ready-made harnesses

You install them and start. The maker handles the loop, the tools, and the limits. You mostly handle the instructions and the permissions.

2

Open-source harnesses

Also ready to use, and the code is open. You pick the model, run them where you like, and can change them.

3

SDKs to build your own harness

Building blocks you write a harness with, using your own tools and limits, for a task no standard tool covers.

Ready-made coding harnesses

These are the harnesses most developers already use. They are built for one job, writing software, and they are good at it. How Claude Code works and how a team uses it is in what is Claude Code. Codex and Cursor each have their own explainer: what is Codex and what is Cursor. Gemini CLI and the move to Antigravity CLI are in what is Gemini CLI. What these tools share, an agent that plans, writes code and tests on its own, is covered in what is agentic coding.

🟠

Claude Code

Anthropic's coding agent, built around the Claude models. Runs in the terminal, in your editor, and in the desktop app. Reads a CLAUDE.md file in your repo for your conventions and asks for permission before it does anything risky. Strong at long tasks that touch many files.

⚫

Codex CLI

OpenAI's coding agent for the terminal, built around OpenAI's models. The code is open source. Reads instructions from an AGENTS.md file, a format that many other tools now read too.

🔵

Gemini CLI

Google's open-source terminal agent, built around the Gemini models. Handy if your team already works in Google Cloud. If you work with a personal Google account, you have used its successor Antigravity CLI since June 2026.

🖱️

Cursor

A code editor with an agent built in. You pick a model from several providers per task. A good fit if you prefer an editor over the terminal and want to see every change as it lands.

GitHub Copilot belongs on the same list: next to completions in your editor, it has an agent mode and an agent that works on an issue by itself and opens a pull request.

Open-source harnesses

Open source matters for two reasons. You are not tied to one model maker, and you can see and change what the harness does. The second one counts as soon as you want to know why an agent did something.

🧑‍💻

Aider

One of the first coding harnesses for the terminal. Works with almost any model and records every change as a git commit, so you can roll back any step.

🙌

OpenHands

Formerly OpenDevin. Runs the agent in an isolated container and comes with a web interface. A fit when you want agents to work on tasks on their own, away from your own machine.

🧩

Cline

A VS Code extension that puts every step in front of you: I want to change this file, I want to run this command. You bring your own API key, so you pick the model.

⌨️

OpenCode

A terminal agent that works with models from many providers, including local models. For anyone who wants the Claude Code or Codex way of working without being tied to one provider.

How OpenCode works, which models run on it and what it costs is in what is OpenCode.

An AI harness with a local model

A local model runs on your own computer, usually through Ollama or LM Studio. Your code never leaves your machine and you don’t pay per token. The harness then talks to that model instead of an API in the cloud. Most well-known harnesses can do that by now:

  • Claude Code: works with Ollama since Ollama started mimicking Anthropic’s API. Point ANTHROPIC_BASE_URL at your Ollama server and pick the model with --model, or start everything in one go with ollama launch claude.
  • Codex CLI: codex --oss starts Codex with a local model through Ollama or LM Studio. OpenAI’s open model, gpt-oss-20b, runs on a machine with 16 GB of memory.
  • OpenCode: finds the models on a local Ollama server by itself, and also connects to any local server that speaks OpenAI’s API.
  • Aider: works with Ollama through --model ollama_chat/<model>. Set the context window high yourself, or context silently drops out.
  • Cline: pick Ollama or LM Studio as the provider. The Use Compact Prompt option makes the instructions much shorter, so a small model keeps track.

Which model you can run depends on your memory. With 16 GB, a small coding model such as gpt-oss-20b or Devstral fits. With 24 to 32 GB, you run a mid-sized model such as Qwen3-Coder 30B. The larger open models need 64 GB or more.

Watch the context window above all. Ollama starts with a small window by default, while a coding agent needs at least 32K and preferably 64K. If the window is too small, the agent forgets halfway through what it was doing, or tool calls fail without an error.

Expect less from a local model than from a large model in the cloud. Well-scoped tasks go fine, long tasks across many files get stuck sooner. The model and the context window make more of a difference here than the harness. If you want to start, take OpenCode or Aider: both were built from the start for models from any provider.

SDKs to build your own harness

A coding agent is a harness for one kind of work. If you want an agent that prepares quotes, handles tickets, or pulls data from your own systems, you build a harness for that task. For that you use an SDK that handles the groundwork, such as the loop.

🟠

Claude Agent SDK

The harness under Claude Code, available as a building block for Python and TypeScript. You get the loop, the context management, and the built-in tools, and you add your own tools and permissions.

⚫

OpenAI Agents SDK

A lightweight SDK from OpenAI for Python and TypeScript. Builds agents that hand tasks to each other, with guardrails that check input and output and tracing to see what happened.

🕸️

LangGraph

From the team behind LangChain. You describe the agent as a graph of steps with a shared state. Strong when you want to decide exactly which step follows which, and when a task must be able to pause until a person signs off.

🐍

Pydantic AI

A Python framework from the makers of Pydantic. Puts typed input and output first, so your code knows what an agent returns. Works with models from several providers.

An SDK gives you the loop. The rest is still your work: which tools the agent gets, what it may not do, how you catch errors, and how you see what it does. What that looks like is in building an AI agent.

The three kinds side by side

Ready-made Open source SDK
Examples Claude Code, Codex CLI, Gemini CLI, Cursor Aider, OpenHands, Cline, OpenCode Claude Agent SDK, OpenAI Agents SDK, LangGraph, Pydantic AI
Built for Writing software, from day one Writing software, with your own model Any task you define yourself
Model Usually the maker's own Your choice, local models too Your choice, sometimes with a preference
What you handle Instructions and permissions Instructions, permissions, model, and hosting Tools, limits, error handling, and monitoring
Skip it when Your task is not code You have no time to set it up An existing harness already does the job

Same model, different harness

Cursor, Cline, and OpenCode can all run a Claude model. They still behave differently: one reads more files before it starts, another asks for permission more often, a third keeps the conversation shorter to stay inside the context window. That difference lives in the harness.

That is why a model comparison tells you little about how a tool performs in your codebase. Try two harnesses on the same real task from your own work. And keep your instructions in a file in the repo, so they come along when you switch. How to pick the model and the harness together for vibe coding is covered in the best AI for vibe coding. Which harness suits Gemini, GPT, or Claude best is in the best AI harness for each model.

The model decides what an agent can do. The harness decides how much of that ends up in your codebase.

Whichever you pick, a harness only works well once you set it up for your own codebase, with instructions, tests, and limits. That work is called harness engineering.

Conclusion: pick the kind first, then the name

New harnesses appear every month and the existing ones change fast. The three kinds stay. Decide first how much of the harness you want to run yourself, then compare the few options of that kind on a real task.

Frequently Asked Questions

What are the most popular AI harnesses?

The best-known ones are coding agents: Claude Code from Anthropic, Codex CLI from OpenAI, Gemini CLI from Google, Cursor, and GitHub Copilot. Well-known open-source harnesses are Aider, OpenHands, Cline, and OpenCode. To build their own harness, many teams use the Claude Agent SDK, the OpenAI Agents SDK, LangGraph, or Pydantic AI.

Is Claude Code a harness?

Yes. Claude Code is a harness around Anthropic's Claude models. The model predicts text; Claude Code runs the loop around it, gives the model tools to read and change files and run commands, manages the context, and asks for permission before risky actions. The same harness is available as the Claude Agent SDK to build with yourself.

Which AI harnesses are open source?

OpenAI's Codex CLI and Google's Gemini CLI are open source. Aider, OpenHands, Cline, and OpenCode are open-source harnesses that work with models from several providers. The SDKs for building your own harness, such as the OpenAI Agents SDK, LangGraph, and Pydantic AI, are open source too.

What is the best AI harness?

For coding, it is Claude Code or Codex CLI if you work in the terminal, and Cursor if you work in an editor. If you want to pick the model yourself, take an open-source harness such as Aider, Cline, or OpenCode. If your task is not code, build your own harness on an SDK such as the Claude Agent SDK or LangGraph. The gap between the common picks is smaller than the gap a well set-up repo makes, so always test on a real task from your own work.

Which harness works best with local models?

OpenCode and Aider, because they were built from the start for models from any provider. If you work in VS Code, Cline is the pick. Claude Code and Codex CLI also work with a local model through Ollama, but they are tuned to their own models. The model and the context window weigh more than the harness: give a coding agent at least 32K of context.

How do you build your own AI harness?

Start from an SDK, for example the Claude Agent SDK, the OpenAI Agents SDK, or LangGraph. It gives you the loop: call the model, run the tool, send the result back. Then you add your own tools, define what the agent may not do, catch errors, and make sure you can see what it does in production. Only build your own harness when an existing one really cannot handle your task.

What is the difference between a harness and an AI agent?

An AI agent is a language model that can use tools to carry out a task. The harness is the software that makes that possible: the loop, the tools, the context management, and the limits. Claude Code and Cursor are harnesses; what you see working when you use them is the agent.

Let's discuss your project

From AI prototypes that need to be production-ready to strategic advice, code audits, or ongoing development support. We're happy to think along about the best approach, no strings attached.

010 Coding Collective free consultation
free

Free Consultation

In 1.5 hours we discuss your project, challenges and goals. Honest advice from senior developers, no sales pitch.

1.5 hours with senior developer(s)
Analysis of your current situation
Written summary afterwards
Concrete next steps