Przejdź do głównej zawartości

Choosing the Right Mode: Agent vs. Ask

Ta treść nie jest jeszcze dostępna w Twoim języku.

AI coding assistants typically offer different modes of interaction, each tailored to a specific phase of the development process. Understanding the distinction between these modes is crucial for working efficiently and safely. The two most fundamental modes are Ask (for exploration) and Agent (for execution).

Mastering when to use each mode is a key best practice that will significantly improve the quality of your AI-assisted work.

Think of the two modes as different stances you take when collaborating with your AI partner.

Ask Mode: The Explorer

Purpose: Learning, planning, and questioning.



In Ask mode, the AI is a read-only partner. It can search your entire codebase, read files, analyze dependencies, and answer your questions, but it will never make any changes to your code. It is a completely safe environment for exploration.

Agent Mode: The Implementer

Purpose: Execution, refactoring, and action.



In Agent mode, the AI has full agency. It is a read-write partner that can autonomously explore your project, edit multiple files, run terminal commands, and fix errors to carry out your instructions. This is the mode for getting work done.


The most effective and reliable workflow is to begin in Ask mode to build a solid foundation of understanding and planning, and only then switch to Agent mode for execution.

  1. Start in Ask Mode: Understand and Plan. You’ve been tasked with refactoring a complex, unfamiliar module. Before making any changes, you start in Ask mode.

    • Explore: “Can you explain the purpose of the LegacyDataProcessor class? What are its main responsibilities?”
    • Analyze: “Show me all the places in the codebase where the processData method is called.”
    • Plan: “I want to refactor this to use a more modern async/await pattern. Please create a step-by-step plan for this refactoring. List all the files that will be affected.”
  2. Switch to Agent Mode: Execute the Plan. After reviewing and refining the plan generated in Ask mode, you’re confident in the approach. Now, you switch to Agent mode to carry out the work.

    • Execute: “The plan looks good. Please proceed with step 1: refactor the processData method to be an async function.”
    • Iterate: You work through the plan, step by step, with the AI making the changes and you reviewing and guiding the process.