Module 1 of 10 · CLI Comparison Track
10%
AI CLI Tools Compared  ·  M01

The AI CLI Landscape

Three tools, three philosophies, one mission: bring AI intelligence into your terminal without breaking your flow. This module maps the entire landscape — who built what, how each works under the hood, and when to reach for which.

Claude Code
Gemini CLI
GitHub Copilot CLI
Section 1

Why CLI AI Tools Changed Everything

The Problem, Framed

BEFORE: You hit a cryptic compiler error. You alt-tab to Chrome, type the error into Google, open three Stack Overflow tabs, find a partial answer that targets a different library version, mentally translate it to your specific codebase, switch back to your editor — and discover you've lost your train of thought entirely.

PAIN: Context switching is the developer's silent productivity killer. Every jump to a browser resets your working memory. Research shows it takes an average of 23 minutes to fully regain deep focus after an interruption. Multiply that by every question you Google in a day.

MAPPING: CLI AI tools collapse that loop. The tool already has your files open, knows your project structure, can run your tests to verify a fix, and proposes changes in-place — all without you leaving the terminal. It's not a search engine you query; it's a pair programmer who lives where you work.

The shift from "AI as chatbot" to "AI as terminal agent" happened between 2023 and 2025. GitHub Copilot for the IDE existed since 2021, but the jump to shell-native agents — tools that can read files, write code, execute commands, and iterate on failures — represented a qualitative leap. The three tools in this course represent the state of that landscape as it matures.

Scope of this course

We cover Claude Code, Gemini CLI, and GitHub Copilot CLI as CLI/terminal agents. IDE plugins (VS Code Copilot, Cursor, etc.) are related but distinct products with different architectures and are not covered here.

Section 2

The Three Tools

Each tool was built by a different company, for a slightly different primary use case, and with a different set of bets about what developers actually need from an AI in the terminal.

Launch timeline (2023–2026)
Claude Code
Born 2025 · Anthropic
"Pair programmer with judgment — high code quality, explains its reasoning, asks before doing irreversible things."
Architecture ReAct loop + subagents + hooks; CLAUDE.md project context Model Claude Opus/Sonnet 4 · 200K context window License Proprietary (Anthropic subscription)
Unique: Highest SWE-bench accuracy (80.9%) · Constitutional AI safety · CLAUDE.md context system
Gemini CLI
Born 2025 · Google · Apache 2.0
"Large-context autonomous agent — see your entire codebase at once, act fast, integrate Google services."
Architecture ReAct loop + Plan Mode + Extensions + MCP; GEMINI.md project context Model Gemini 2.5 Flash/Pro · 1M context window License Open-source CLI (Apache 2.0); model requires Google account
Unique: 1M token context window · Google Workspace integration · Free 1,500 req/day on Flash
GitHub Copilot CLI
Born 2023 · Microsoft/GitHub
"Shell command assistant — translate natural language to shell commands, explain commands, suggest fixes."
Architecture Explain + Suggest + Run; context is current shell session Model GPT-4o and Claude Sonnet (rotates); context window varies License Requires GitHub Copilot subscription (individual or enterprise)
Unique: Native GitHub integration · gh copilot suggest · gh copilot explain · GitHub Actions automation
What Just Happened?

You now have a mental model of three different products with three different bets:

  • Claude Code bets on correctness and depth — slower, more deliberate, high accuracy.
  • Gemini CLI bets on context size and speed — 5x larger window, faster iteration, free tier.
  • Copilot CLI bets on shell convenience — not an autonomous agent, but a fluent translator for shell commands.
Section 3

Architecture Deep Dive

Each tool processes your prompts through a distinct pipeline. Understanding these pipelines tells you why each tool behaves the way it does — not just what buttons to press.

User prompt
CLAUDE.md (project context injected) context
ReAct loop — Claude Opus/Sonnet 4 model
Tools: [Read | Write | Bash | WebFetch | Agent] tools
Subagents: spawn parallel Claude instances parallel
Hooks: pre/post tool execution scripts hooks
Result delivered to terminal
User prompt
GEMINI.md (global + project context) context
Plan Mode (optional: separate planning step) oversight
ReAct loop — Gemini 2.5 Flash/Pro (1M ctx) model
Tools: [Files | Shell | WebSearch | MCP | Extensions] tools
Result delivered to terminal
User prompt (natural language)
Shell context (current dir, recent commands) context
GPT-4o / Claude Sonnet (model rotates) model
Suggest: gh copilot suggest "..." suggest
Explain: gh copilot explain "..." explain
Run (with user confirmation)
Key architectural difference

Claude Code and Gemini CLI are agentic — they can take multi-step actions, spawn subprocesses, and iterate without asking you after every step. Copilot CLI is fundamentally a suggestion engine — it proposes a command and waits for you to run it. This isn't a flaw; it's a deliberate design choice for safety in the shell.

Here is what a basic shell interaction looks like in each tool's syntax — notice how differently they handle the same task:

