22 - Copilot CLI GA and Agent Mode Autopilot: Terminal and VS Code
On February 25, 2026, GitHub Copilot CLI reaches general availability (GA) for all tiers, including Free. Together with the Autopilot tier in Agent Mode of VS Code (March 2026), nested subagents and session forking, Copilot evolves from a terminal assistant to a complete, terminal-first, IDE-first agent platform.
What You Will Learn
- Install Copilot CLI via npm and set up GitHub authentication
- Use the Explore agents (fast semantic search) and Task agents (command execution)
- Enable Autopilot tier in VS Code for automatic approvals
- Manage nested subagents and session forking for multi-step pipelines
- Integrate custom MCP server and configure web_fetch allowlist
- Compare Copilot CLI with Claude Code CLI for your workflow
GitHub Copilot Series Overview
This is article #22 in the "GitHub Copilot" series (19 previous articles + 2 new).
- 1-10: Fundamentals (intro, features, VS Code basics, code review, completions)
- 11-15: Integration (chat mode, enterprise, performance tuning)
- 16-19: Advanced models (multi-model support, context awareness, vision API)
- 20-21: Autonomous agency (Agent Mode preview, planning phase)
- 22 ← you are here: CLI GA + Autopilot + Nested Subagents
- 23: MCP Shared (Anthropic + GitHub Protocol Alignment)
- 24: Pricing & Quota Management
- 25-26+: Use Cases (DevOps, ML Ops, Security)
Intro: Copilot in Terminal and Standalone Agent Mode
When GitHub launched the first version of Copilot in 2021, it was an IDE assistant: write comments,
receive completions. In 2024, it arrived gh copilot, an extension for GitHub CLI with
gh copilot suggest e gh copilot explain-but still conversational and
single-shot, not standalone.
On September 25, 2025, GitHub announced Copilot CLI in public preview: a real agent terminal, which could read the codebase, write code, execute commands and iterate autonomously on multi-step tasks. Five months of user feedback plus hundreds of improvements, and on February 25, 2026 the general availability (GA).
At the same time, VS Code evolves Agent Mode (preview February 2025) verse three tiers of autonomy: Default (manual approval), Bypass Approvals, and above all Autopilot (March 2026), which lets the agent self-approve and retry without human interruption.
The result: the terminal becomes your main IDE. No more "open VS Code to write code", but "run `copilot plan` and watch the agent do the entire refactoring in 90 seconds".
Death of gh-copilot: The Old Guard (Deprecation October 25, 2025)
For those who have used gh copilot from 2024, bad news: it is deprecated.
Deprecation timeline:
- October 25, 2025: Official deprecation announcement
- February 28, 2026: Not installable on GitHub CLI 2.65.0+
- June 30, 2026: API endpoint `/repos/{owner}/{repo}/copilot/chat` removed
The reason is simple: gh copilot it was single-turn, conversational.
@github/copilot-cli it is multi-turn, agentic, and does not need the GitHub CLI wrapper.
Install via npm and you have everything you need.
Migration Guides
If you use gh copilot Today:
# Vecchio (deprecato)
gh copilot suggest "write a unit test for UserService"
gh copilot explain "what does this bash script do?"
# Nuovo (Copilot CLI GA)
npx @github/copilot-cli explore
# Poi: "find all auth logic in UserService"
# Poi: "write tests"
# Copilot autonomamente suggerisce, esegue, itera
The difference is not cosmetic: with gh copilot you asked, you waited for an answer,
then you copied and pasted into your editor. With @github/copilot-cli, ask and Copilot
executes what you need (explore the codebase, read files, run tests, commit).
GitHub Copilot CLI GA (February 25, 2026)
On February 25, 2026, GitHub Copilot CLI reaches official GA. Available for:
- GitHub Copilot Free: ✅ 2 mil tokens/month free
- GitHub Copilot Pro: ✅ 8 mil tokens/month (US$20/month)
- GitHub Copilot Pro+: ✅ 16 mil tokens/month (US$30/month)
- GitHub Copilot Business/Enterprise: ✅ Org-wide pool with Agent Control Plane
Installation
# Prerequisiti: Node.js 18+
npm install -g @github/copilot-cli
# Login
copilot auth login
# Verifica
copilot -v
# copilot version 1.0.0 GA (25 febbraio 2026)
Copilot Interactive session
Start an interactive session in your repo:
cd ~/my-project
copilot
# Entra in interactive prompt
> /explore "find all JWT validation logic"
# Copilot scannerizza il codebase via semantic search (RediSearch-like)
# Ritorna 3-5 file rilevanti con preview
> /task "run unit tests for auth module"
# Copilot automaticamente:
# 1. Identifica come lanciare i test (npm test --testPathPattern=auth)
# 2. Esegue il comando
# 3. Mostra output
# 4. Se fail, suggerisce fix
> /plan "refactor UserService to use dependency injection"
# Switch a Plan mode (Shift+Tab): Copilot chiede dettagli,
# propone structured plan (5-7 step), aspetta approvazione, esegue
Multi-Model Support
Unlike Copilot VS Code which uses Claude Sonnet by default, Copilot CLI lets you choose the template per session:
copilot --model claude-opus-4.6
# o
copilot --model gpt-5.3-codex
# o
copilot --model gemini-3-pro
# o (per task rapidi)
copilot --model claude-haiku-4.5
Strategic choice: Opus for complex refactoring tasks (it is the most reasonable model), Haiku for quick fixes (3x cheaper), GPT-5.3-Codex if your codebase is in Python/Go (traditionally strong on that language).
Specialized Subagents: Explore and Task (January 2026)
In January 2026, GitHub releases specialized subagents that Copilot calls automatically based on the context of the request.
Explore Agent
Scope: quick codebase analysis via semantic search, NOT full-file-read.
Use case: "where is the authentication logic?"
> /explore "where is JWT token validation?
# Explore agent in parallel scans:
# - file names (matching "jwt", "token", "auth")
# - import chains
# - function signatures (patterns come "validate", "verify")
# Ritorna in 2-3 secondi: AuthFilter.java, JwtService.ts, auth.middleware.py
# Senza leggere full file, solo struttura
> /explore "find all database queries that join users and posts"
# Semantic search su AST: trova 8 query su 340 file
# Output conciso
Advantage vs /ask "where is X": Explore is specialized and fast (2-3 seconds on 50K file codebase). It's your turbo semantic grep.
Task Agent
Scope: run terminal commands (build, test, linting) and interpret the output.
Use case: "run auth module tests, and if they fail, suggest fix"
> /task "run the test suite for UserService"
# Task agent:
# 1. Legge package.json / Maven POM → detect test runner (Jest / Maven / pytest)
# 2. Esegue `npm test -- --testNamePattern=UserService` (o equivalente)
# 3. Riceve output: 3 test pass, 2 fail
# 4. Legge i test falliti
# 5. Propone fix (tipicamente: mock non ok, asserts sbagliati, setup incompleto)
# 6. Se approvi, applyga il fix e re-esegue
> /task "build the Docker image and push to ECR"
# Task agent:
# 1. Trova Dockerfile
# 2. Esegue `docker build -t my-app:latest .`
# 3. Esegue `docker push 123456789.dkr.ecr.us-east-1.amazonaws.com/my-app:latest`
# 4. Monitora output per errori (auth missing, tag non valido)
# 5. Se fail, suggiere chiaramenti (account ID, IAM role)
Auto-compaction token: When the session approaches the token limit (e.g. 90% of 8M for Pro), Copilot automatically compacts the history: keeps recent commands and key results, discards older verbose chat.
Web Fetch Tool and Allowlist Security
Copilot CLI can invoke fetch() to read online documentation:
"Do I need the signature of this method from the official docs?".
To be safe, you can create a URL allowlist that Copilot can read, and a denylist of prohibited domains.
Configuration
In your repo, create .copilot/settings.json:
{
"web_fetch": {
"allowed_urls": [
"https://docs.spring.io/**",
"https://angular.dev/**",
"https://fastapi.tiangolo.com/**",
"https://nodejs.org/docs/**",
"https://docs.github.com/**"
],
"denied_urls": [
"https://internal-company-wiki.slack.com/**",
"https://aws-account-info.internal/**"
]
}
}
From now on, if you ask "what is the signature of @PostMapping in Spring Boot?", Copilot fetches the official doc (allowed), but can NOT access internal Slack or AWS account pages.
Real use case: API Spec Integration
> /task "integrate our REST API with Stripe API for payment processing"
# Copilot:
# 1. Legge il tuo OpenAPI spec da /docs/api-spec.yaml (locale)
# 2. Fetch Stripe API docs da https://stripe.com/docs/api (allowed)
# 3. Scrive il client code che connette i due
# 4. Esegue test (mocka Stripe via testcontainers)
# 5. Genera GitHub issue "Stripe webhook verification needed"
# Ma: se provi a far fetch https://internal-slack-audit.company.internal,
# Copilot rifiuta (denied_urls match)
ACP Support: Agent Client Protocol (28 January 2026)
Agent Client Protocol (ACP) is the "MCP for agents": allows third parties to integrate as custom endpoint agents for Copilot CLI.
Launched January 28, 2026 via GitHub Changelog, ACP enables:
- Custom agent endpoints: write a microservice that implements ACP, Copilot CLI calls it
- Tool discovery: your agent exposes tools (e.g. "deploy to Kubernetes", "query analytics DB") as tools
- Multi-provider orchestration: an ACP agent can manage tasks on Zed editor, custom CI pipeline, Vercel, etc.
Example: Custom Deployment Agent
// deploy-agent.ts - ACP endpoint
import Fastify from 'fastify';
const app = Fastify();
// ACP Tool: deploy-to-staging
app.post('/tools/deploy-staging', async (req, res) => {
const { repo, branch, version } = req.body;
// Logica: trigger deployment via Vercel API
const result = await vercelApi.deployPreview({
repo,
ref: branch,
version
});
return {
status: 'success',
preview_url: result.url,
logs: result.logs
};
});
// ACP Discovery: quali tool offri?
app.get('/acp/tools', (req, res) => {
return {
tools: [
{ name: 'deploy-staging', description: 'Deploy to Vercel Preview' },
{ name: 'run-e2e-tests', description: 'Trigger E2E test suite' },
{ name: 'check-perf-regression', description: 'Run performance benchmark' }
]
};
});
app.listen({ port: 3000 });
Then, in your repo, you register this agent in .copilot/settings.json:
{
"acp_agents": [
{
"name": "deployment",
"endpoint": "http://localhost:3000",
"auth": { "type": "bearer", "token": "${DEPLOY_AGENT_TOKEN}" }
}
]
}
Now, when you ask /task "deploy this change to staging",
Copilot automatically delegates to your custom agent, which deploys via Vercel API.
Real use case in the company: developers ask "deploy this feature branch to staging" from terminal, Copilot calls the internal agent that checks permissions (Okta), tracks audits (Datadog), executes deploys (Kubernetes), and notifies #deployments Slack. Todo orchestration, zero manual CLI.
VS Code Agent Mode: from Preview to Autopilot (March 2026)
VS Code Copilot Agent Mode (preview February 2025) evolves towards three tiers of autonomy in March 2026. The evolution reflects an increase in confidence: with experience, you learn when it is safe to approve automatically.
Three Tiers of Autonomy
| Tiers | Behavior | Use Case |
|---|---|---|
| Default | Copilot suggests edits, commands, refactorings. You approve every change. | Critical, security-sensitive, learning phase codebase |
| Bypass Approvals | Copilot auto-approves file edits (not shell commands). You self-approve commands with Shift+Enter. | Feature development, bug fixing, safe refactoring |
| Autopilot | Copilot auto-approves file edits AND shell commands. If error, retry automatically (max 3 times). Zero interruptions. | Trusted tasks, routine automation, build pipelines, CI/CD integration |
Enable Autopilot in VS Code
Settings → Copilot Agent Mode → Agent Approval Level → Autopilot
Or, go settings.json:
{
"github.copilot.agentMode.enabled": true,
"github.copilot.agentMode.approvalLevel": "autopilot",
"github.copilot.agentMode.maxRetries": 3,
"github.copilot.agentMode.timeoutSeconds": 120
}
Security and Limits
Also in Autopilot, Copilot NOT can:
- Run
rm -rf /or any command that has global destructive effects - Release to main without branch protection
- Disable GitHub Actions or security check
- Read secrets from
.env(sandboxed)
In essence: Copilot is sandboxed to your working directory. Does not have root access, cannot modify system config, cannot access your AWS credentials (they are validated at IDE level, not switched to Copilot).
Real Experience: Class Refactoring
With Autopilot enabled:
Prompt: "Refactor UserService to use dependency injection instead of direct new() calls"
Copilot Agent:
1. [AUTO] Legge UserService.java (30 file nella classe)
2. [AUTO] Identifica 12 istanze di new NotificationService(), new CacheClient(), ecc.
3. [AUTO] Scrive modifiche: aggiunge @Autowired private NotificationService ns;
4. [AUTO] Esegue `mvn test` → 2 test fail (mock injection issue)
5. [AUTO] Legge test error
6. [AUTO] Modifica test: aggiunge @MockBean NotificationService mock;
7. [AUTO] Re-esegue `mvn test` → PASS ✓
8. [AUTO] Committa: "refactor(UserService): use DI instead of direct instantiation"
9. [AUTO] Apre PR su GitHub (se configured)
Total time: 45 secondi, zero interruzioni
Without Autopilot (Default tier), the same task takes 8-10 minutes (approve each edit, click "approve command", wait for tests, etc).
Nested Subagents and Session Forking (March 2026)
Nested subagents: one agent calls another agent, who calls a third agent. Automatically orchestrated multi-step pipelines.
Example: Code Review Pipeline
Initial task: "Review this PR and fix any critical issues"
1. Copilot Agent (main) chiama Subagent "code-review"
├─ Analizza cambio: 45 file modificati, 3200 righe added
├─ Esegue static analysis (SonarQube)
├─ Identifica 8 critical issue (SQL injection, memory leak, XSS)
└─ Genera list: "[CRITICAL] SQL injection in UserRepository.java:234"
2. Copilot Agent (main) delega a Subagent "fix-critical"
├─ Legge SQL injection line
├─ Propone PreparedStatement fix
├─ Scrive test che verify fix
└─ Ritorna: "fixed 8/8 critical issues, all test green"
3. Copilot Agent (main) chiama Subagent "performance-check"
├─ Esegue benchmark (Apache JMeter)
├─ Detecta +15% latency su UserController
├─ Propone caching strategy
├─ Scrive Redis integration test
└─ Ritorna: "latency mitigated, cache hit rate 92%"
4. Copilot Agent (main) riassume:
"PR reviewed, 8 critical fixes applied, 1 performance improvement. Ready to merge."
Total orchestration: 3 min 45 sec, zero human review
Session Forking
During a Copilot session, you can "fork" at a critical point to explore alternatives without touching the main branch.
# Sessione principale
> /plan "refactor UserService to reactive (Project Reactor)"
# Copilot propone plan: 7 step
# Tu: "aspetta, mostrami due approcci: uno con Reactor, uno con Coroutine di Kotlin"
# Copilot: [FORK] Crea sessione alternativa
# Sessione A (fork 1): Reactor approach
> [A] /implement "use Project Reactor"
> [A] /task "run performance test"
# Result: 150ms latency, 98% memory stable
# Sessione B (fork 2): Kotlin Coroutine approach
> [B] /implement "use Kotlin suspend functions"
> [B] /task "run performance test"
# Result: 145ms latency, 92% memory stable
# Sessione main: tu compari i due fork
# Decidi: "merge fork B, Kotlin coroutine è leggermente migliore"
> /merge fork-B
# Fine: sei tornato al ramo principale con l'implementazione Kotlin
Advantage: explore two implementation strategies in parallel, without reverting to Git. It is a "temporary branch" within the Copilot session, with complete context retention.
Comparison with Claude Code Sub-Agents
Claude Code (Anthropic, from December 2024) has .claude/agents/ to define specialized sub-agents (planner, code-reviewer, tdd-guide, architect, etc.).
Copilot nested subagents vs Claude Code agents:
| I wait | Copilot Nested | Claude Code |
|---|---|---|
| Definition | Implicit: Copilot detects context, calls specialized subagent (Explore, Task, Review) | Explicit: `.claude/agents/` files with custom instructions |
| Orchestration | Automatic, task-based semantics | Manual: You specifically invoke /planner, /code-reviewer, etc |
| Parallelization | Native (Copilot launch 2-3 subagents in parallel) | Sequential (one after the other) |
| Session persistence | Per session (forking available) | For conversation (cross-message context) |
Verdict: Copilot nested subagents is more "magic" (less config, more automatic), but less customizable. Claude Code agents is more "explicit" (write the rules), more flexible. Use Copilot CLI for standard tasks (refactoring, testing, deployment), use Claude Code agents for custom corporate workflows (audit security, compliance check, domain-specific planning).
Inline Agent Mode JetBrains: Preview (24 April 2026)
On April 24, 2026 (A DAY AGO!), GitHub announces Copilot Inline Agent Mode for JetBrains (IntelliJ, PyCharm, WebStorm, RubyMine, GoLand, CLion) in preview.
As of now, JetBrains developers have parity VS Code: inline agent with suggestion, approval, and (coming soon) auto-approve toggle.
JetBrains Setup
IntelliJ IDEA 2024.2 and later:
- File → Settings → Plugins → Marketplace → Search for “GitHub Copilot”
- Install official GitHub plugin
- Settings → GitHub Copilot → Enable Agent Mode ✓
- Settings → GitHub Copilot → Global Auto Approve (toggle, default OFF)
- Restart IDE
Now, when you press Cmd+I (macOS) / Ctrl+I (Linux/Windows)
and write "refactor this class to use builder pattern", Copilot suggests the changes
inline in the file, just like VS Code.
Global Auto Approve Setting
Unlike VS Code which has session-level approvalLevel (Default / Bypass / Autopilot), JetBrains for now only has Global Auto Approve toggle:
- OFF (default): Copilot proposes change, you click "Accept" or "Reject"
- ON: Copilot auto-approves edit files (not shell commands, which are not in JetBrains)
JetBrains Roadmap (May-June 2026): add Autopilot-like tier, nested subagent delegation, session memory tracking.
Next Edit Suggestions (Enhancement)
With the April 2026 release, JetBrains Copilot gets better "Next Edit Suggestions": after you accept a change, Copilot proposes the next logical change (e.g. if you add parameter to function, Copilot offers to add null check, test, etc.).
Stato iniziale: UserService.getUser(id)
Tu: Copilot inline "add email parameter"
Copilot propone:
public User getUser(id, email) { ... }
Tu accetti ✓
Copilot suggerisce next edit:
"Consider adding email validation before query"
Tu accetti ✓
Copilot suggerisce:
"Add new test case for email validation"
Zero prompt, zero "per favore", zero "Cmd+I": suggeriment logici basati su AST e task context.
Comparison with Claude Code CLI
Anthropic has launched Claude Code CLI (November 2024) as an alternative to GitHub Copilot CLI. December 2024 was the month of “AI agent hype,” and now both GitHub and Anthropic have CLI agent terminal-first.
Head-to-Head Comparison
| Features | GitHub Copilot CLI | Claude Code CLI |
|---|---|---|
| CLI Release | Public preview: 25 September 2025 | GA: Feb 25, 2026 | Private beta: Nov 2024 | Public: Mar 2025 |
| Default Model | Claude Sonnet 4.6 (selected by GitHub) | Claude Opus 4.5 (max reasoning) |
| Model Choice | ✓ Multi-model (Anthropic, OpenAI, Google) | ✗ Claude-only (no GPT, no Gemini) |
| Sub-agents | ✓ Nested (Explore, Task, Review auto-delegate) | ✓ Explicit (.claude/agents/ custom) |
| Session Forking | ✓ (GA March 2026) | ✓ (native to Anthropic philosophy) |
| IDE Integration | ✓ VS Code + JetBrains (April 2026) | ✓ VS Code + custom Zed (native) |
| Autopilot Tier | ✓ (March 2026 GA) | ✓ (extended-thinking only, default conservative) |
| Price | Free (2M token/month) / Pro (8M/month, $20) | Free (embedded in Claude.ai) / Pro ($20/month) |
| ACP/MCP Support | ✓ ACP (custom endpoint agent) | ✓ MCP (model context protocol, shared with GitHub) |
Which one to choose?
-
Choose Copilot CLI if:
- You already use GitHub Enterprise (native integration, Agent Control Plane org-wide)
- Do you want to choose the template (Opus for refactoring, Haiku for quick fix, GPT-5.3 for Python)
- You love terminal (Copilot CLI is terminal-first, zero IDE)
- You work in a team and need to audit what the agent does (GitHub Enterprise audit logs)
-
Choose Claude Code CLI if:
- Prefer Opus above all (native extended thinking, highest quality)
- Use Zed editor (Anthropic natively supports Zed)
- Write custom .claude/agents/ for enterprise proprietary workflows
- You don't use GitHub Enterprise (you're indie/startup, no org-wide integration needed)
My advice (February 2026): if you are in company with GitHub Enterprise and team, Copilot CLI + Autopilot + Agent Control Plane. If you're indie, Claude Code CLI is excellent (Opus is superior to Sonnet on reasoning complexity). If you want the best of both, switch between: Copilot CLI for task routines (test, build, deploy), Claude Code for strategic tasks (architecture, refactoring major, design review).
Conclusion
On February 25, 2026, GitHub Copilot CLI hits GA. It's no longer a beta, it's no longer experimental: it's your terminal that becomes a junior developer competent, who knows how to refactor code, run tests, deploy applications, write tests, read documentation, all independently.
With Autopilot tier (VS Code March 2026) and Autopilot-like approval model (JetBrains April 2026), the paradigm shift is complete: no longer "open IDE and write", but "give command and Copilot executes".
In this series of 22 articles on GitHub Copilot, we've seen the evolution from "autocomplete suggesting line of code" to "autonomous agent performing class refactoring".
Next article (23): MCP Shared - how Anthropic and GitHub have standardized the extensibility protocol, and why this opens up new possibilities for custom agents.
References
Official documentation
- GitHub Copilot CLI is now generally available (25 Feb 2026)
- GitHub Copilot CLI: Enhanced agents, context management (14 Jan 2026)
- VS Code: Introducing Copilot Agent Mode (Feb 24, 2025)
- VS Code: Agent Mode Update (7 Apr 2025)
- GitHub Copilot in VS Code: March 2026 releases
- Deprecation: gh copilot extension (25 Oct 2025)
Read Also in the Series
- Article 20: Agent Mode Preview - Getting started with multi-step tasks
- Article 21: Planning Phase - How Copilot structures implementation plans
- Article 23 (next): MCP Shared - Anthropic + GitHub Protocol Alignment
- Article 24 (coming): Pricing & Quota Management - Token limits, cost optimization
Related Resources
- GitHub Copilot CLI GitHub repo: github/copilot-cli
- Claude Code CLI documentation: anthropic.com
- MCP (Model Context Protocol): modelcontextprotocol.io
- Zed editor (Agent Mode native): zed.dev
Commenti
Caricamento commenti...
Sign in to comment