DEV Community

Carlos Oliva Pascual
Carlos Oliva Pascual

Posted on • Originally published at stacknotice.com

Claude Code vs Gemini CLI (and Antigravity CLI): The 2026 Comparison

For most of 2025, the terminal AI coding tool comparison was simple: Claude Code vs Gemini CLI. Then June 18, 2026 happened. Google shut down Gemini CLI's free hosted tier for personal users and moved them to Antigravity CLI — a new closed-source tool with a different command (agy) and a more ambitious multi-agent architecture. This changed the comparison considerably.

This article covers where both tools stand today: what Claude Code offers, what Gemini CLI was (and still is, for paid API key users), what Antigravity CLI introduces, and — most practically — which one you should be running in your terminal.

What Each Tool Actually Is

Claude Code is Anthropic's terminal AI agent. It runs locally, reads your filesystem, executes shell commands with approval, understands your codebase through project context files, and iterates on tasks autonomously. It uses Claude models (Sonnet 4 by default, Opus 4 for maximum capability) and requires an Anthropic subscription or API key.

Gemini CLI was Google's open-source terminal AI agent, released at Google I/O 2025. Same basic model: runs in your terminal, edits files, runs shell commands, supports project memory. It used Gemini models with a free tier that was genuinely attractive — 60 requests per minute, 1,000 requests per day on a standard Google account. The open-source codebase still exists and still works with a paid Gemini API key.

Antigravity CLI is Google's replacement for the free personal tier of Gemini CLI, announced at Google I/O 2026 and live since June 18. It's closed-source, written in Go, invoked with agy, and takes a multi-agent approach — it can spin up background agents to handle complex tasks without blocking your terminal.

Setup and Authentication

Claude Code

npm install -g @anthropic-ai/claude-code
claude
Enter fullscreen mode Exit fullscreen mode

First run opens browser auth if you have Claude.ai Pro or Max. Alternatively, set ANTHROPIC_API_KEY for direct API access.

Gemini CLI (API key mode — still works)

npm install -g @google/gemini-cli
export GEMINI_API_KEY=your_key_here
gemini
Enter fullscreen mode Exit fullscreen mode

Antigravity CLI

npm install -g @google/antigravity-cli
agy
Enter fullscreen mode Exit fullscreen mode

Antigravity authenticates via Google account (OAuth) or Vertex AI credentials for enterprise.

Project Memory: CLAUDE.md vs GEMINI.md

Both tools use a markdown file in the project root to give the AI persistent context about your codebase.

Claude Code uses CLAUDE.md:

# Project: Payment API

## Architecture
- Node.js + Fastify, PostgreSQL via Kysely
- Auth: Bearer JWT (RS256), keys in AWS Secrets Manager
- All money amounts in cents (integer), never floats

## Commands
- `npm run dev` — local dev with nodemon
- `npm test` — Vitest, runs against test DB

## Rules
- Never modify the `payments` table schema without a migration
- All external API calls go through `src/services/`
Enter fullscreen mode Exit fullscreen mode

Gemini CLI uses GEMINI.md with the same format. Antigravity CLI picks up GEMINI.md but also reads ANTIGRAVITY.md if present.

Pricing in 2026

Tool Cost What You Get
Claude Code (Pro) $20/month Sonnet 4, normal usage limits
Claude Code (Max) $100/month Opus 4 + Sonnet 4, higher limits, parallel tasks
Gemini CLI ~$7–20/month via API Gemini 2.0 Flash or Pro with API key
Antigravity CLI Free Replaces Gemini CLI's free tier for personal Google accounts
Antigravity CLI Included In Google One AI Premium, Workspace plans

Context Window

Model Context
Claude Sonnet 4 200K tokens
Claude Opus 4 1M tokens (Max subscription)
Gemini 2.0 Pro 1M tokens
Antigravity (Gemini 3 Ultra) 1M tokens

Google's tooling has had 1M token context since Gemini 1.5. Claude's 1M context requires Opus 4 specifically (Max subscription). For day-to-day coding tasks, 200K is more than enough. For "analyze this entire codebase of 300 files," 1M genuinely matters.

Agentic Capabilities

Claude Code's Strengths

Hooks are Claude Code's standout feature for automation. You can run shell commands on any event — before/after a tool call, when Claude edits a file:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          { "type": "command", "command": "npm run lint:fix" }
        ]
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Every file Claude writes gets auto-linted. This tight integration makes Claude Code feel like a real development environment.

Subagents let Claude Code spin up parallel Claude instances to handle independent subtasks simultaneously. A 15-minute task can run in 5 minutes with three subagents working in parallel — no external orchestration needed.

MCP integration connects Claude Code to external tools — databases, APIs, web browsers — through the Model Context Protocol.

Antigravity CLI's Strengths

Background agents run without blocking your terminal:

agy task "Refactor all API routes to use the new error handling middleware" --background
agy status  # check what's running
Enter fullscreen mode Exit fullscreen mode

Google Search grounding lets Antigravity search Google directly when it needs current documentation or error message lookups — useful for debugging unfamiliar libraries.

Multi-modal input: Pass images, PDFs, or screenshots directly in the terminal and Antigravity processes them natively.

Code Quality: Honest Assessment

Complex multi-file refactors: Claude Code tends to be more reliable for changes spanning 10+ files with interdependencies. It's better at tracking what changed and why across a large operation.

Large codebase analysis: Google's 1M token context gives it an edge for tasks that require loading an entire large codebase at once.

Debugging reasoning: Claude Code explains the root cause, not just the fix. Antigravity tends to give you the fix faster but with less explanation.

When to Use Claude Code

  • Complex refactors across many files
  • Tight automation with hooks (lint, format, test on every write)
  • Already using Claude API in your application
  • Subagents for parallel task execution
  • Team standardized on CLAUDE.md

When to Use Antigravity CLI

  • Very large codebase needing 1M context
  • Google Search grounding for real-time documentation lookups
  • Already in the Google Cloud / Workspace ecosystem
  • Images/PDFs as direct terminal input
  • Background agents for non-blocking long-running tasks
  • Cost priority — Antigravity's free tier for personal accounts

Quick Reference

# Claude Code
npm install -g @anthropic-ai/claude-code
claude                           # start session
claude "fix all TypeScript errors in src/"  # one-shot mode

# Gemini CLI (with API key)
npm install -g @google/gemini-cli
export GEMINI_API_KEY=your_key
gemini "explain what this codebase does"

# Antigravity CLI
npm install -g @google/antigravity-cli
agy                              # interactive session
agy "refactor auth module" --background  # non-blocking
agy status                       # check running agents

# Project memory
CLAUDE.md       → Claude Code
GEMINI.md       → Gemini CLI + Antigravity
ANTIGRAVITY.md  → Antigravity-specific (optional)
Enter fullscreen mode Exit fullscreen mode

In practice, many developers use both: Claude Code for interactive development and serious refactoring, Antigravity CLI for tasks where 1M context or Google Search grounding makes a difference.


Full article at stacknotice.com/blog/claude-code-vs-gemini-cli-2026

Top comments (0)