Bash / zsh
# Claude Code — start an agentic session in your project
claude
# Then type: "Find all TODO comments, group them by file, and create GitHub issues for the critical ones"
# Claude reads files, groups results, asks for your GitHub token, creates issues.

# Gemini CLI — same task
gemini
# Then type: "Find all TODO comments, group them by file, and create a summary report"
# Gemini reads files (up to 1M tokens), writes report.

# GitHub Copilot CLI — suggest a shell command to find TODOs
gh copilot suggest "find all TODO comments in this repo and print them with file paths"
# Copilot suggests: grep -rn "TODO" . --include="*.py" --include="*.js"
# You press Enter to run it.
PowerShell
# Claude Code — start a session (PowerShell, Windows)
claude
# Prompt: "Find all TODO comments, group by file, create issues for critical ones"

# Gemini CLI — start a session
gemini
# Prompt: "Find all TODO comments and write a summary report"

# GitHub Copilot CLI — suggest a PowerShell command
gh copilot suggest "find all TODO comments in this repo with file paths"
# Copilot suggests: Get-ChildItem -Recurse -Include *.py,*.js |
#   Select-String -Pattern "TODO" | Select-Object Path, LineNumber, Line
# You confirm and run.
Section 4

Real-World Performance

The canonical benchmark for coding agents is SWE-bench Verified. It measures whether an agent can autonomously resolve a real GitHub issue — no hints, no partial credit. It's the closest we have to a standardized measure of "can this thing actually fix my code?"

SWE-bench Verified scores — autonomous issue resolution

Note: GitHub Copilot CLI is not designed for autonomous issue resolution and is not benchmarked on SWE-bench. Gemini score from Google's reported figures for Gemini 2.5 Pro in agent settings.

Metric Claude Code (Opus 4) Gemini CLI (2.5 Pro) Copilot CLI
SWE-bench score 80.9% ★ 63.8% N/A (not agentic)
Context window 200K tokens 1M tokens ★ ~128K tokens (varies)
Free tier No (subscription) 1,500 req/day ★ (Flash) Requires Copilot plan
Open source No CLI is Apache 2.0 ★ No
Autonomous multi-step Yes (subagents) Yes (Plan Mode) Limited (suggest only)
Google Workspace Via MCP tools Native ★ No
GitHub integration Via gh CLI Via extensions Native ★
Benchmark ≠ Daily Productivity

SWE-bench measures autonomous bug-fixing accuracy. But your daily productivity is also shaped by context window size (matters for large monorepos), iteration speed (Flash is fast), free tier generosity (matters for solo devs), and ecosystem integration. The "best" tool depends on your specific workflow — which is exactly what this course helps you determine.

Section 5

Philosophy Differences

Architecture explains how each tool works. Philosophy explains why it makes the trade-offs it does. These three tools have meaningfully distinct world-views about what a "good" AI coding assistant should be.

Claude Code
"Careful collaborator"

Asks before performing destructive operations. Shows its reasoning before acting. Prefers correctness over throughput — it will stop and ask if something seems wrong rather than barrel forward.

Best when: correctness matters more than speed. Production systems, public APIs, code where a mistake costs money.

Gemini CLI
"Fast autonomous agent"

Optimized for throughput and large-scope operations. Acts with minimal friction by default. Plan Mode gives you oversight when you explicitly want it — but the default is "go."

Best when: you're doing large refactors, batch operations across many files, or need to read a huge codebase all at once.

Copilot CLI
"Shell translator"

Not trying to be an autonomous agent. It translates natural language into shell commands, explains commands you don't understand, and makes the terminal feel fluent. Intentionally conservative.

Best when: you mostly need shell command help and already pay for Copilot for your IDE.

A note on "agentic safety"

Claude Code's "careful collaborator" philosophy is a direct result of Anthropic's Constitutional AI research — the model is trained to be cautious about irreversible actions (deleting files, pushing to main, making API calls that cost money). Gemini's aggressiveness reflects Google's bet that developers want throughput. Neither is wrong — they're different bets on developer preferences.

Section 6

Context File Comparison

All three tools support a "project instructions" file — a markdown file you drop in your repository that tells the AI about your codebase, coding standards, and preferred behavior. This is one of the most important patterns in AI-assisted development: the AI reads your docs before it reads your code.

Tool Project File Global File Scope
Claude Code CLAUDE.md ~/.claude/CLAUDE.md Project + global override
Gemini CLI GEMINI.md ~/.gemini/GEMINI.md Project + global override
Copilot CLI .github/copilot-instructions.md Not supported Project only

The patterns are nearly identical between Claude Code and Gemini CLI — which means the skills you learn writing one transfer directly to the other. Here's a side-by-side of what a real context file looks like:

CLAUDE.md
# Project: Payment Service

## What this does
Stripe integration for subscription billing.
Python 3.12, FastAPI, PostgreSQL.

## Key rules
- NEVER commit .env files
- All DB migrations must be reversible
- Tests required for every endpoint
- Use pydantic v2 models (not v1)

## Run locally
```
uvicorn main:app --reload
pytest tests/ -v
```

## Deployment
- Staging: push to `develop`
- Prod: PR to `main`, requires 2 reviews
GEMINI.md
# Project: Payment Service

