Skip to main content

Coding Agent CLIs Compared

Intermediate

You already picked a model. But the program that wraps the model — the loop that reads files, plans, runs commands, checks its own work and retries — is a separate choice, and it matters at least as much. The community name for that wrapper is the harness (or agent), and the same model can look brilliant in one and mediocre in another. This page maps the terminal coding agents of 2026, what actually separates them, and how to keep your config portable so switching costs stay low.

What you'll learn
  • Separate two choices people conflate: the model vs the harness that drives it
  • Know the durable shape of each major CLI agent — Claude Code, Codex CLI, Gemini CLI, and the open-source pack
  • Pick on the axes that actually decide it: autonomy, openness, model-agnosticism, sandboxing and ecosystem
  • Make your setup portable with AGENTS.md so you can switch agents without rewriting your project context

The model is not the agent

A frontier model is a text predictor. A coding agent is the harness around it: the system prompt, the tool set (read, edit, run shell, search), the planning loop, the context-management strategy, the permission and sandbox model, and the retry logic. Change the harness and you change the results — practitioner reports through 2026 describe the same model swinging tens of points on real repository tasks depending on which agent drives it.

That has two practical consequences:

  • A benchmark number is a pairing, not a model score. "83% on Terminal-Bench" is a model + harness + scaffold result. Swap any part and it moves.
  • Your loop is the real unit of comparison. The best agent is the one that works best on your stack, in your terminal, at a price you can live with — exactly the same logic as choosing a coding model. See Claude vs GPT vs Gemini for Coding for the model half of the decision; this page is the harness half.

The field in 2026

The terminal-agent space split into two camps: first-party agents tuned to one lab's models, and model-agnostic agents you point at whatever model (or local weights) you like.

AgentWhoOpennessModelsShape
Claude CodeAnthropicClosed-sourceClaude (first-party)Autonomous, agentic multi-file work; OS-enforced sandbox; deep skills/MCP/subagent ecosystem
Codex CLIOpenAIOpen (Apache-2.0, Rust)GPT (first-party)Autonomous terminal agent; native Windows sandbox; broad platform reach
Gemini CLIGoogleOpen-sourceGemini (first-party)Large-context agent, Google-ecosystem tie-ins (see freshness note below)
opencodeCommunity (anomalyco)Open (MIT, TypeScript)Any (model-agnostic)Most-starred open agent; CLI + desktop; bring-your-own-model
AiderCommunityOpen (Apache-2.0)Any, incl. localGit-native pair-programmer, not a full autonomous orchestrator
Cline / Goose / othersCommunityOpenAnyEditor-embedded (Cline) or general open agents (Goose); model-agnostic

The axes that actually decide it

Ignore the leaderboard for a minute. These are the durable questions:

Guided walkthrough1 of 5
  1. First-party agents (Claude Code, Codex CLI, Gemini CLI) are tuned for their own model and usually give the smoothest peak experience. Model-agnostic agents (opencode, Aider, Cline) let you swap models — frontier today, cheap or local tomorrow — without changing tools. Pick agnostic if avoiding lock-in or running local weights matters to you.
Pro tip
  • Don't buy a harness on a headline benchmark. Buy it on a 30-minute trial against a real task in your own repo — the same 'eval on your own code' move that beats every model leaderboard.
  • Openness is a hedge, not a feature you'll use daily. Its value shows up the day a price changes or a free tier disappears and you want to move.

Portability: write your context once

The biggest hidden switching cost is your project context — build commands, conventions, test rules, things the agent cannot infer. In 2026 that has a de-facto standard: AGENTS.md, a plain-Markdown file at your repo root, stewarded by the Agentic AI Foundation under the Linux Foundation and read natively by Codex, Gemini CLI, Cursor, Aider, Copilot's coding agent, opencode, Goose and 20+ other tools (60k+ repos have adopted it).

  • AGENTS.md = cross-tool project context. Write it once; most agents read it.
  • CLAUDE.md = Claude Code's own project-memory file (see CLAUDE.md). You can keep a small CLAUDE.md that points at AGENTS.md, or maintain both.
  • SKILL.md = Anthropic's separate spec for packaging reusable skills with frontmatter and bundled scripts. It's complementary to AGENTS.md, not a competitor — one describes the project, the other packages a reusable procedure.

Keeping context in AGENTS.md means the day you try a different agent, your project rules come along for free.

Minimal AGENTS.md — write only what an agent cannot infer

# AGENTS.md

## Setup
- Install: `pnpm install`
- Dev server: `pnpm dev` (port 3000)

## Build & test (run before every commit)
- Typecheck: `pnpm typecheck`
- Lint: `pnpm lint`
- Tests: `pnpm test` — all must pass

## Conventions
- TypeScript strict; no `any`.
- Components in `src/components`, one per file.
- Never edit files under `generated/` by hand.

## Constraints
- Do NOT run `git push` or open PRs without being asked.
- Secrets live in `.env.local`; never commit them.
Watch out
  • Only put in AGENTS.md what the agent can't discover on its own. Restating the obvious costs tokens on every run and buries the rules that matter. Curate it by hand — auto-generated context files tend to be noise.

A decision, in one breath

  • Deep, autonomous Claude work with the richest tool ecosystemClaude Code.
  • Open-source first-party agent tied to GPT, with strong platform/Windows reachCodex CLI.
  • You want to swap models freely or run local weightsopencode or Cline.
  • Careful, git-native, human-in-the-loop editsAider.
  • Big Google-ecosystem context playGemini CLI (confirm current access first).

Whatever you pick, keep your project context in AGENTS.md and prove the choice with a real task in your own repo before you commit.

Check yourself

0/4
  1. What do people mean by the coding agent 'harness'?
  2. A blog reports '83% on a coding benchmark' for an agent. What is that number really measuring?
  3. Why choose a model-agnostic agent like opencode or Aider?
  4. What is AGENTS.md for?

Flashcards

Coding-agent CLI vocabulary
Press Enter or Space to flip the card. Use the left and right arrow keys to move between cards.Term shown.
1 / 8

Sources & further reading