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.
What "Agentic" Really Means
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.
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.
# 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:
## 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
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.
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.
$ 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)
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)
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.
# 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.
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.
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.
A: extract interfaces
B: write tests
C: update docs
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.
Safety Models: Confirmation Gates Compared
Greater autonomy requires better safety architecture. How do these tools prevent an AI mistake from cascading into a disaster?
| 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) |
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.