Gemini CLI vs Claude Code: an honest 2026 comparison

Gemini CLI vs Claude Code: what Gemini CLI is, install, auth after the June 2026 Antigravity change, GEMINI.md, MCP, sandbox, a comparison table and running both.

Solviera Teknoloji 9 min read

Gemini CLI vs Claude Code is Google’s terminal agent against Anthropic’s. Gemini CLI is an open-source (Apache 2.0) AI agent that runs Gemini models in your terminal: it reads and edits files, runs shell commands, searches the web, connects to MCP servers and takes project instructions from GEMINI.md. Claude Code does the same job with Claude models and CLAUDE.md. The biggest news is not a feature: since June 18, 2026, Gemini CLI no longer serves free personal accounts. Unpaid tier and Google One users were moved to Antigravity CLI, and Gemini CLI is now for paid API keys, Vertex AI and Code Assist business licenses.

This post explains what Gemini CLI is today, how to install and sign in, how GEMINI.md, MCP and the sandbox work, and how it compares with Claude Code. No benchmark scores; they change with every model release. For the other big comparison, see Claude Code vs Codex.

What is Gemini CLI?

Gemini CLI is Google’s command-line coding agent. You run gemini in a project folder and talk to it. Built-in tools let it read and write files, run shell commands, fetch web pages and search Google. It works interactively or headless with -p, so you can call it from scripts and CI.

# interactive
gemini

# one-shot, with JSON output for scripts
gemini -p "summarize the changes in the last commit" --output-format json

# pick a model and add another directory to the context
gemini -m gemini-2.5-flash --include-directories ../shared

The source is on GitHub under Apache 2.0. Stable releases ship weekly, with preview and nightly channels for people who want changes earlier.

The June 2026 change: Antigravity CLI

Google announced that Gemini CLI is being replaced by Antigravity CLI for consumer users. According to Google’s developer blog and the Gemini CLI README:

  • From June 18, 2026, Gemini CLI stopped serving requests for Google AI Pro and Ultra users and for Gemini Code Assist for individuals at no charge. The README puts it as “Unpaid tier and Google One users: Gemini CLI was replaced by Antigravity CLI.”
  • Access stays the same for organizations on Gemini Code Assist Standard or Enterprise, for Code Assist for GitHub through Google Cloud, and for paid Gemini API keys.
  • The README also says Gemini CLI has not been optimized for Google’s newest models and points to Antigravity for those.

Antigravity CLI runs as agy. It detects existing Gemini CLI setups, reads GEMINI.md and AGENTS.md, keeps agent skills, hooks and subagents, and converts Gemini CLI extensions into Antigravity plugins with agy plugin import gemini. Google says there won’t be one-to-one feature parity, so check the migration guide before you switch a team.

If you used Gemini CLI because it was free, this is the part that matters. The rest of this post applies to Gemini CLI with a paid key or a business license, and much of it carries over to Antigravity.

Install

Gemini CLI is a Node.js package:

# try it without installing
npx @google/gemini-cli

# install globally
npm install -g @google/gemini-cli

# or with Homebrew
brew install gemini-cli

Release channels are npm tags: @latest (stable, weekly), @preview (weekly) and @nightly.

Auth options

When you start gemini for the first time it asks how to authenticate. The documented options:

MethodWhat you setStatus after June 18, 2026
Sign in with GoogleBrowser login; a paid Code Assist license also needs GOOGLE_CLOUD_PROJECTWorks for Code Assist Standard and Enterprise; personal and Google One accounts moved to Antigravity
Gemini API keyGEMINI_API_KEY from Google AI StudioPaid keys keep working
Vertex AIGOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION, plus ADC (gcloud auth application-default login), a service account or GOOGLE_API_KEYKeeps working
export GEMINI_API_KEY="your-key"
gemini

Workspace and organization accounts need a Google Cloud project. Google’s quota page has listed daily request numbers per auth type; some of those figures predate the June change, so check the current page and your Cloud console rather than a number in a blog post.

GEMINI.md: project instructions

