AI coding tools evolved through four stages: autocomplete finishes your lines, chat answers questions, assistants read your files and suggest changes, and agents plan, execute, test, and commit autonomously. Each stage adds capability. The agent is not replacing the developer β it's extending the developer's reach.
Three years ago, AI finished your code lines. Today, it reads your entire repository, plans a fix, edits multiple files, runs your tests, and commits the result.
That's not a single leap. It's four evolutionary stages, each building on the last. Understanding these stages helps you choose the right tool for your workflow and know what each can (and cannot) do.
This tutorial traces the complete evolution β from autocomplete through autonomous agents β with a Python demonstration of each stage. It builds on How AI Coding Agents Work and connects to Terminal Agents vs IDEs and Context Engineering.
1. The Four Stages
Autocomplete
Finishes your current line
Chat
Answers coding questions
Assistant
Reads files, suggests edits
Agent
Plans, executes, tests, commits
2. Stage 1: Autocomplete
Autocomplete completes the current line as you type. It predicts the next few characters based on the immediate context.
AI adds: def calculate_total(items: list[dict]) -> float:
You type: for item in items
AI adds: for item in items:
| Aspect | Detail |
|---|---|
| What it does | Finishes the current line |
| Context | ~1 line (a few hundred characters) |
| Speed | <100ms (real-time) |
| Can read files? | β No |
| Can edit files? | β No |
| Can run commands? | β No |
Examples: GitHub Copilot, Codeium, Tabnine
3. Stage 2: Chat
Chat answers coding questions in a conversation. You ask, it explains. But it can't see your files.
AI: "A decorator is a function that modifies another function's
behavior. Use @decorator_name above the function definition.
Example: @timer, @cache, @login_required"
You: "Show me how to use it with a REST API"
AI: "Here's an example with Flask..." # generates snippet
| Aspect | Detail |
|---|---|
| What it does | Answers questions, explains concepts, generates snippets |
| Context | ~4K-8K tokens (conversation history) |
| Speed | 1-5 seconds |
| Can read files? | β No (only what you paste) |
| Can edit files? | β No |
| Can run commands? | β No |
Examples: ChatGPT, Claude.ai, Gemini
4. Stage 3: Coding Assistant
A coding assistant lives in your IDE and can read your files. It suggests multi-line changes across your codebase.
# Assistant reads main.py...
# Finds the function...
# Proposes a change:
- def calculate(items):
+ def calculate(items: list[dict]) -> float:
π‘ Suggestion: Added type hints to calculate function.
π You review and accept or reject.
| Aspect | Detail |
|---|---|
| What it does | Reads files, proposes multi-line edits, explains changes |
| Context | ~32K-128K tokens (relevant files) |
| Speed | 2-10 seconds |
| Can read files? | β Yes |
| Can edit files? | β οΈ Suggests only (you approve) |
| Can run commands? | β No |
Examples: Cursor (edit mode), GitHub Copilot Chat, Cody
5. Stage 4: Coding Agent
A coding agent plans, executes, tests, and commits β autonomously within your approval boundaries.
Agent plans:
1. Read test_api.py to understand the expected behavior
2. Read api.py to find the bug
3. Fix the code
4. Run pytest to verify
5. Review git diff
Agent executes:
β [file_reader] Read test_api.py
β [file_reader] Read api.py
β [file_editor] Fixed bug in api.py
β [terminal] pytest β 12/12 passed
β [git] diff: 1 file changed, 3 insertions, 1 deletion
You review: git diff β looks good β git commit
| Aspect | Detail |
|---|---|
| What it does | Plans, reads, edits, runs tests, uses Git, iterates |
| Context | ~128K-1M tokens (entire codebase) |
| Speed | 10 seconds to 5 minutes |
| Can read files? | β Yes |
| Can edit files? | β Yes (with approval) |
| Can run commands? | β Yes (pytest, git, npm, etc.) |
Examples: Claude Code, Cursor Agent, Aider, OpenCode
6. Side-by-Side Comparison
| Capability | Autocomplete | Chat | Assistant | Agent |
|---|---|---|---|---|
| Read files | β | β | β | β |
| Edit files | β | β | β οΈ | β |
| Run commands | β | β | β | β |
| Use Git | β | β | β | β |
| Plan | β | β | β | β |
| Run tests | β | β | β | β |
| Human approval | β | β | β | β |
| Context window | ~1 line | ~4-8K | ~32-128K | ~128K-1M |
| Latency | <100ms | 1-5s | 2-10s | 10s-5min |
7. The Agent Loop in Detail
Stage 4 agents follow a loop that repeats until the task is complete:
What Each Step Does
| Step | Tool Used | What Happens |
|---|---|---|
| Plan | LLM reasoning | Creates step-by-step plan for the task |
| Read | file_reader | Loads relevant files into context |
| Edit | file_editor | Makes code changes |
| Test | terminal | Runs pytest, npm test, etc. |
| Review | git | Shows diff for human approval |
The loop typically runs 2-5 iterations. If tests fail, the agent reads the error, fixes the code, and re-runs tests β without human intervention.
8. Human Approval: The Safety Boundary
Even autonomous agents don't operate without oversight. The key safety model:
The agent proposes changes. You review the diff. You approve or reject. The agent never commits without your explicit approval.
| Action | Approval Level |
|---|---|
| Read a file | Automatic (no approval needed) |
| Run a test | Automatic (read-only) |
| Edit a source file | Review diff before accepting |
| Install a package | Confirm before executing |
| Git commit | Review message + diff |
| Deploy | Explicit approval required |
9. When to Use Each Stage
| Task | Best Stage | Why |
|---|---|---|
| Typing a function name | Autocomplete | Fastest, least disruptive |
| "What is a decorator?" | Chat | Conceptual question, no codebase needed |
| "Add type hints to main.py" | Assistant | Needs to read file, suggest changes |
| "Fix the failing test" | Agent | Needs to read, edit, test, iterate |
| "Refactor the auth module" | Agent | Multi-file, multi-step, needs tests |
| "Explain this codebase" | Assistant | Read-only, explanation-focused |
10. FAQ
Continue Learning
The agent loop: models, tools, context, execution Terminal Agents vs IDEs
Claude Code vs Cursor compared Context Engineering Explained
Control what the model sees AI Coding Agents & Junior Developers
Productivity vs programming skill AI Security Risks
Securing coding agents and agentic workflows Build Your First LLM Application
Complete beginner tutorial with text summarizer