🤖 What Is an AI Agent
One AI agent is a program that perceives its surroundings, reasons about what needs to be done, and takes actions to achieve a goal — repeating this cycle until it’s finished. This is radically different from a chatbot that simply answers a question and stops.
✓ The agent does
- ✓Reads 20 files to understand the project
- ✓Runs tests and fixes what broke
- ✓Iterates until the task is complete
- ✓Creates, edits, and deletes real files
✗ Chatbot does
- ✗Responds once and waits for a new question
- ✗Generates code but doesn’t run it
- ✗Doesn't know whether the code works
- ✗Doesn't have access to the file system
💻 Why the terminal?
The terminal isn’t just an intimidating black window. It’s the direct access point to the operating system — files, processes, network, compilers, servers. An agent that lives in the terminal has real power to turn code into results.
💡 Why not a graphical interface?
Graphical interfaces are slow to automate, depend on screen resolution, and change with updates. The terminal is stable, scriptable, and universal—it works on any remote server, CI/CD system, or Docker container.
- •Speed: create 50 files with 1 command vs. clicking 50 times
- •Composition: command pipes create workflows that are impossible in the GUI
- •Remote access: SSH connects the agent to any server
The evolution of code automation
Shell scripts
Line-by-line manual automation. Effective but fragile — breaks with any variation.
LLM code generation (chatbot)
AI generates code, a human copies and pastes it, then tests it manually. Faster, but still manual.
Agent in the terminal (Claude Code)
AI reads, writes, runs, and iterates autonomously. The human reviews the result, not every step.
💡 Practical Tip
If you’ve never used the terminal, you don’t need to learn everything before getting started. Module 1.4 covers just enough. For now, knowing that the terminal exists and why the agent lives there is enough.
📁 What it reads, writes, and runs
Claude Code isn't a model floating in the cloud. It has concrete tools that interact with the real system: read files, edit code, run commands, search patterns. Every action is visible in the terminal.
🛠️ Claude Code’s Built-in Tools
**/*.ts, src/**
✓ You can do it
- ✓Create and modify any text file
- ✓Run npm install, pytest, cargo build
- ✓Make git commits
- ✓Read logs and interpret errors
✗ Not possible (without plugins)
- ✗Browse in browsers or graphical apps
- ✗View images or PDFs (text only)
- ✗Access the internet directly
- ✗Remember previous sessions (without CLAUDE.md)
🎯 Real-world use cases
Claude Code isn't a demo toy. It's used in real production projects for tasks that would take hours of manual work each day.
📊 Where Claude Code shines
- →Refactoring at scale: rename a function in 80 files, update imports, ensure consistency
- →API migration: update deprecated library calls to the new version
- →Test generation: cover existing functions with unit and integration tests
- →Debugging: read the stack trace, locate the bug, propose and apply the fix
- →Boilerplate: create a project structure, configure tooling, write a README
💡 Tip: Get the mental model right
Think of Claude Code as a very fast junior developer that never gets tired. It handles well-defined tasks well, but needs clear context. The better you describe what you want, the better the result.
⚡ Chatbot vs. agent — the practical difference
The difference isn’t philosophical—it’s pragmatic. Changing how you use the tool radically changes the result. Here’s the contrast in everyday use:
Chatbot mode (inefficient)
"Write me a function to validate email" → copies the code → pastes it into the editor → discovers it doesn't work → returns to the chat → asks for a fix → repeats 5 times.
Agent mode (efficient)
"Add email validation to the form in src/auth.ts and write tests for it" → agent reads the file, writes the code, runs the tests, and adjusts until they pass. You review the result.
⚠️ Common pitfall
People coming from ChatGPT tend to ask questions to Claude Code instead of delegate tasks. Result: mediocre answers. Rephrase “how do I do X?” as “do X in file Y.”
🚀 First Contact
The best way to understand an agent is to see it working. Here’s the first-contact flow—from a blank terminal to the first completed task.
💻 A typical initial session
💡 What to watch for in the first session
When the agent is working, you'll see lines like ● Read src/index.ts e ● Bash: npm test. This is the real-time tool log—each line is a concrete action on your system.
Pay attention to this log during the first few sessions. It is the agent’s "visible reasoning."
claude -p "tarefa" without a prompt✅ Module 1.1 Summary
Next Module:
1.2 — How the agent thinks: the internal loop, tools, and how Claude Code decides what to do at each moment.