Module 6 of 10 · CLI Comparison Track
60%
AI CLI Tools Compared  ·  M06

Agentic Workflows

The biggest architectural divide in AI CLI tools is between tools that act autonomously and tools that suggest actions. This module maps the full spectrum: Claude Code's parallel subagents, Gemini CLI's Plan Mode routing, and why Copilot CLI is architecturally not agentic.

Claude Code
Gemini CLI
GitHub Copilot CLI
Section 1

What "Agentic" Really Means

The critical distinction

BEFORE: "AI assistant" meant a chatbot that answers questions. You ask, it responds, you copy-paste the answer, you run it yourself. The AI never directly touches your files, your terminal, or your codebase.

PAIN: The copy-paste loop is a context switch in disguise. You're still the integration layer between what the AI knows and what your system does. Every step requires you to translate, verify, and execute — defeating much of the productivity gain.

MAPPING: An agentic tool closes that loop. It reads your files directly, executes commands, checks the output, iterates on failures, and reports back. You become the approver, not the executor. Claude Code and Gemini CLI are agentic. Copilot CLI is not — by design.

Autonomy spectrum — from suggestion to fully autonomous agent
Section 2

Claude Code Subagents

Claude Code's most powerful — and most distinctive — capability is spawning subagents: parallel Claude instances that work on independent parts of a task simultaneously. This is analogous to a team of engineers all working on different files at once, rather than one engineer working sequentially.

Claude Code — subagent pattern
# Inside a Claude Code session:
> Run a security audit on src/ in parallel with running the test suite,
>   then consolidate the results and create a single report.

# Claude's internal execution:
# ┌─ Orchestrator Claude ─────────────────────────────────────────────────┐
# │                                                                       │
# │  Task: spawn 2 parallel subagents                                     │
# │                                                                       │
# │  ┌─ Subagent A (security audit) ───────┐                              │
# │  │  /read src/**/*.ts                   │                              │
# │  │  /bash semgrep scan (OWASP rules)    │  ← runs simultaneously with B│
# │  │  Report: 3 findings                  │                              │
# │  └─────────────────────────────────────┘                              │
# │                                                                       │
# │  ┌─ Subagent B (test suite) ────────────┐                             │
# │  │  /bash npm test -- --coverage        │  ← runs simultaneously with A│
# │  │  Report: 47/50 passing, 82% coverage │                             │
# │  └─────────────────────────────────────┘                              │
# │                                                                       │
# │  Orchestrator consolidates both reports → writes REPORT.md            │
# └───────────────────────────────────────────────────────────────────────┘

# Real-world time savings: 45s (parallel) vs 90s (sequential)

In your CLAUDE.md, you can instruct Claude to use subagents by default for certain task types, or set guard rails on how many parallel instances are permitted:

CLAUDE.md — subagent configuration
## Agent behavior
When asked to run tests AND implement features simultaneously, use parallel subagents.
Max concurrent subagents: 3 (respect API rate limits)

## Subagent tasks that are safe to parallelize
- Reading multiple files for analysis
- Running test suites
- Linting / type-checking
- Security scanning

## Tasks that must remain sequential (not parallelized)
- File writes to the same file
- Database migrations
- Anything involving git commits
When subagents make a real difference

The classic use case: you ask Claude to "write the implementation AND write the tests." Without subagents, Claude writes the implementation, then writes the tests sequentially. With subagents, it writes both simultaneously, cutting wall-clock time roughly in half. At scale — generating documentation while running CI, auditing security while migrating data — the parallel speedup compounds significantly.

Section 3

Gemini CLI Plan Mode & Model Routing

Gemini CLI's agentic architecture centers on two concepts: Plan Mode for oversight and model routing for efficiency. These complement each other: the Pro model makes smart plans, Flash executes them cheaply.

bash — Plan Mode full flow
$ gemini --plan

> Migrate all Express route handlers from callbacks to async/await in @src/routes/

