Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 1

Chat vs Inline vs Agent Mode: How AI Coding Modes Work

Every AI coding tool has three ways to help you. Inline finishes your line. Chat answers your question. Agent does a whole task. Pick the right one and you work faster.

In short: use inline for small code, chat for questions and bigger blocks, and agent for multi-file tasks that you review step by step.

Why the mode matters

WHY

The wrong mode wastes time and tokens. Asking an agent to rename one variable is slow. Waiting for inline to write a whole feature does not work. Each mode has a job.

What each mode is

WHAT
  • Inline (autocomplete): faint grey “ghost text” appears as you type. Tab accepts it. Esc rejects it.
  • Next edit suggestion: the tool guesses your next change somewhere else in the file. GitHub Copilot calls it next edit suggestions.
  • Chat: a side panel. You ask in plain words. It explains code or writes a block for you to paste or apply.
  • Inline chat: a small chat box right inside the editor (Ctrl+I in VS Code with Copilot). Good for “fix this function”.
  • Agent: you give a goal. It plans, edits many files and runs commands like tests. It asks for approval on risky steps.
  • Plan mode: the agent only describes what it will do. Nothing changes until you approve. Claude Code and Copilot both have it.

How the three modes flow

Inline one line or one small function Inline chat fix or change this selection Chat explain, design, write a block Plan agent proposes steps, you approve Agent edits files, runs tests, you review diff

How to pick a mode

HOW
  1. Writing one line or a small loop? Use inline. Type a clear function name or comment, wait, press Tab.
  2. Need to understand code or an error? Use chat. Select the code first, then ask “explain this in simple words”.
  3. Changing one function? Use inline chat. Select it, press Ctrl+I, type “add input checks”.
  4. Task touches many files (new API route + test + docs)? Use plan mode first, read the plan, then let the agent run.
  5. Always review the diff the agent shows. Accept only what you understand. Run the tests yourself.

Same task in three modes (example)

Task: add a is_even(n) helper to a Python, JavaScript or Java project.

ModeWhat you doWhat you get
InlineType def is_even(n): and waitGhost text return n % 2 == 0; press Tab
ChatAsk “write is_even in Java with a JUnit test”A method + a test class to copy
AgentAsk “add is_even to utils, add a test, run the tests”Edited files + test run, waiting for your approval

Where to find each mode (setup check)

  1. GitHub Copilot in VS Code: inline is on after sign-in. Chat: the chat icon in the title bar or Ctrl+Alt+I. Pick Ask or Agent (and Plan, where shown) from the mode list in the chat box.
  2. Claude Code in VS Code: chat and agent in one panel (Spark icon). Switch Manual, Plan, Auto or Edit automatically at the bottom of the prompt box. It has no grey inline autocomplete.
  3. Copilot in IntelliJ: inline after login. Chat tool window on the right side. Agent mode is in the chat mode list.
  4. Settings tip: if inline ghost text distracts you, turn it off per language in the tool settings and keep chat.
Rule: agent mode can run commands. Keep approval on for anything that deletes, installs or deploys.

Practice: use inline, Ask and inline chat on one small packing bug

Hello friends. The chapter above explained inline, chat and agent mode. Now you will feel the difference on one small bug. The practice is a fictional shop called Saffron Stationery Store, which packs pens into boxes. First you watch inline suggestions, then you ask chat to explain the failing tests without changing anything, and then you use inline chat to fix only the one function. The starter file fails 4 tests and passes 2, and a correct fix passes all 6.

Ravindra Bagale's Tip

Use the smallest mode that does the job. Ask explains without editing, inline chat changes only the code you selected, and agent mode is for tasks that touch many files. Run the tests after every change, whichever mode made it.

Practice label: Saffron Stationery Store and its packing rule are fictional teaching data. It is not a real shop, and no real customer data is used. Passing these tests proves only the listed cases.
Environment (tested): on 16 November 2026 the starter and fixed files below were run on this course's Linux build machine with Python 3.13.5 and pytest 9.1.1. Starter: 4 failed, 2 passed. Fixed file: 6 passed. The AI tool itself runs on your own computer, so its words will differ from any example here.
Checked against official docs: every menu name, command and setting in this practice was checked on 16 November 2026 against the VS Code inline chat, chat overview, AI features cheat sheet and review agent changes pages on code.visualstudio.com. These tools update often. If a menu name looks different on your screen, search for the same words in the official docs or the Command Palette, and do not guess.

