Comparisons

Agent CLI comparison (2026): six terminal coding agents

Claude Code, Codex, Grok Build, Kimi Code, OpenCode and Cursor CLI side by side: install, auth, context windows, MCP, hooks, sandboxing, subagents and worktrees, each cell dated.

  • Updated September 22, 2026
  • 12 min read
  • 15 primary sources

What this page compares, and how a cell is decided

Six coding agents that live in a terminal: Claude Code, Codex CLI, Grok Build, Kimi Code CLI, OpenCode and Cursor CLI. Every figure below was read from the vendor’s own documentation, repository or registry entry on 22 September 2026, and nothing here is sourced from a roundup, a forum post or another comparison page.

One convention matters more than any individual cell. Where a vendor does not document a capability, this page prints a dash, never a no. A dash means we could not find the vendor saying it — it is a statement about the documentation, not about the product. Several dashes below almost certainly hide a feature that exists and is simply unwritten, and turning them into a no would be the most common way these comparisons get things wrong.

The six in one line each

  • Claude Code — Anthropic’s agent, subscription-gated: the free claude.ai plan does not include it. Deepest worktree and session tooling of the six. Covered in the Claude Code introduction.
  • Codex CLI — OpenAI’s agent, Apache-2.0 and Rust, driven by a ChatGPT sign-in or an API key. Strong sandbox and approval configuration; see the Codex CLI workflow guide.
  • Grok Build — xAI’s agent, what people search for as “Grok CLI”. Apache-2.0, first-class worktrees, a kernel sandbox that ships off by default. See the Grok CLI guide.
  • Kimi Code CLI — Moonshot’s agent, what people search for as “Kimi CLI”. MIT, million-token model, AGENTS.md only. See the Kimi CLI guide.
  • OpenCode — the open-source one, MIT, now published by Anomaly, and now shipping two incompatible major versions at once. See the OpenCode guide.
  • Cursor CLI — Cursor’s terminal agent, installed as agent, closed source, with Cursor brokering all inference. See the Cursor CLI guide.

Capability matrix

Tool
Claude CodeAnthropic · Pro $20/mo, Max $100–$200/moYesYesYesYesYesYesNot documentedYesNot documentedNot documented
Codex CLIOpenAI · ChatGPT Go $8, Plus $20, Pro from $100/moYesYesYesYesNot documentedYesYesNot documentedYesYes
Grok BuildxAI · searched as “Grok CLI” · price not publishedYesYesYesYesYesYesYesYesYesYes
Kimi Code CLIMoonshot · searched as “Kimi CLI” · ¥49–¥699/moYesYesNot documentedYesNot documentedYesYesNoYesYes
OpenCodeAnomaly · CLI free and MIT · Go plan $10/moYesPartialNot documentedYesYesYesYesPartialYesYes
Cursor CLICursor · Hobby free, Pro $20, Pro+ $60, Ultra $200/moYesYesYesYesYesYesYesYesNoNo

Pick a capability heading to read that column across every tool.

yes partial no not documented by the vendorEvery cell read from the vendor’s own documentation, repository or registry entry on 22 September 2026. A dash means the vendor does not document the capability — it is a statement about the documentation, not a verdict on the product. Pick a column heading to read that capability across all six.

Install, auth and version

AgentInstallAuthVersion on 22 September 2026
Claude Codecurl -fsSL https://claude.ai/install.sh | bash, brew install --cask claude-code, or npm i -g @anthropic-ai/claude-codeA Pro, Max, Team, Enterprise or Console account — the free claude.ai plan does not include Claude Code. Also ANTHROPIC_API_KEY, Bedrock, Google Cloud Agent Platform or Microsoft Foundry.2.1.278
Codex CLIcurl -fsSL https://chatgpt.com/codex/install.sh | sh, npm i -g @openai/codex, brew install --cask codex, or irm https://chatgpt.com/codex/install.ps1 | iexChatGPT sign-in on Free, Go, Plus, Pro or Business, or an API key billed at API rates.0.155.1, released 18 September 2026
Grok Buildcurl -fsSL https://x.ai/cli/install.sh | bash, or irm https://x.ai/cli/install.ps1 | iexBrowser login on first launch, grok login --device-auth for headless machines, or XAI_API_KEY. Gated to SuperGrok and X Premium Plus at announcement.1.0.40, channel pointer moved 21 September 2026
Kimi Code CLIcurl -fsSL https://code.kimi.com/kimi-code/install.sh | bash, npm i -g @moonshot-ai/kimi-code, or brew install kimi-code/login in the TUI or kimi login for a device-code flow, or KIMI_API_KEY.2.0.2, released 19 September 2026
OpenCodev1: curl -fsSL https://opencode.ai/install | bash or brew install anomalyco/tap/opencode. v2: curl -fsSL https://opencode.ai/v2/install | bash or brew install anomalyco/tap/opencode-v2opencode auth login with any provider key, /connect in the TUI, Console pay-as-you-go, or the Go subscription.v1 1.18.32 (21 September 2026) · v2 2.0.13 (22 September 2026)
Cursor CLIcurl https://cursor.com/install -fsS | bash, or irm 'https://cursor.com/install?win32=true' | iex for native Windowsagent login, or --api-key / CURSOR_API_KEY. Cursor brokers inference; you cannot supply a provider key.2026.09.18-9a7762b, from the installer’s pinned download URL
Install commands and version strings read from vendor documentation, install scripts, release feeds and package registries on 22 September 2026.

