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
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
- 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
How to pick a mode
- Writing one line or a small loop? Use inline. Type a clear function name or comment, wait, press Tab.
- Need to understand code or an error? Use chat. Select the code first, then ask “explain this in simple words”.
- Changing one function? Use inline chat. Select it, press Ctrl+I, type “add input checks”.
- Task touches many files (new API route + test + docs)? Use plan mode first, read the plan, then let the agent run.
- 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.
| Mode | What you do | What you get |
|---|---|---|
| Inline | Type def is_even(n): and wait | Ghost text return n % 2 == 0; press Tab |
| Chat | Ask “write is_even in Java with a JUnit test” | A method + a test class to copy |
| Agent | Ask “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)
- 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.
- 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.
- Copilot in IntelliJ: inline after login. Chat tool window on the right side. Agent mode is in the chat mode list.
- Settings tip: if inline ghost text distracts you, turn it off per language in the tool settings and keep chat.
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.
नमस्कार मित्रांनो. वरच्या chapter मध्ये आपण inline, chat आणि agent mode समजून घेतले. आता एकाच छोट्या bug वर त्यातला फरक अनुभवूया. हा सराव Saffron Stationery Store नावाच्या काल्पनिक दुकानावर आहे, जे pens boxes मध्ये pack करतं. आधी inline suggestions बघा, मग काहीही न बदलता chat ला fail होणारे tests समजावून सांगायला सांगा, आणि मग inline chat ने फक्त एकच function fix करा. Starter file मध्ये 4 tests fail आणि 2 pass होतात, आणि बरोबर fix केल्यावर सगळे 6 pass होतात.
नमस्ते दोस्तों. ऊपर के chapter में हमने inline, chat और agent mode समझे. अब एक छोटे bug पर इनका फ़र्क महसूस करते हैं. यह अभ्यास Saffron Stationery Store नाम की काल्पनिक दुकान पर है, जो pens को boxes में pack करती है. पहले inline suggestions देखो, फिर बिना कुछ बदले chat से fail होने वाले tests समझवाओ, और फिर inline chat से सिर्फ़ एक function ठीक करो. Starter file में 4 tests fail और 2 pass होते हैं, और सही fix के बाद सभी 6 pass होते हैं।
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.
Ravindra Bagale's Tip – मराठी
काम होईल असा सगळ्यात छोटा mode वापरा. Ask काहीही न बदलता समजावतो, inline chat फक्त निवडलेला code बदलतो, आणि agent mode अनेक files च्या कामासाठी आहे. बदल कोणत्याही mode ने केला तरी प्रत्येक बदलानंतर tests चालवा.
Ravindra Bagale's Tip – हिंदी
जिससे काम हो जाए, वह सबसे छोटा mode चुनो. Ask बिना बदले समझाता है, inline chat सिर्फ़ चुना हुआ code बदलता है, और agent mode कई files वाले काम के लिए है. बदलाव किसी भी mode से हुआ हो, हर बदलाव के बाद tests चलाओ।
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.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)
- Create the practice folder with the name shown below, and save the two files from this section inside it.
- Create a virtual environment: on macOS or Linux run
python3 -m venv .venv. On Windows runpy -3 -m venv .venv. - 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. - 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):
"""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:
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.txtPrompt 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
- Open the folder: in VS Code choose File and then Open Folder, pick
saffron-boxes, and runpython -m pytest -qin the terminal to see the 4 failures. - Inline suggestions: create a scratch file named
try_boxes.py, typefrom 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 prints4, but the shop really needs 5 boxes. Inline only completes what you type, and it does not check your logic. Deletetry_boxes.pywhen you finish. - 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.
- Fix with inline chat: in
boxes.py, select the wholeboxes_neededfunction, press Ctrl+I (Cmd+I on Mac), and paste Prompt 2. VS Code shows the change as a diff inside the editor. - 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.
- Run the tests again:
python -m pytest -q. Expect 6 passed. - 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
- 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.askInChattofalsein Settings. - 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.
- 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.
- 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.
- 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 statusandgit diff, to see every changed file. - 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.
Pick the smallest mode
Inline does not check logic
सगळ्यात छोटा mode निवडा
Inline logic तपासत नाही
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
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.