## What this does
Stripe integration for subscription billing.
Python 3.12, FastAPI, PostgreSQL.

## Key rules
- NEVER commit .env files
- All DB migrations must be reversible
- Tests required for every endpoint
- Use pydantic v2 models (not v1)

## Run locally
```
uvicorn main:app --reload
pytest tests/ -v
```

## Deployment
- Staging: push to `develop`
- Prod: PR to `main`, requires 2 reviews
Key insight: portable context

Because CLAUDE.md and GEMINI.md follow the same conventions, many teams maintain a single "project context" document and symlink it. When you write a good CLAUDE.md, you're also writing a good GEMINI.md. We cover context file best practices in depth in M03.

Section 7

Decision Framework

Knowing the tools is only useful if you know when to use them. Here's the decision logic distilled from real production teams who have adopted these tools at scale.

Use Claude Code when:
  • Code correctness is critical — production systems, public-facing APIs, financial logic
  • You're doing complex multi-step refactoring with many interdependencies
  • You want to understand WHY a change is being made, not just see the diff
  • You need subagents for parallel tasks — write tests while writing implementation
  • Security and safety guardrails matter more than raw throughput
Use Gemini CLI when:
  • Working in a large monorepo (>100K lines) where 200K context isn't enough
  • You need Google Workspace automation — Docs, Sheets, Gmail integration
  • You want a generous free tier for solo or hobby projects (1,500 req/day)
  • Bulk operations across many files: rename, migrate, reformat at scale
  • You prefer open-source tooling you can inspect and modify
Use Copilot CLI when:
  • You need quick shell command suggestions — "how do I grep for X in Y"
  • You're already paying for GitHub Copilot for your IDE
  • GitHub Actions, PR automation, and workflow file generation is your focus
  • You want minimal setup — already authorized via gh auth login
Use a hybrid approach when:
  • Large codebase: Gemini CLI to read the whole repo, Claude Code to make precise changes
  • Mixed team: some devs prefer Claude's explanation style, others want Gemini's speed
  • Cost optimization: Gemini's free tier for exploration, Claude for production tasks
  • GitHub-heavy workflows: Copilot for PR/Actions, Claude for implementation
What Just Happened?

You have a complete mental model of the AI CLI landscape. You can now answer:

  • What are the three major AI CLI tools and who makes each?
  • What is SWE-bench and why does Claude Code lead it?
  • What is the difference between an agentic tool (Claude, Gemini) and a suggestion tool (Copilot)?
  • When would you reach for each tool in a real team setting?

Next module (M02) covers installation and first-run setup for all three tools — including getting your API keys, configuring your shell, and writing your first CLAUDE.md.

Knowledge Check

Test your understanding of the AI CLI landscape — 6 questions.

Question 1 of 6
What does the SWE-bench Verified benchmark specifically measure?
Correct. SWE-bench presents ~300 real GitHub issues. The agent must produce a patch with no hints, and that patch must make previously failing tests pass. It's an end-to-end measure of autonomous coding ability, not just text generation quality.
Question 2 of 6
What is the primary advantage of Gemini CLI's 1M token context window compared to Claude Code's 200K?
Correct. A 1M token context window means Gemini can ingest a codebase of roughly 750,000 words in one shot — a large monorepo can fit entirely in context. Claude Code's 200K limit means very large codebases must be read in chunks, which can cause the model to miss cross-file dependencies.
Question 3 of 6
What is Plan Mode in Gemini CLI?
Correct. Plan Mode inserts a checkpoint between "model decides what to do" and "model does it." You see the plan, can edit or reject it, then approve. It gives you the oversight of a more cautious tool without sacrificing Gemini's speed on routine tasks where you trust it to proceed.
Question 4 of 6
Which of the following is the MOST accurate description of GitHub Copilot CLI's core design philosophy?
Correct. Copilot CLI's core loop is: you describe what you want in English → it suggests the shell command → you review and run it. It is intentionally not agentic. This makes it safer for shell operations and lower-friction for developers who want command help without granting an AI broad file system access.
Question 5 of 6
A developer is working on a 500K-line Python monorepo and needs to migrate all usages of a deprecated internal library to a new one. Which tool is best suited for this task and why?
Correct. A 500K-line codebase exceeds Claude Code's 200K context window — it would need to read the codebase in chunks, risking missed usages. Gemini CLI's 1M window can hold the entire codebase in one context, making it able to find ALL usages before writing any migration code, which is critical for a correct migration. Copilot CLI could suggest the right grep/sed command, but wouldn't autonomously do the full migration.
Question 6 of 6
The context files CLAUDE.md (Claude Code) and GEMINI.md (Gemini CLI) share the same format. What is the most important practical implication of this?
Correct. Because both files follow identical markdown conventions — project description, coding rules, run commands, deployment notes — a team that writes a good CLAUDE.md can symlink or copy it as GEMINI.md with minimal changes. This is a real productivity multiplier for teams that use both tools, and it means your investment in writing good context files compounds across both ecosystems.