# 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.

- **Category:** Comparisons
- **Updated:** 2026-09-22
- **Reading time:** 12 min
- **Canonical page:** https://cmdbrief.com/guides/agent-cli-comparison

## 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.

> **Warning:** Two of these products were renamed in 2026 and one moved organisation and shipped an incompatible second edition. If you are comparing against something you read six months ago, skip ahead to the renames section first — three of the six are not called what they were called.

## 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](https://cmdbrief.com/guides/claude-code).
- 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](https://cmdbrief.com/guides/codex-cli).
- 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](https://cmdbrief.com/guides/grok-cli).
- 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](https://cmdbrief.com/guides/kimi-cli).
- OpenCode — the open-source one, MIT, now published by Anomaly, and now shipping two incompatible major versions at once. See [the OpenCode guide](https://cmdbrief.com/guides/opencode).
- Cursor CLI — Cursor’s terminal agent, installed as `agent`, closed source, with Cursor brokering all inference. See [the Cursor CLI guide](https://cmdbrief.com/guides/cursor-cli).

## Capability matrix

| Tool | MCP | Hooks | OS sandbox | Subagents | Git worktrees | Headless run | Reads AGENTS.md | Reads CLAUDE.md | Bring your own key | Open source |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Claude Code (Anthropic · Pro $20/mo, Max $100–$200/mo) | Yes — Documented MCP client, configured per project or globally. | Yes — Lifecycle hooks documented in the hooks reference. | Yes — Built-in Bash sandbox on macOS (Seatbelt), Linux and WSL2. The docs state that native Windows is not supported. | Yes — Documented sub-agents, including an isolation: worktree frontmatter option. | Yes — claude --worktree <name>, defaulting to .claude/worktrees/<name>/ on branch worktree-<name>. Supports .worktreeinclude, worktree.baseRef of fresh or head, and --worktree "#1234" to branch from a pull request. | Yes — claude -p, with --output-format json or stream-json. | — — Anthropic documents CLAUDE.md as the memory file. No Anthropic documentation names AGENTS.md as a convention Claude Code reads. | Yes — CLAUDE.md is the documented memory file, with CLAUDE.local.md and a .claude directory alongside it. | — — An Anthropic API key works, as do Bedrock, Google Cloud Agent Platform and Microsoft Foundry. Pointing the CLI at an unrelated provider is not documented. | — — The npm licence field reads SEE LICENSE IN README.md, which is not an SPDX open-source licence. |
| Codex CLI (OpenAI · ChatGPT Go $8, Plus $20, Pro from $100/mo) | Yes — Documented MCP support in the Codex CLI docs. | Yes — Lifecycle hooks exist, with an admin control: setting allow_managed_hooks_only = true in requirements.toml ignores user, project and session hook configs. | Yes — sandbox_mode accepts read-only, workspace-write and danger-full-access; approval_policy accepts on-request, never and granular. | Yes — Documented subagents. | — — Worktrees are documented for the ChatGPT desktop app, mobile Remote and remote dev environments, not for the CLI. A --worktree CLI flag is an open feature request, not a shipped feature. | Yes — codex exec runs non-interactively. | Yes — AGENTS.md is the documented instruction file. | — — No Codex documentation names CLAUDE.md. | Yes — An OpenAI API key can drive the CLI, billed at API rates. | Yes — Apache-2.0, at openai/codex. |
| Grok Build (xAI · searched as “Grok CLI” · price not published) | Yes — grok mcp list, add, remove and doctor. | Yes — Lifecycle hooks on tool and session events. | Yes — Landlock on Linux and Seatbelt on macOS, off by default. Profiles off, workspace, devbox, read-only and strict. | Yes — On by default. Built-ins general-purpose, explore and plan; disable with --no-subagents. | Yes — grok -w, --worktree=<name>, --ref <REF>, and grok worktree list, show, rm and gc. Stored under ~/.grok/worktrees/<repo>/<name>. | Yes — grok -p with --output-format streaming-json, plus full Agent Client Protocol support. | Yes — Collects AGENTS.md, Agents.md and AGENT.md up to the repository root. | Yes — Also reads CLAUDE.md, Claude.md, CLAUDE.local.md and .claude/. The docs claim full compatibility with Claude Code with zero configuration needed. | Yes — XAI_API_KEY, with GROK_XAI_API_BASE_URL to override the endpoint. Custom OpenAI-compatible models can be registered in config.toml. | Yes — Apache-2.0, synced from an internal monorepo; external contributions are not accepted. |
| Kimi Code CLI (Moonshot · searched as “Kimi CLI” · ¥49–¥699/mo) | Yes — /mcp-config sets servers up conversationally; MCP OAuth is supported. | Yes — Eighteen documented events with blockable PreToolUse, UserPromptSubmit and Stop. Exit 0 allows, exit 2 blocks, any other non-zero code fails open. | — — No operating-system sandbox is documented. A permission system stands in: default_permission_mode of manual, yolo or auto, plus permission rules carrying a decision, a pattern and a scope. | Yes — Built-ins coder, explore and plan; custom agents are Markdown with YAML frontmatter. | — — A search of the whole English documentation set for worktree returns nothing. --add-dir adds workspace directories, which is a different thing. | Yes — kimi -p with --output-format text or stream-json. | Yes — AGENTS.md globally, at ~/.agents/AGENTS.md for cross-tool instructions, and at the project root. | No — Moonshot documents the complete set of instruction files Kimi Code reads, and CLAUDE.md is not among them. A search of the whole English documentation set for CLAUDE.md and KIMI.md returns nothing. | Yes — Anthropic, OpenAI and compatible endpoints, Google Gemini, Vertex AI, DeepSeek and Qwen, configured per provider. | Yes — MIT. |
| OpenCode (Anomaly · CLI free and MIT · Go plan $10/mo) | Yes — Documented in both v1 and v2. | Partial — Hooks arrive through the plugin API rather than a shell-hook configuration block. Events include tool execution before and after, permission asked and replied, session created, idle, status and compacted, file edited and command executed. | — — The string sandbox appears in none of the 23 v1 and v2 documentation pages checked. The permissions page warns that shell runs with the host user filesystem, process and network authority. | Yes — A subagent tool starts a child session, supports background runs and returns a session id. Default nesting depth is one. | Yes — Native in v2 through a worktree configuration object. v1 has no documented equivalent. | Yes — opencode run for one-shot work, opencode serve for a headless server. | Yes — Loaded global-first then nearest-first, lazily as the agent explores: reading a file loads any AGENTS.md between that target and the workspace root. | Partial — v1 falls back to CLAUDE.md when no AGENTS.md is present. v2 states plainly that it recognizes AGENTS.md only and does not use CLAUDE.md as a fallback. | Yes — Any provider key, plus locally discovered Ollama and LM Studio inventories. | Yes — MIT. |
| Cursor CLI (Cursor · Hobby free, Pro $20, Pro+ $60, Ultra $200/mo) | Yes — Shares the editor configuration: the CLI detects and respects your mcp.json. Subcommands agent mcp login, list and list-tools. | Yes — hooks.json at project or user level, spawned processes speaking JSON over stdio in both directions. Cursor also supports loading hooks from third-party tools like Claude Code. | Yes — /sandbox in session or --sandbox enabled\|disabled on launch, with network access controlled from the same menu. Settings persist across sessions. | Yes — Documented for the editor, the CLI and Cloud Agents, in foreground and background modes, with built-ins including Explore and Bash. | Yes — -w or --worktree [name] runs in a new worktree under ~/.cursor/worktrees/<reponame>/<name>, with --worktree-base <branch> and --skip-worktree-setup. | Yes — -p or --print, with --output-format text, json or stream-json and --stream-partial-output. | Yes — The CLI reads AGENTS.md at the project root and applies it as rules, alongside .cursor/rules/*.mdc. | Yes — The CLI reads CLAUDE.md at the project root and applies it as rules. | No — Cursor brokers all inference. You authenticate with a Cursor account or a Cursor API key; there is no documented way to supply your own provider key. | No — Closed source. There is no public CLI repository, and the cursor/cursor repository publishes no licence. |

*Every 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

| Agent | Install | Auth | Version on 22 September 2026 |
| --- | --- | --- | --- |
| Claude Code | `curl -fsSL https://claude.ai/install.sh \| bash`, `brew install --cask claude-code`, or `npm i -g @anthropic-ai/claude-code` | A 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 CLI | `curl -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 \| iex` | ChatGPT 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 Build | `curl -fsSL https://x.ai/cli/install.sh \| bash`, or `irm https://x.ai/cli/install.ps1 \| iex` | Browser 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 CLI | `curl -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 |
| OpenCode | v1: `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-v2` | `opencode 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 CLI | `curl https://cursor.com/install -fsS \| bash`, or `irm 'https://cursor.com/install?win32=true' \| iex` for native Windows | `agent 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

| Agent | Entry price | Higher tiers | Metering |
| --- | --- | --- | --- |
| Claude Code | Pro $20/mo, or $17/mo billed annually | Max 5x $100/mo, Max 20x $200/mo, Team $25/seat | A rolling five-hour window with a weekly limit on top, shared with claude.ai and Cowork. |
| Codex CLI | ChatGPT Go $8/mo | Plus $20/mo, Pro from $100/mo, Business $20/user/mo annually or $25 monthly | Weekly 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 CLI | Andante ¥49/mo | Moderato ¥99, Allegretto ¥199, Allegro ¥699 | Every tier carries a separate limit of 5 hours per week for Kimi Code. |
| OpenCode | The CLI itself is free and MIT | Go $10/mo; Console and Zen are pay-as-you-go per token | Go is metered in dollars: a 5-hour window at $12, a weekly limit at $30 and a monthly limit at $60. |
| Cursor CLI | Hobby, free, with limited agent requests | Pro $20/mo, Pro+ $60/mo, Ultra $200/mo, Teams $40/user/mo, Start ₹649/mo in India | Two 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](https://cmdbrief.com/guides/ai-subscription-audit) is that question written down as a procedure, and [the usage limits guide](https://cmdbrief.com/guides/claude-code-usage-limits) covers what actually happens when a window closes mid-task.

## Models and context windows

| Agent | Context window | Model selection |
| --- | --- | --- |
| Claude Code | 200K, 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 Build | 256K 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 CLI | 262,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`. |
| OpenCode | A 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.

| Agent | Instruction files it reads | Where else it looks |
| --- | --- | --- |
| Claude Code | `CLAUDE.md` | `CLAUDE.local.md`, plus a `.claude/` directory of settings and subagents. |
| Codex CLI | `AGENTS.md` | Layered 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 Build | `AGENTS.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 CLI | `AGENTS.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. |
| OpenCode | `AGENTS.md`; v1 also falls back to `CLAUDE.md`, v2 does not | Global `~/.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 root | A 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.*

> **Tip:** The practical rule for a repository that several agents touch: put the house rules in `AGENTS.md`, and keep `CLAUDE.md` as a short file that points at it. Five of the six read `AGENTS.md`; only Claude Code needs the second file, and only OpenCode v2 will actively ignore it.

## Sessions and resume

| Agent | Continue | Resume a specific session | Branch |
| --- | --- | --- | --- |
| Claude Code | `claude -c` | `claude --resume <session>` | `--fork-session`; background sessions via `--bg`, then `claude attach\|respawn\|rm\|stop\|logs <id>` |
| Codex CLI | `codex resume` | `codex resume` opens the picker | — |
| Grok Build | `grok -c` | `grok -r [ID]`, or `grok -s <UUID>` to name one | `--fork-session`; `grok -w -r <ID>` resumes into a fresh worktree |
| Kimi Code CLI | `kimi -c` | `kimi --session [id]`, with a picker when the id is omitted | `/fork` in session; `kimi export <sessionId>` zips one |
| OpenCode | `opencode run -c` | `opencode run -s <id>`; `opencode session list` and `session delete` | `--fork` |
| Cursor CLI | `agent --continue`, an alias for `--resume=-1` | `agent 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](https://cmdbrief.com/guides/manage-multiple-claude-code-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](https://cmdbrief.com/guides/grok-cli) 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](https://cmdbrief.com/guides/kimi-cli) 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](https://cmdbrief.com/guides/opencode) 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](https://cmdbrief.com/guides/cursor-cli) 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](https://cmdbrief.com/guides/claude-code-vs-codex) is the comparison with benchmarks and cost-per-task figures attached, and [running them in parallel](https://cmdbrief.com/guides/run-claude-code-and-codex-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 worktrees**

```bash
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](https://cmdbrief.com/compare) cover that side, including [CmdBrief against Cursor](https://cmdbrief.com/compare/cursor).

## 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.

## Primary sources

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

- [Claude Code documentation](https://code.claude.com/docs/en/overview)
- [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference)
- [Claude pricing](https://claude.com/pricing)
- [Codex CLI documentation](https://learn.chatgpt.com/docs/codex/cli)
- [ChatGPT and Codex pricing](https://learn.chatgpt.com/docs/pricing)
- [Grok Build overview](https://docs.x.ai/build/overview)
- [Grok Build CLI reference](https://docs.x.ai/build/cli/reference)
- [Kimi Code CLI repository](https://github.com/MoonshotAI/kimi-code)
- [Kimi Code CLI: the kimi command](https://moonshotai.github.io/kimi-code/en/reference/kimi-command)
- [OpenCode documentation (v1)](https://opencode.ai/docs/)
- [OpenCode documentation (v2)](https://opencode.ai/v2/docs)
- [Cursor CLI overview](https://cursor.com/docs/cli/overview)
- [Cursor CLI parameter reference](https://cursor.com/docs/cli/reference/parameters)
- [Cursor pricing](https://cursor.com/pricing)
- [Git worktree documentation](https://git-scm.com/docs/git-worktree)

## Keep reading

- Workflows: [Grok CLI is now Grok Build: install, models, limits](https://cmdbrief.com/guides/grok-cli)
- Workflows: [Kimi CLI is now Kimi Code CLI: the 2026 guide](https://cmdbrief.com/guides/kimi-cli)
- Workflows: [OpenCode in 2026: v1 vs v2, plans, and which one you mean](https://cmdbrief.com/guides/opencode)

---

Markdown mirror of https://cmdbrief.com/guides/agent-cli-comparison, generated at build time from the same data the HTML page renders. Machine-readable index: https://cmdbrief.com/llms.txt