Your task: open the practice folder in VS Code with GitHub Copilot signed in. Use Ask to understand why the tests fail, and then use inline chat to make boxes_needed count a partly filled box as a full box, reject a per_box of 0 or less with a message that contains per_box, and reject negative pens with a message that contains pens.

Setup (practice folder saffron-boxes)

HOW
  1. Create the practice folder with the name shown below, and save the two files from this section inside it.
  2. Create a virtual environment: on macOS or Linux run python3 -m venv .venv. On Windows run py -3 -m venv .venv.
  3. Activate it: on macOS or Linux run source .venv/bin/activate. In Windows Command Prompt run .venv\Scripts\activate.bat, and in Windows PowerShell run .venv\Scripts\Activate.ps1.
  4. Install pytest inside the virtual environment: python -m pip install pytest.

Starter boxes.py (// rounds down, so a partly filled box is lost, and 0 per box crashes with ZeroDivisionError):

boxes.py
"""Practice data: Saffron Stationery Store is a fictional shop made up for this exercise."""


def boxes_needed(pens, per_box):
    """Return how many boxes are needed to pack all the pens."""
    return pens // per_box

Simple tests test_boxes.py:

test_boxes.py
import pytest

from boxes import boxes_needed


def test_full_boxes_only():
    assert boxes_needed(20, 10) == 2


def test_no_pens_needs_no_box():
    assert boxes_needed(0, 10) == 0


def test_partly_filled_box_still_counts():
    assert boxes_needed(25, 10) == 3


def test_one_pen_needs_one_box():
    assert boxes_needed(1, 12) == 1


def test_zero_per_box_is_rejected():
    with pytest.raises(ValueError, match="per_box"):
        boxes_needed(10, 0)


def test_negative_pens_is_rejected():
    with pytest.raises(ValueError, match="pens"):
        boxes_needed(-5, 10)

Before you ask the AI, run python -m pytest -q in the folder. You should see 4 failed, 2 passed. That proves Python and pytest work before the AI tool is involved.

The exact prompt to try (copy it as it is):

two-prompts.txt
Prompt 1, for Ask in the Chat view (explain only, change nothing):
Read boxes.py and test_boxes.py for the fictional Saffron Stationery Store. Explain in simple words why test_partly_filled_box_still_counts and test_zero_per_box_is_rejected fail. Do not edit any file.

Prompt 2, for inline chat on the selected boxes_needed function:
Round up so a partly filled box counts as one box. Raise ValueError with a message that contains per_box when per_box is 0 or less, and with a message that contains pens when pens is negative. Change only this function.

HOW to try each mode on the same task

HOW
  1. Open the folder: in VS Code choose File and then Open Folder, pick saffron-boxes, and run python -m pytest -q in the terminal to see the 4 failures.
  2. Inline suggestions: create a scratch file named try_boxes.py, type from boxes import boxes_needed, press Enter, and type the comment # print how many boxes 45 pens need when 10 fit in one box. When grey ghost text appears, press Tab to accept it or Escape to dismiss it. If you run it now, the starter prints 4, but the shop really needs 5 boxes. Inline only completes what you type, and it does not check your logic. Delete try_boxes.py when you finish.
  3. Ask in chat: open the Chat view with Ctrl+Alt+I on Windows or Linux (Ctrl+Cmd+I on Mac), choose Ask from the Agent dropdown in the chat input, and paste Prompt 1. Ask explains the problem without editing your files.
  4. Fix with inline chat: in boxes.py, select the whole boxes_needed function, press Ctrl+I (Cmd+I on Mac), and paste Prompt 2. VS Code shows the change as a diff inside the editor.
  5. Keep or Undo: read the diff. Select Keep only if it rounds up, adds both checks and changes nothing outside the function. Otherwise select Undo and try a clearer prompt.
  6. Run the tests again: python -m pytest -q. Expect 6 passed.
  7. Where agent mode fits: this fix touched one function, so agent mode was not needed. Choose Agent when a task spans several files, such as adding a new command plus its tests, and review every file it changes.

What a correct result looks like: Ask explains that // rounds down, so 25 pens with 10 per box gives 2 instead of 3, and that dividing by 0 raises ZeroDivisionError instead of a clear ValueError. The inline chat diff then rounds up, for example with (pens + per_box - 1) // per_box or math.ceil, and adds the two checks. The exact words and code style change from run to run, which is fine. The result is correct only when pytest shows 6 passed.

Real pytest output after the fixed file:

pytest-after.txt
......                                                                   [100%]
6 passed in 0.01s
Optional completed boxes.py (try it yourself first)

Copilot may round up in a different way or check the inputs in a different order. Any version is fine if all 6 tests pass and the test file is unchanged.

boxes.py
"""Practice data: Saffron Stationery Store is a fictional shop made up for this exercise."""


def boxes_needed(pens, per_box):
    """Return how many boxes are needed to pack all the pens."""
    if per_box <= 0:
        raise ValueError("per_box must be more than 0")
    if pens < 0:
        raise ValueError("pens cannot be negative")
    return (pens + per_box - 1) // per_box

Troubleshooting: common mode problems in VS Code

HOW
  1. Problem: pressing Ctrl+I opens Ask in Chat in the Chat view instead of the small inline box. Fix: the file belongs to an active chat editing session. Use a file that is not part of that session, or set inlineChat.askInChat to false in Settings.
  2. Problem: you cannot find Ask or Agent. Fix: look for the Agent dropdown in the chat input. The features you see also depend on your model, account and organization policies.
  3. Problem: no grey ghost text appears. Fix: open the Copilot status dashboard from the Status Bar and check that inline suggestions are not turned off globally or for Python. On Copilot Free, also check whether you have used this month's inline suggestion allowance.
  4. Problem: the tests already use code from agent mode that you have not reviewed. Fix: agent edits are saved to disk before you review them, so tests run on the changed files. Review each change and use Keep or Undo before you trust the result.
  5. Problem: agent mode changed a file through a terminal command, and the change is not in the review list. Fix: the review list tracks only edits made by the agent's edit tools. Check the Source Control view, or run git status and git diff, to see every changed file.
  6. Problem: you want to go back to before the agent's changes. Fix: hover over an earlier request and select Restore Checkpoint. Checkpoints do not reverse terminal commands or changes to outside services, so check those yourself.

Practice cards: English and spoken Marathi

Each card below explains one idea on its own, so you can save or revise a single card without reading the whole chapter.

PRACTICE CARDAI Coding

Pick the smallest mode

Use Ask when you want an explanation and no file changes.
Use inline chat to change one selected function, and use agent mode only when a task spans many files.
Ravindra Bagale · ravindrabagale.com/ai-coding
PRACTICE CARDAI Coding

Inline does not check logic

Tab accepts grey ghost text, and Escape dismisses it.
The suggestion only continues what you typed, so tests still decide whether the code is right.
Ravindra Bagale · ravindrabagale.com/ai-coding
सराव कार्डमराठी

सगळ्यात छोटा mode निवडा

फक्त समजून घ्यायचं असेल आणि file बदलायची नसेल, तेव्हा Ask वापरा.
निवडलेलं एक function बदलायला inline chat वापरा, आणि अनेक files चं काम असेल तेव्हाच agent mode वापरा.
Ravindra Bagale · ravindrabagale.com/ai-coding
सराव कार्डमराठी

Inline logic तपासत नाही

Tab ने grey ghost text accept होतो, आणि Escape ने तो जातो.
Suggestion फक्त तुम्ही टाइप केलेलं पुढे नेतं, म्हणून code बरोबर आहे की नाही ते tests च ठरवतात.
Ravindra Bagale · ravindrabagale.com/ai-coding

Quick quiz

1. Which mode shows grey ghost text?

Inline (autocomplete). Tab accepts it.

2. You want the AI to explain an error. Which mode?

Chat. Paste or select the error and ask.

3. Which mode can edit many files and run tests?

Agent mode.

4. What does plan mode do?

It shows the steps first. Nothing changes until you approve.

Save tokens and money

SMART AI USE

Inline is the cheapest help. Chat costs more. Agent costs the most, because it reads many files and loops. Use the smallest mode that does the job. Start a new chat for a new task, so old history is not re-sent.

Save these cards

INTERVIEW CARDAI Coding

Inline vs chat vs agent?

Inline: completes as you type.
Chat: answers and writes blocks on request.
Agent: plans and edits many files, runs commands, with approval.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

Which mode when

1 line: inline.
1 function: inline chat.
Question or design: chat.
Many files: plan, then agent.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Modes in 3 lines

Small = inline. Talk = chat. Task = agent.
Plan first for big jobs.
Always read the diff and run tests.
Ravindra Bagale · ravindrabagale.com/ai-coding
Next in this course: see all chapters on the AI Coding page.