Blog post hero image

A deep dive into GitHub Copilot modes: Agent, Ask, Edit, Plan, and AIAgentExpert

GitHub Copilot is no longer "just autocomplete." Modern Copilot experiences expose multiple modes that deliberately change how Copilot behaves: how much context it considers, how it balances explanation vs action, and how autonomous it is allowed to be.

These labels can vary a bit depending on where you use Copilot (VS Code, Visual Studio, JetBrains, GitHub.com), but the intent is consistent.

The autonomy spectrum

A useful mental model is a spectrum from "explain only" to "take the wheel":

A quick decision heuristic:

Ask mode: understand the system, reduce ambiguity

What it optimizes for

Ask mode is optimized for comprehension and decision support. It is where you interrogate the code, the architecture, and the tradeoffs before changing anything.

When to use it

Use Ask when:

Example prompts

Sample: asking about a code snippet

def slugify(name: str) -> str:
    return "".join(c.lower() if c.isalnum() else "-" for c in name).strip("-")

Good Ask prompt:

Interesting fact: Ask mode is a quality multiplier because it helps you surface constraints. Most "bad AI edits" happen because constraints were never stated.

Edit mode: controlled, scoped code changes

What it optimizes for

Edit mode is optimized for predictability. You already know what you want and you want Copilot to apply it quickly.

When to use it

Use Edit when:

Example prompts

Sample: Edit request with clear constraints

Before:

function parsePort(value) {
  const n = parseInt(value, 10);
  if (Number.isNaN(n)) return 3000;
  return n;
}

Great Edit prompt:

After (example output you might want):

function parsePort(value) {
  // Parse using base 10 to avoid surprises like "08" being treated as octal in older environments.
  const n = Number.parseInt(value, 10);

  // Default when value is missing or not a number.
  if (Number.isNaN(n)) return 3000;

  // Ports are valid only in the 1..65535 range.
  if (n < 1 || n > 65535) return 3000;

  return n;
}

Interesting fact: Edit mode tends to be best for the "boring engineering" that makes systems reliable: validation, consistency, and small refactors that preserve behavior.

Plan mode: de risk big changes before writing code

What it optimizes for

Plan mode is optimized for sequencing, risk management, and clarity. Think mini design doc: goals, non goals, steps, and how you will validate.

When to use it

Use Plan when:

Example prompts

Sample Plan structure you should expect

Interesting fact: Planning reduces overall cycle time because it prevents expensive backtracking once code has already been changed.

Agent mode: outcome driven multi step execution

What it optimizes for

Agent mode is optimized for reaching an outcome, not just producing a snippet. It often involves repo exploration, multi file edits, updating tests, and iterating.

When to use it

Use Agent when:

Example prompts

Sample: defining acceptance criteria for an Agent

A strong Agent prompt includes:

Interesting fact: Agent effectiveness correlates with feedback loops. Repos with good tests, linting, and type checking make agentic work safer and faster.

AIAgentExpert: deeper reasoning and higher verification

What it optimizes for

AIAgentExpert is typically the more thorough version of Agent mode. It biases toward correctness, edge cases, and validation.

When to use it

Use AIAgentExpert for:

Example prompts

Interesting fact: Hard debugging is hypothesis elimination. Expert style agents tend to propose structured investigation loops: reproduce, isolate, measure, change one variable, validate.

Combining modes in real workflows

Workflow: diagnosing and fixing a production bug

  1. Ask: explain the stack trace and likely causes
  2. Plan: propose an investigation plan and acceptance criteria
  3. AIAgentExpert: implement a minimal fix and regression test
  4. Edit: polish naming, messages, and consistency

Workflow: adding a feature safely

  1. Plan: define API, rollout, tests, and constraints
  2. Agent: implement across backend, frontend, and tests
  3. Edit: final cleanup and readability improvements
  4. Ask: sanity check edge cases and failure modes

Common failure modes and how to avoid them