GEMINI.md is Gemini CLI’s answer to CLAUDE.md. It loads in layers:

  1. Global: ~/.gemini/GEMINI.md for rules you want everywhere.
  2. Workspace: GEMINI.md files in your workspace directories and their parents.
  3. Just in time: when a tool touches a path, Gemini CLI also picks up GEMINI.md files near that path.

You can split a long file and import pieces with @file.md. Inside a session, /memory show prints the combined context and /memory reload re-reads the files.

To share one file with other agents, change the file name it looks for in ~/.gemini/settings.json or the project’s .gemini/settings.json:

{
  "context": {
    "fileName": ["AGENTS.md", "GEMINI.md"]
  }
}

Claude Code reads CLAUDE.md and can import AGENTS.md with @AGENTS.md. With both settings in place, one AGENTS.md drives both agents. How to write CLAUDE.md and AGENTS.md covers what to put in it.

MCP in Gemini CLI

Gemini CLI connects to MCP servers declared under mcpServers in settings.json. A server can be a local command (command, args, env, cwd) or a remote one (url for SSE, httpUrl for streamable HTTP).

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "$GITHUB_TOKEN" }
    }
  }
}

Or add one from the command line:

gemini mcp add -s user -t http docs https://example.com/mcp

-s picks the scope (project by default, or user) and -t the transport (stdio, sse or http). In a session, /mcp lists servers and their tools, and /mcp auth handles OAuth for servers that need it. Claude Code’s side looks almost the same: claude mcp add, with project servers in .mcp.json. New to the protocol? Start with what an MCP server is.

Sandbox and approvals

This is where Gemini CLI is strongest. Sandboxing is off by default and you turn it on with --sandbox (-s), the GEMINI_SANDBOX environment variable, or "sandbox": true under tools in settings.

  • macOS: Seatbelt (sandbox-exec), with the permissive-open profile by default; other profiles through SEATBELT_PROFILE.
  • Containers: Docker or Podman, using the ghcr.io/google/gemini-cli image.
  • Others: a native Windows sandbox, gVisor (runsc) and LXC (experimental).
gemini --sandbox
GEMINI_SANDBOX=docker gemini

Approval modes are separate from the sandbox. default asks before edits and commands, auto_edit applies file edits without asking, and plan is read-only. YOLO (approve everything) is only available from the command line with --yolo or --approval-mode=yolo. Turn on checkpointing in settings and /restore can roll files back to a snapshot taken before a tool ran.

Claude Code has permission modes (ask, accept edits, plan, bypass) and an opt-in sandbox for its Bash tool. Gemini CLI gives you more sandbox backends to choose from. Whichever you use, the safe rule is the same: never give an agent full access outside a container or a throwaway worktree. AI coding agent security goes into the threats.

Gemini CLI vs Claude Code at a glance

Gemini CLIClaude Code
Vendor, modelsGoogle, Gemini modelsAnthropic, Claude models
SourceOpen source, Apache 2.0Proprietary
Installnpm install -g @google/gemini-cli, brew install gemini-clicurl -fsSL https://claude.ai/install.sh | bash, Homebrew, WinGet
Who can use it nowPaid Gemini API keys, Vertex AI, Code Assist Standard/EnterpriseClaude paid plans or Anthropic API
Instructions fileGEMINI.md (configurable with context.fileName)CLAUDE.md
MCPmcpServers in settings.json, gemini mcp add.mcp.json, claude mcp add
SandboxSeatbelt, Docker/Podman, Windows, gVisor, LXCOpt-in sandbox for the Bash tool
Approval modesdefault, auto_edit, plan, YOLO by flagDefault, accept edits, plan, bypass
UndoCheckpointing with /restoreCheckpoints with rewind
Headlessgemini -p, JSON and stream-JSON outputclaude -p, JSON and stream-JSON output
ExtrasExtensions, web search built inHooks, skills, subagents, plugins

When to use which

Use Gemini CLI when:

  • Your company already buys Gemini through Google Cloud or has Code Assist Standard or Enterprise.
  • You want a real sandbox backend (Docker, gVisor, Seatbelt profiles) wired into the agent.
  • You want to read or change the agent’s source; it is open source.
  • You need Google Search grounding built in.

Use Claude Code when:

  • You have a Claude subscription and want the agent tuned for Claude models.
  • You rely on plan mode, hooks, skills or subagents.
  • You want to run it in the terminal, an IDE extension, the desktop app and the web with the same setup.