Platform support is close to uniform and the caveats are where the differences live. Claude Code documents macOS Ventura or newer, Windows 10 1809 or Server 2019 and newer, Ubuntu 20.04, Debian 10 or Alpine 3.19 and newer, with 4 GB of RAM on x64 or ARM64. Grok Build calls its Windows builds best-effort and tells you to run the installer under Git for Windows or MSYS2 Bash. Kimi Code needs Git for Windows present because it uses the bundled Git Bash as its shell. OpenCode v1 recommends WSL over native Windows; OpenCode v2 states that Windows package managers are not supported. Cursor documents macOS, Linux and WSL together, plus a separate native Windows installer, and does not express a preference between them.

What each one costs

AgentEntry priceHigher tiersMetering
Claude CodePro $20/mo, or $17/mo billed annuallyMax 5x $100/mo, Max 20x $200/mo, Team $25/seatA rolling five-hour window with a weekly limit on top, shared with claude.ai and Cowork.
Codex CLIChatGPT Go $8/moPlus $20/mo, Pro from $100/mo, Business $20/user/mo annually or $25 monthlyWeekly refresh, with one allowance shared between local and cloud chats.
Grok Build——A single weekly usage allowance shared across xAI products; the size is not published.
Kimi Code CLIAndante ¥49/moModerato ¥99, Allegretto ¥199, Allegro ¥699Every tier carries a separate limit of 5 hours per week for Kimi Code.
OpenCodeThe CLI itself is free and MITGo $10/mo; Console and Zen are pay-as-you-go per tokenGo is metered in dollars: a 5-hour window at $12, a weekly limit at $30 and a monthly limit at $60.
Cursor CLIHobby, free, with limited agent requestsPro $20/mo, Pro+ $60/mo, Ultra $200/mo, Teams $40/user/mo, Start ₹649/mo in IndiaTwo pools resetting with the monthly billing cycle: Cursor Models and Other Models.
Read from each vendor’s pricing documentation on 22 September 2026. xAI publishes no price on a page that can be fetched — x.ai/pricing answers HTTP 403 — so both Grok cells are dashes rather than guesses. Moonshot publishes CNY only. Whether Cursor CLI usage draws on the same pools as the editor is not documented anywhere.

Three metering models are in play and they are not comparable. Anthropic and OpenAI meter in opaque units over time windows. OpenCode Go meters in dollars, which is the only one you can reason about arithmetically. Cursor meters in two pools split by model family. If you are trying to work out whether a second subscription pays for itself, the AI subscription audit is that question written down as a procedure, and the usage limits guide covers what actually happens when a window closes mid-task.

Models and context windows

AgentContext windowModel selection
Claude Code200K, or 1M on Sonnet 5, Fable 5 and 5.1 and Opus 4.7 and later; [1m] variants exist for Opus 4.6 and Sonnet 4.6. Auto-compact fires near 967K.Aliases default, best, fable, sonnet, opus, haiku, sonnet[1m], opus[1m], opusplan. default resolves to Opus 5 on Max, Team Premium, Enterprise and the API, and to Sonnet 5 on Pro and Team Standard.
Codex CLI—Not published per model on the CLI documentation pages. /model in session.
Grok Build256K on grok-build-0.1; 500K on grok-4.5 through grok-4.7; 1M on grok-4.3 and the grok-4.20-* line. Prompts of 200K or more bill at double rate.grok models, then -m/--model or /model. Custom OpenAI-compatible models can be registered in ~/.grok/config.toml.
Kimi Code CLI262,144 on kimi-k2.6 and the kimi-k2.7-code line; 1,048,576 on kimi-k3.Aliases declared under [models] in config.toml, each requiring an explicit max_context_size. Then -m/--model or /model.
OpenCodeA per-model property you declare, not a product constant. For an unknown model the documented fallback is a 200,000-token context limit and a 32,000-token output limit — described in the docs as fallback assumptions, not detected capabilities.provider/model references such as anthropic/claude-3-5-sonnet; opencode models lists them. Ollama and LM Studio inventories are discovered automatically, with context read from the runtime.
Cursor CLI—agent models or --list-models, then --model <model>. No per-model token figures are published; only name encodings such as Grok 4.7 500k and Claude 4 Sonnet 1M hint at them.
Read from each vendor’s model documentation on 22 September 2026. Community figures for Cursor’s per-model context windows circulate widely; none of them is primary, so this page leaves the cell empty.

