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.mdonly. 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/mo | Yes | Yes | Yes | Yes | Yes | Yes | Not documented | Yes | Not documented | Not documented |
| Codex CLIOpenAI · ChatGPT Go $8, Plus $20, Pro from $100/mo | Yes | Yes | Yes | Yes | Not documented | Yes | Yes | Not documented | Yes | Yes |
| Grok BuildxAI · searched as “Grok CLI” · price not published | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Kimi Code CLIMoonshot · searched as “Kimi CLI” · ¥49–¥699/mo | Yes | Yes | Not documented | Yes | Not documented | Yes | Yes | No | Yes | Yes |
| OpenCodeAnomaly · CLI free and MIT · Go plan $10/mo | Yes | Partial | Not documented | Yes | Yes | Yes | Yes | Partial | Yes | Yes |
| Cursor CLICursor · Hobby free, Pro $20, Pro+ $60, Ultra $200/mo | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No |
Pick a capability heading to read that column across every tool.
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 |
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. |
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
| 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. |
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. |
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 |
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-buildand the docs are underdocs.x.ai/build. The binary is stillgrok, which is why the rename is easy to miss. Separately, an unaffiliated community project atsuperagent-ai/grok-clialso uses the name and publishes asgrok-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-cliis archived — read-only, no further releases, fixes or security updates, and existing installations stated to be unsupported and due to stop working. The replacement isMoonshotAI/kimi-code, and the binary is stillkimi. The Kimi CLI guide has the migration path. - OpenCode moved organisation.
github.com/sst/opencodenow redirects togithub.com/anomalyco/opencode, and thesstorganisation 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/opencodeis archived and became Crush under the Charm team — whileopencode-aiis 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-agentsurvives 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.
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.
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.
- Claude Code documentation
- Claude Code CLI reference
- Claude pricing
- Codex CLI documentation
- ChatGPT and Codex pricing
- Grok Build overview
- Grok Build CLI reference
- Kimi Code CLI repository
- Kimi Code CLI: the kimi command
- OpenCode documentation (v1)
- OpenCode documentation (v2)
- Cursor CLI overview
- Cursor CLI parameter reference
- Cursor pricing
- Git worktree documentation