Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
GitHub Copilot Agent Mode in VS Code agentic development
AI

GitHub Copilot Agent Mode: VS Code Agentic Coding

Deep dive into GitHub Copilot Agent Mode β€” multi-file editing, terminal commands, MCP integration, and parallel sub-agents in VS Code.

LB
Luca Berton
Β· 5 min read

From autocomplete to autonomous agent

GitHub Copilot has evolved far beyond its 2021 roots as a code autocomplete tool. With Agent Mode in VS Code, Copilot now reads your entire codebase, suggests edits across multiple files, runs terminal commands, and responds to compile or test failures β€” all in an autonomous loop until the task is complete.

I attended the GitHub Copilot Dev Days sessions recently, and the trajectory is clear: we are moving from assisted development to agentic development. Here is what that means practically for engineering teams.

What Agent Mode actually does

Agent Mode is not just a smarter chat window. It is an autonomous loop that:

  1. Reads your codebase β€” understands project structure, dependencies, and conventions
  2. Plans multi-step changes β€” breaks complex tasks into incremental edits
  3. Edits across files β€” modifies multiple files in a single operation
  4. Runs terminal commands β€” executes builds, tests, linters
  5. Reacts to failures β€” if a test fails, it reads the error and fixes it
  6. Iterates until done β€” keeps looping until the task succeeds or it needs human input

This is fundamentally different from asking Copilot to β€œwrite a function.” You can now say β€œadd pagination to the blog listing page with tests” and it will modify the component, update the API route, add test cases, run the tests, and fix any failures.

The architecture behind Agent Mode

The Agent Mode architecture in VS Code is built on several layers:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Orchestration Layer       β”‚
β”‚   (Plan β†’ Execute β†’ Validate)  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Parallel Sub-agents         β”‚
β”‚  (Background task delegation)   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    MCP Servers & Extensions     β”‚
β”‚  (External tools & context)     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   VS Code Hooks & Lifecycle     β”‚
β”‚  (Pre/post action triggers)     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Model Layer (Claude/Codex)   β”‚
β”‚  (Reasoning & code generation)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The key capabilities across the stack:

  • Plan β€” structured task decomposition before coding
  • Agent Mode β€” autonomous edit-test-fix loops
  • Custom Agents β€” team-specific extensions for your workflows
  • Skills β€” reusable agent capabilities (test, optimize, review, modernize, deploy)
  • Instructions and AGENTS.MD β€” project-level guidance that shapes agent behavior
  • Parallel Sub-agents β€” delegate sub-tasks to run concurrently
  • MCP (Model Context Protocol) β€” connect external tools, APIs, and data sources

MCP integration: extending the agent’s reach

The Model Context Protocol is what makes Agent Mode truly extensible. MCP servers let you connect Copilot to:

  • Databases β€” query schemas, generate migrations
  • Cloud providers β€” check resource status, deploy infrastructure
  • Monitoring tools β€” pull metrics, analyze incidents
  • Internal APIs β€” interact with your company’s services
  • Documentation β€” search internal wikis and runbooks
{
  "mcp": {
    "servers": {
      "kubernetes": {
        "command": "kubectl-mcp",
        "args": ["--context", "production"]
      },
      "datadog": {
        "command": "datadog-mcp",
        "env": {
          "DD_API_KEY": "${env:DD_API_KEY}"
        }
      }
    }
  }
}

This means you can ask Copilot: β€œCheck the current error rate in Datadog for the payment service, find the likely cause in the codebase, and create a fix” β€” and it will use MCP to pull real metrics, correlate with code, and propose a fix.

AGENTS.MD: project-level instructions

One of the most practical features is AGENTS.MD β€” a file in your repository root that tells Copilot how your project works:

# AGENTS.MD

## Project Structure
- Frontend: React + TypeScript in /src/app
- API: FastAPI in /src/api
- Tests: pytest for API, vitest for frontend

## Conventions
- Use functional components with hooks
- API endpoints follow REST naming
- All database queries go through SQLAlchemy models
- Never commit secrets β€” use environment variables

## Testing
- Run `make test` before suggesting changes are complete
- Frontend tests must cover component rendering and user interactions
- API tests must include happy path and error cases

This is effectively a system prompt for your repository. Every team member’s Copilot instance reads it, ensuring consistent agent behavior across the organization.

Parallel sub-agents

For complex tasks, Agent Mode can spawn parallel sub-agents that work on different parts of the problem simultaneously:

  • One sub-agent refactors the database schema
  • Another updates the API endpoints
  • A third modifies the frontend components
  • All coordinate through the orchestration layer

This mirrors how senior engineers delegate work β€” break the problem down, work in parallel, integrate the results.

Hooks and lifecycle events

VS Code hooks let you customize what happens before and after agent actions:

  • Pre-edit hooks β€” run linters before accepting changes
  • Post-test hooks β€” generate coverage reports
  • Pre-commit hooks β€” enforce style guides and security scans
  • Custom hooks β€” trigger any workflow your team needs

Practical implications for engineering teams

What changes immediately

  1. Code reviews get faster β€” Copilot can pre-review PRs against your team’s standards
  2. Onboarding accelerates β€” new team members have an agent that understands the codebase
  3. Modernization becomes tractable β€” β€œmigrate this Express app to Fastify” is a single prompt
  4. Test coverage improves β€” the agent writes tests as part of every change

What requires careful thinking

  1. Security boundaries β€” Agent Mode can run terminal commands. Your MCP servers need proper auth
  2. Cost management β€” autonomous loops consume more tokens than single completions
  3. Review discipline β€” the agent produces working code, but β€œworking” is not always β€œcorrect”
  4. Team adoption β€” not everyone will trust an autonomous agent immediately

Integration with platform engineering

For teams building internal developer platforms, Agent Mode creates a new interaction model. Instead of clicking through a portal UI, developers can tell Copilot:

  • β€œCreate a new microservice using our team’s template”
  • β€œDeploy this to staging and run the smoke tests”
  • β€œCheck if this change meets our security policies”

The agent orchestrates the platform APIs through MCP, making the developer platform feel like a conversation rather than a form.

Getting started with Agent Mode

  1. Update VS Code to the latest version
  2. Enable Agent Mode in Copilot settings
  3. Create AGENTS.MD in your repository root
  4. Start small β€” try β€œadd tests for this module” before β€œrefactor the entire auth system”
  5. Configure MCP servers for your most-used tools
  6. Set up hooks for your team’s quality gates

My take

Agent Mode is not replacing developers β€” it is replacing the tedious parts of development. The engineering skill shifts from β€œwriting code” to β€œdirecting agents” β€” defining what needs to happen, reviewing what was done, and making the judgment calls that require human context.

For AI-driven infrastructure teams, this is a force multiplier. The same patterns we use for autonomous infrastructure management now apply to the development process itself.

The question is not whether to adopt agentic development β€” it is how fast your team can build the muscle for it.


Want to accelerate your team’s adoption of AI-powered development tools? Get in touch for workshops on agentic development workflows and AI integration strategy.

Free 30-min AI & Cloud consultation

Book Now