One structural difference cuts across the table. OpenCode treats the context window as configuration you assert about a model you chose; Cursor treats the model list as something it hands you. Everyone else sits in between. That is the same axis as bring-your-own-key in the matrix above, and it decides how much of your agent setup survives changing vendors.

Instruction files: AGENTS.md is winning

The most useful thing you can know about running several of these at once is which file each of them reads. Five of the six read AGENTS.md. One of them reads it exclusively. Three also read CLAUDE.md, one of them reads only CLAUDE.md, and one dropped CLAUDE.md deliberately in its second major version.

AgentInstruction files it readsWhere else it looks
Claude CodeCLAUDE.mdCLAUDE.local.md, plus a .claude/ directory of settings and subagents.
Codex CLIAGENTS.mdLayered config from CLI flags, project .codex/config.toml in trusted projects, a named --profile, ~/.codex/config.toml, cloud-managed defaults and /etc/codex/config.toml.
Grok BuildAGENTS.md, Agents.md, AGENT.md, and CLAUDE.md, Claude.md, CLAUDE.local.md, .claude/Skills in .grok/skills/, ~/.grok/skills/ and ~/.agents/skills/; plugins in .grok/plugins/ and ~/.grok/plugins/.
Kimi Code CLIAGENTS.md only~/.kimi-code/AGENTS.md globally, ~/.agents/AGENTS.md for cross-tool instructions, <project>/.kimi-code/AGENTS.md. SYSTEM.md in the data root overrides the system prompt outright.
OpenCodeAGENTS.md; v1 also falls back to CLAUDE.md, v2 does notGlobal ~/.config/opencode/AGENTS.md first, then nested project files loaded lazily as the agent explores.
Cursor CLI.cursor/rules/*.mdc, plus AGENTS.md and CLAUDE.md at the project rootA plain .md in .cursor/rules is ignored because it has no frontmatter; the docs tell you to use AGENTS.md instead.
Read from each vendor’s instructions, rules or memory documentation on 22 September 2026.

Sessions and resume

AgentContinueResume a specific sessionBranch
Claude Codeclaude -cclaude --resume <session>--fork-session; background sessions via --bg, then claude attach|respawn|rm|stop|logs <id>
Codex CLIcodex resumecodex resume opens the picker—
Grok Buildgrok -cgrok -r [ID], or grok -s <UUID> to name one--fork-session; grok -w -r <ID> resumes into a fresh worktree
Kimi Code CLIkimi -ckimi --session [id], with a picker when the id is omitted/fork in session; kimi export <sessionId> zips one
OpenCodeopencode run -copencode run -s <id>; opencode session list and session delete--fork
Cursor CLIagent --continue, an alias for --resume=-1agent ls for a picker, agent resume for the latest, agent --resume="<chat-id>"agent create-chat returns a fresh id; agent persist keeps a detachable session alive
Read from each vendor’s CLI reference on 22 September 2026. Codex documents a resume picker but no documented fork flag, which is why that cell is empty.

Every one of the six persists sessions locally, and every one of them uses a different layout to do it. That is precisely why supervising several at once is harder than running any one of them — managing multiple sessions covers the problem for a single agent, and it compounds per additional CLI.

Two renames, one org move, and a name collision

Half of this comparison changed identity during 2026. None of these are cosmetic: each one changes the repository you should be reading, the package you should be installing, or both.

  • Grok CLI is Grok Build. The repository is xai-org/grok-build and the docs are under docs.x.ai/build. The binary is still grok, which is why the rename is easy to miss. Separately, an unaffiliated community project at superagent-ai/grok-cli also uses the name and publishes as grok-dev; it has had no commit or release since May 2026. The Grok CLI guide separates the two.
  • Kimi CLI is Kimi Code CLI. The Python MoonshotAI/kimi-cli is archived — read-only, no further releases, fixes or security updates, and existing installations stated to be unsupported and due to stop working. The replacement is MoonshotAI/kimi-code, and the binary is still kimi. The Kimi CLI guide has the migration path.
  • OpenCode moved organisation. github.com/sst/opencode now redirects to github.com/anomalyco/opencode, and the sst organisation bio says so directly. The publisher is Anomaly.
  • OpenCode shipped a second, separate distribution. v1 and v2 use different npm packages, install scripts, Homebrew formulae and documentation sites, and cannot be installed side by side by default. Both lines are live.
  • A different project was also called OpenCode. opencode-ai/opencode is archived and became Crush under the Charm team — while opencode-ai is simultaneously the npm package name of the surviving OpenCode v1. Anything written about “opencode” before that split may be about the wrong product. The OpenCode guide untangles all three.
  • Cursor’s binary is now agent. cursor-agent survives only as a legacy symlink the installer still creates, so most existing third-party guides still name it. The Cursor CLI guide covers what changed around it.

Running more than one of them at once

Most people end up with two or three of these rather than one, because the plans are not interchangeable and neither are the strengths. Claude Code vs Codex is the comparison with benchmarks and cost-per-task figures attached, and running them in parallel is the worktree-based setup that keeps two agents from editing the same files.

The mechanics generalise across all six. Give each agent its own worktree, keep one written brief and one verification command, and never paste one agent’s output into another’s trial if you want an independent result. Four of the six ship a worktree flag; for Codex and Kimi Code you prepare the checkout yourself with git worktree add.

One commit, three agents, three worktreesbash
git worktree add -b trial/claude ../trial-claude HEAD
git worktree add -b trial/codex  ../trial-codex  HEAD
git worktree add -b trial/grok   ../trial-grok   HEAD

(cd ../trial-claude && claude --version)
(cd ../trial-codex  && codex --version)
(cd ../trial-grok   && grok --version)

CmdBrief is the Mac workspace built for exactly that: it runs Claude Code, Codex, Grok CLI, Kimi CLI, OpenCode and Cursor CLI in named per-product workspaces (Claude, Codex, Grok and Cursor can lead), shows working, needs-input and done states per pane, and reads each agent’s own session store so history stays attached to the product it belongs to. Usage windows appear where the provider exposes them — five-hour and weekly for Claude Code and Codex, weekly credits for Grok CLI, rolling, weekly and monthly for OpenCode Go plans, and monthly Cursor Models and Other Models pools for Cursor CLI. Kimi exposes none, so none is shown.

If the question is which workspace to run them in rather than which agent to run, the tool comparisons cover that side, including CmdBrief against Cursor.

Standard agent panes · 20 seconds · silent
Staged native CmdBrief UI from the September 2026 development build, using sample work. The downloadable release may differ.

Questions

Which agent CLI is best in 2026?

None of them dominates the matrix. Grok Build and Cursor CLI document the widest capability set — both ship a sandbox, subagents, hooks and native worktrees. Claude Code has the deepest worktree and background-session tooling. OpenCode is the only fully open one that will drive any provider, including local models. Kimi Code has the cheapest million-token window. Cursor CLI is the only one that will not take your own provider key. Start with whatever your existing subscription already includes.

Do all of them read AGENTS.md?

Five of the six do: Codex, Grok Build, Kimi Code, OpenCode and Cursor CLI. Claude Code documents CLAUDE.md as its memory file instead. Grok Build and Cursor CLI read both. OpenCode v1 falls back to CLAUDE.md, but v2 states that it recognizes AGENTS.md only and does not use CLAUDE.md as a fallback.

Which of them sandbox shell commands?

Claude Code (Seatbelt on macOS, plus Linux and WSL2, with native Windows unsupported), Codex (sandbox_mode with read-only, workspace-write and danger-full-access), Grok Build (Landlock and Seatbelt, off by default) and Cursor CLI (--sandbox). Kimi Code and OpenCode document permission systems instead; neither documents an operating-system sandbox, which is not the same as neither having one.

Which one is free?

The OpenCode CLI itself is free and MIT-licensed — you bring a provider key, or use its pay-as-you-go gateway, which rotates a set of temporarily free models. Cursor has a free Hobby plan with limited agent requests, though no Cursor document says whether the CLI is included in it. Claude Code requires a paid plan outright. For the rest, no vendor publishes a free tier that is documented to drive the CLI.

Why does this page show a dash instead of “no”?

Because the two are different claims. A dash means the vendor does not document the capability on any page we could read. Treating that as a no would assert something about the product that no source supports, and in a fast-moving category it is the most common way a comparison becomes wrong. Every dash here is deliberate and every filled cell carries a source.

Still unsure? Write to [email protected] or use the contact form. Contact CmdBrief →

Primary sources

Provider terms and product behavior can change. Confirm plan, pricing, model, and permission details in the current official documentation.

Put it into practice

Run more than one agent CLI without losing track of any of them.

Apple silicon · macOS 26+ · Subscription required · 14-day money-back guarantee

We value your privacy

We use cookies to analyze site usage and improve your experience.

Learn more about our cookies

Essential cookies are always active