# Gemini Pro produces a plan:
# ══════════════════════════════════════════════════════════
# PLAN: Migrate Express routes to async/await
# ══════════════════════════════════════════════════════════
# Step 1: Read src/routes/ — identify all callback-based handlers  (Flash)
# Step 2: Generate async/await equivalents for each file           (Flash)
# Step 3: Update error handling to use try/catch instead of next() (Flash)
# Step 4: Run npm test to verify no regressions                    (Flash)
# Step 5: Write MIGRATION.md with a summary of changes             (Flash)
# ══════════════════════════════════════════════════════════
# Approve this plan? [y/N/edit]

y

# Gemini Flash executes steps 1-5 sequentially
# Each step reports its output before the next begins
# If step 4 (tests) fails, Gemini halts and shows you the error

# Model routing in action:
# gemini --model pro    → force Pro for planning-heavy tasks
# gemini --model flash  → force Flash for fast bulk operations
# (default: gemini decides based on task complexity)
PowerShell — Plan Mode
PS> gemini --plan

# Prompt: Migrate all Express routes from callbacks to async/await in @src/routes/

# Gemini produces a 5-step plan (using Pro model)
# You review: Approve? [y/N/edit]
# Type 'y' → Gemini Flash executes each step

# Model routing flag examples:
gemini --model pro    # force Pro (better planning, slower, higher cost)
gemini --model flash  # force Flash (faster, lower cost, 1500 req/day free)
gemini                # auto-route (default)
Plan Mode execution flow — Pro plans, Flash executes
Section 4

Copilot CLI: Not Agentic — By Design

This is one of the most commonly misunderstood points about GitHub Copilot CLI. The tool is not a limited or crippled agent — it is a deliberately non-agentic shell assistant. Understanding this distinction changes how you think about when to use it.

What Copilot CLI's "agentic" limit looks like in practice
# Attempt to use Copilot CLI like an agentic tool:
gh copilot suggest "refactor the entire auth module: extract interfaces, add tests, update docs"

# What Copilot CLI returns:
# Suggestion: (one of these patterns)
#   1. find src/auth/ -name "*.ts" | head -20
#   2. npx tsc --noEmit  # type-check first
#   3. grep -r "interface" src/auth/

# What Copilot CLI does NOT do:
# ✗ Read your auth module files
# ✗ Plan the refactor
# ✗ Generate new interfaces
# ✗ Write test files
# ✗ Update documentation
# ✗ Chain multiple steps autonomously

# The "closest to agentic" Copilot CLI gets:
# gh copilot suggest "step 1: find auth interfaces"  → you run it
# gh copilot suggest "step 2: extract to new file"   → you run it
# gh copilot suggest "step 3: update imports"        → you run it
# Each step is a separate, manually-chained suggestion.
Why this design exists

GitHub Copilot CLI was built primarily as a shell command assistant — to help developers who know what they want to do but don't remember the exact syntax. It is intentionally scoped to "translate this natural language intent to a shell command." This makes it extremely reliable for its intended use case and avoids the class of errors that agentic tools can introduce when they misunderstand your intent. Autonomous agents are powerful but require trust — Copilot CLI's model requires no trust in the AI's judgment because you review every command before running it.

Section 5

Comparison Task: Auth Module Refactor

The definitive agentic benchmark: "Refactor the entire auth module — extract interfaces, add tests, update documentation." Here is how each tool approaches this autonomously.

Claude Code
1. Read src/auth/
2. Analyze structure + types
3. ★ Spawn 3 subagents in parallel:
A: extract interfaces
B: write tests
C: update docs
4. Merge results
5. Run tests → verify
6. Show diff, confirm y/N
Gemini CLI (--plan)
1. Read @src/auth/
2. ★ Pro: generate full plan
3. ★ Show plan → approve?
4. Flash: extract interfaces
5. Flash: write tests
6. Flash: update docs
7. Run tests → verify
Copilot CLI
1. Suggest: grep for exports
2. ★ You run cmd manually
3. Suggest: tsc --noEmit
4. ★ You run cmd manually
5. Suggest: jest --watch
6. ★ You run cmd manually
No autonomous refactor
What Just Happened?

The flow diagrams above show the fundamental difference in how these tools operate:

  • Claude Code: acts autonomously, parallelizes with subagents, shows diff at the end for confirmation.
  • Gemini CLI: plans first (with your approval), then executes sequentially using the faster Flash model.
  • Copilot CLI: manual each step — you are the agent; Copilot is your command suggestion engine.
