Agents
Claude Code vs Codex vs OpenCode, plus Grok Build and Antigravity CLI
Five terminal coding agents compared on what you deal with when you run them: install, sign-in, plans and price, permissions and sandboxing, headless mode, remote options and licence. No benchmark scores.
Quick answer
Claude Code (Anthropic) and Codex (OpenAI) come with the vendor's subscription: Claude Pro at $20/month ($17/month billed annually), and ChatGPT plans from Free and Go upward. Codex is open source (Apache-2.0); Claude Code isn't. OpenCode is MIT-licensed and works with any model provider. Grok Build (Apache-2.0) comes with SuperGrok and X Premium+. Google's Antigravity CLI lists a $0 Individual plan and replaced Gemini CLI for personal accounts. Since they're good at different things, many people run two.
Most "Claude Code vs Codex" articles end in a benchmark chart. This one doesn't, because model rankings change every few weeks and we haven't measured any. We run all five of these agents on the same servers, since that's what Maude does. What we can compare is how each one installs, signs in, gets paid for, handles permissions, runs headless and lets you reach it remotely. Those differences decide how an agent fits your setup, and they change less often than the models.
Side by side
| Claude Code | Codex | OpenCode | Grok Build | Antigravity CLI | |
|---|---|---|---|---|---|
| Maker | Anthropic | OpenAI | Open-source project (anomalyco) | xAI | |
| Install (macOS/Linux) | curl -fsSL https://claude.ai/install.sh | bash | npm install -g @openai/codex | curl -fsSL https://opencode.ai/install | bash | curl -fsSL https://x.ai/cli/install.sh | bash | curl -fsSL https://antigravity.google/cli/install.sh | bash |
| Sign-in | Claude account (Pro, Max, Team, Enterprise), Console API key, or a cloud provider | ChatGPT account (browser or --device-auth) or API key | /connect per model provider (API keys) | Browser login or XAI_API_KEY | Google sign-in (code pasted back over SSH) or GEMINI_API_KEY |
| Plans | Pro $20/month ($17 billed yearly), Max from $100/month; not on Free | Free, Go $8, Plus $20, Pro from $100, Business $20/user | Your provider; or OpenCode Go $10/month, Go Plus $40/month, or Zen pay-as-you-go | SuperGrok and X Premium+ subscribers, or API | $0 Individual plan with weekly limits; Google AI Pro/Ultra for higher limits |
| Permission model | Modes: Manual, accept edits, plan, auto (classifier), dontAsk, bypass; optional Bash sandbox | Sandbox (read-only, workspace-write, danger-full-access) plus approval policy; OS-level sandboxing | Per-tool ask/allow/deny rules in config | Plan Mode; see xAI's docs for approval settings | Asks in the TUI; headless runs deny and report instead of asking |
| Headless | claude -p | codex exec | opencode run, opencode serve | grok -p … --output-format streaming-json; ACP | agy --print with stream-json |
| Official remote | Remote Control and cloud sessions in the Claude app | Remote in the ChatGPT app (Mac/Windows host) | None official; opencode serve plus community apps | None documented; reportedly in testing | Remote Control web dashboard |
| Licence | Proprietary | Apache-2.0 | MIT | Apache-2.0 | Not open source |
Checked 2026-10-01 against each vendor's docs, pricing pages and repositories (linked below). Prices are USD. Other install methods exist for all five, including Homebrew, npm and Windows installers.
Install and sign-in
Claude Code installs with Anthropic's native installer (it auto-updates), Homebrew, apt/dnf/apk or npm (setup docs). It needs a Pro, Max, Team, Enterprise or Console account; the free Claude plan doesn't include it. Codex is @openai/codex on npm (the unscoped codex package is something else) or a Homebrew cask. On a server without a browser, codex login --device-auth is the clean path, once device-code login is enabled in your ChatGPT security settings.
OpenCode has no account of its own: you /connect a provider and paste its key (docs). Grok Build opens a browser on first launch, or takes XAI_API_KEY on a headless box (docs). Antigravity CLI (agy) detects SSH and prints a URL; you open it on another device and paste the code back. A Gemini API key covers CI (docs). Server-side walkthroughs: Claude Code on a VPS, Codex CLI on a VPS and Antigravity CLI on a server.
Plans and price
Claude Code and Codex are usually paid through the chat subscription you may already have. On Claude's pricing page, Pro is $20/month ($17/month billed yearly) and Max starts at $100/month, and Claude Code shares one usage pool with your chats. OpenAI's Codex pricing lists Free and Go ($8) at the low end, Plus at $20, and Pro tiers at $100, $200 and $500. Plus has five-hour usage windows. Either can run on API keys at API rates instead.
OpenCode is free software, so you pay your model provider. OpenCode's own Go plan is $10/month (Go Plus $40) for a set of open coding models with usage caps, and Zen is pay-as-you-go. Grok Build opened to all SuperGrok and X Premium+ subscribers in May 2026, per xAI's announcement; check xAI for current prices. Antigravity's pricing page lists a $0 Individual plan with weekly limits, higher limits on Google AI Pro and Ultra, and business plans from $30 per seat. It doesn't give numbers for those limits, and we haven't confirmed how much of each plan's quota the CLI can use.
On the cheapest way in: Codex is on ChatGPT Free, Antigravity lists a $0 Individual plan, and OpenCode can run free models through Zen or your own keys. Neither Claude Code nor Grok Build has a free tier.
Permissions and sandboxing
This is where the five differ most. Claude Code has permission modes: Manual asks before most actions; acceptEdits; plan; auto, where a classifier reviews actions instead of you; dontAsk for CI; and bypassPermissions, which Anthropic says is for isolated containers and VMs only. There's also an optional Bash sandbox on macOS, Linux and WSL2. Codex separates what a command can touch from when it asks. Its sandbox modes are read-only, workspace-write and danger-full-access, enforced with Seatbelt on macOS and bubblewrap plus seccomp on Linux, and approval policies sit on top of that.
OpenCode uses config rules that set each tool to ask, allow or deny. Grok Build has a Plan Mode; its docs cover the rest of its approval settings. Antigravity CLI asks in its interactive TUI, but in headless print mode it can't stop and ask. An action that needs permission is denied and listed in the result, and allow rules in its settings decide what runs. Running agents with every check off is a separate topic; see running agents with full permissions safely.
Headless and remote
All five run without a TUI: claude -p, codex exec (read-only sandbox by default), opencode run and opencode serve, grok -p with streaming JSON (plus the Agent Client Protocol), and agy in print mode with stream-json in and out. That's what lets apps and scripts drive them.
For reaching them from a phone, Anthropic has Remote Control and cloud sessions in the Claude app. OpenAI has Remote in the ChatGPT app, built around a Mac or Windows host. Google's Antigravity Remote Control is a web dashboard with an always-on agy remote-control start daemon. OpenCode has opencode serve and community apps. Grok Build has no documented official remote yet. Each agent page covers the options: Claude Code, Codex, OpenCode, Grok Build and Antigravity.
Open source and licence
Codex is Apache-2.0 and written in Rust. OpenCode is MIT. Grok Build is Apache-2.0, synced from xAI's internal monorepo, and doesn't accept outside contributions. Claude Code's repository carries an all-rights-reserved licence under Anthropic's Commercial Terms. Antigravity CLI ships as a binary; its public GitHub repository holds docs and an issue tracker, with no open-source licence.
One that's missing: Gemini CLI stopped serving free and Google AI Pro/Ultra personal accounts on 2026-06-18, and Google points those users to Antigravity CLI. API-key and Code Assist Standard/Enterprise users weren't affected. See what to use now that Gemini CLI is gone.
Which should you use?
- You already pay for Claude or ChatGPT: start with the agent your subscription includes. It's the cheapest way to get serious usage.
- You want open source and any model: OpenCode.
- You want sandboxing enforced by the OS: Codex's sandbox modes are the most explicit. Claude Code's Bash sandbox is opt-in.
- You want a free start: Codex on ChatGPT Free, or Antigravity's $0 Individual plan.
- You're on SuperGrok or X Premium+: Grok Build comes with it.
Use two
You don't have to pick just one. Agents tend to get stuck in different places, and a second agent reading the same diff with a fresh context often spots what the first one missed. In Maude you can switch an idle session to another agent. The new agent gets a brief with the plan, the files touched, the git state, the recent conversation and the last instruction, and switching back resumes the original agent's own session. That's the idea behind handing tasks between coding agents. Each agent still uses its own subscription or key, and Maude installs all five at tested versions on your server.
Frequently asked questions
Which is cheapest?
Which is open source?
Can I use them all with one subscription?
Which is best for big refactors?
What changed
- — First published. Install commands, sign-in, plans, permission models and licences checked against each vendor's docs, pricing pages and repositories.