Consider Antigravity CLI if you were a personal or Google One user of Gemini CLI. That is where Google sends you now.

Running both

Running two agents from two vendors is common for the same reasons as with any pair: a second opinion on important changes, a second usage pool when one runs out, and picking the model that suits the task. The setup that works:

  1. One rules file. Put shared rules in AGENTS.md, set Gemini’s context.fileName to include it and import it from CLAUDE.md.
  2. Separate folders. Give each agent its own git worktree and branch so they never edit the same file.
  3. Separate MCP config. Each tool keeps its own MCP settings; add the same servers to both, or register them once in AgentVera, which passes them to both.
  4. One reviewer. Let one agent review the other’s branch before you merge.

Gemini CLI, Antigravity and Claude Code in AgentVera

AgentVera is a desktop app for macOS, Windows and Linux that runs terminal coding agents in real terminals, in a grid per project, with your existing logins. Gemini CLI, Antigravity CLI and Claude Code are all in the New agent dialog; a CLI that isn’t installed yet shows as Not installed.

NeedIn AgentVera
Sign inGemini CLI uses its own Google login or GEMINI_API_KEY; AgentVera doesn’t replace it
Pick a modelLeave it empty for Gemini CLI’s default, or pick one and it is passed with --model
PermissionsAsk, Auto or Full access per agent; for Gemini CLI, Auto is --approval-mode auto_edit and Full access is --approval-mode yolo
Keep sessionsEach Gemini agent starts with its own --session-id and reopens with --resume
Check the workAutomatic code review when a turn ends
Chain agentsFlows: Gemini CLI can be the source or the target (Pro and Team)

Be clear about the limits too. AgentVera’s MCP servers and its browser do reach Gemini CLI: they attach on every launch and merge by name with your own mcpServers. Gemini CLI has no extra-instructions flag, so the Role and instructions field doesn’t reach it; use AGENTS.md or GEMINI.md. And Full access never asks, so keep it for agents in a worktree or container.

The grid, worktrees and code review are on the free plan. Download AgentVera, open a Gemini CLI or Antigravity agent next to Claude Code in two worktrees, and compare them on your own repo.

The short answer

Gemini CLI is a capable, open-source terminal agent with a wide choice of sandbox backends, but since June 2026 it is a tool for paid API keys and Google Cloud customers. Claude Code is the stronger pick if you are on a Claude plan and want hooks, skills and subagents. If you were on Gemini CLI’s free tier, look at Antigravity CLI. And if you can, keep one AGENTS.md and run two agents.

Questions

What is Gemini CLI?

Gemini CLI is Google’s open-source (Apache 2.0) AI agent for the terminal. It runs Gemini models, reads and edits files, runs shell commands, searches the web, connects to MCP servers and reads project instructions from GEMINI.md. You start it with the `gemini` command.

Is Gemini CLI still free?

Not for personal accounts. Google’s notice says that from June 18, 2026, unpaid tier and Google One users (including Google AI Pro and Ultra) were moved to Antigravity CLI. Gemini CLI keeps working with paid Gemini API keys, Vertex AI and Gemini Code Assist Standard or Enterprise licenses.

How do I install Gemini CLI?

Run `npm install -g @google/gemini-cli`, or try it without installing with `npx @google/gemini-cli`. On macOS and Linux it is also available with `brew install gemini-cli`. Then run `gemini` and choose how to sign in.

Does Gemini CLI read CLAUDE.md or AGENTS.md?

By default it reads GEMINI.md. You can make it read other files with the `context.fileName` setting in settings.json, for example `["AGENTS.md", "GEMINI.md"]`, so one AGENTS.md can serve Gemini CLI, Claude Code and other agents.

Should I use Gemini CLI or Claude Code?

If your organization already pays for Gemini through Google Cloud, Gemini CLI fits well and its sandbox options are strong. If you have a Claude subscription and want plan mode, hooks, skills and subagents, Claude Code is the better fit. Many teams run both and let one review the other.

Bring your agents to one desk.

Download AgentVera for free; your installed CLIs are ready to go.

More posts