Section 6

Safety Models: Confirmation Gates Compared

Greater autonomy requires better safety architecture. How do these tools prevent an AI mistake from cascading into a disaster?

Confirmation gate density — how many approval checkpoints per agentic task
Safety Dimension Claude Code Gemini CLI Copilot CLI
Default safety mode Conservative — asks before irreversible actions Aggressive — acts by default; --plan for oversight Maximum — nothing executes without you
Configurable gates CLAUDE.md + .claude/settings.json permissions --plan flag, GEMINI.md rules N/A — architecture enforces manual execution
Parallel subagent risk Possible race conditions on same file — CLAUDE.md rules prevent this No parallel subagents — sequential only N/A
Rollback support Git-aware; shows diffs before writes Plan Mode shows all changes before execution N/A — you own the command; git is your safety net
Training for safety Constitutional AI — safety baked into model training Plan Mode is a structural gate, not model-level Safety via architecture (no autonomous execution)
The Gemini default-aggressive trade-off

Gemini CLI's default mode (without --plan) is "act first." This maximises throughput but means Gemini can write or delete files without a confirmation gate. This is intentional — Google's bet is that developers want speed and will enable Plan Mode when they need oversight. Always run gemini --plan on tasks that involve writing to production configurations, database schemas, or any files not tracked by git.

Knowledge Check

Five questions on agentic architecture, subagents, Plan Mode, and safety design.

Question 1 of 5
What is the primary performance benefit of Claude Code's subagent system?
Correct. The core benefit of parallel subagents is wall-clock time reduction. If writing tests takes 30 seconds and writing implementation takes 30 seconds, sequential execution takes 60 seconds. With two parallel subagents, both complete in approximately 30 seconds — roughly a 2x speedup. This compounds for larger tasks: 5 independent subtasks running in parallel take approximately 1/5 the time of sequential execution.
Question 2 of 5
Gemini CLI uses two different models in Plan Mode. What is each model's role?
Correct. This is a cost and quality optimization. Planning requires complex reasoning about what steps to take, in what order, and how they interact — this is Pro's strength. Execution requires following each step: read this file, make this change, run this command — Flash is fast and cheap at well-defined tasks. By using Pro for planning and Flash for execution, Gemini CLI delivers high-quality plans at lower execution cost than using Pro for every step.
Question 3 of 5
A developer needs to "refactor the entire auth module — extract interfaces, add tests, update docs." They have 45 minutes. Rank the tools from fastest to slowest for completing this autonomously.
Correct. Claude Code spawns 3 subagents in parallel (extract interfaces + write tests + update docs simultaneously), so all three tasks overlap in time. Gemini CLI with Plan Mode executes them sequentially — interface extraction, then tests, then docs — taking roughly 3x longer than parallel execution. Copilot CLI is not autonomous at all for this task: you must manually run each suggested command between each step, and it cannot read your codebase to understand what the interface extraction should produce. Total Copilot CLI time includes all your manual intervention time.
Question 4 of 5
Why is it important to list "tasks that must remain sequential" in your CLAUDE.md when using subagents?
Correct. Parallel execution introduces ordering constraints. If Subagent A writes to app.ts and Subagent B also writes to app.ts simultaneously, you get a race condition — whichever agent finishes last wins, potentially overwriting the other's changes. Database migrations are even more dangerous: two subagents running migrations in parallel can produce an inconsistent schema. CLAUDE.md rules let you explicitly say "never parallelize these task types," giving you the benefits of parallel execution where safe and sequential execution where necessary.
Question 5 of 5
Claude Code's safety model includes "Constitutional AI" baked into the model training. How does this differ from Gemini CLI's Plan Mode safety mechanism?
Correct. The distinction is "internal disposition vs external constraint." Claude is trained with Constitutional AI principles that make it reason about whether an action is reversible, whether it could cause harm, and whether it should ask for confirmation — this is part of the model's values, not a wrapper around it. Gemini CLI's Plan Mode is an architectural mechanism layered on top of the model: the model itself is still "act fast," but Plan Mode intercepts before execution and asks for approval. Both achieve safety, but through fundamentally different mechanisms: trained judgment (Claude) vs structural gate (Gemini Plan Mode).