PTENES
MODULE 1.1

🧭 What is Claude Code

Learn what sets an AI agent apart from a chatbot, why Claude Code lives in the terminal, and what it can actually do.

6
Topics
45
Minutes
Basic
Level
Theory
Type
1

🤖 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.

CHATBOT Question Response One exchange. That’s it. AGENT (Claude Code) Notice Decide Act repeats until complete

✓ 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
Perception
Reads files and command output
Decision
Choose the next action
Action
Runs in the real environment
Loop
Repeat until you reach the goal
2

💻 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

90s

Shell scripts

Line-by-line manual automation. Effective but fragile — breaks with any variation.

10s

LLM code generation (chatbot)

AI generates code, a human copies and pastes it, then tests it manually. Faster, but still manual.

Today

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.

Shell
Bash/zsh/fish interpreter
Pipe |
Connects the output of one command to the input of the next
SSH
Secure remote access
Process
Program running on the OS
3

📁 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

Read Reads the contents of any file in the repository
Edit Makes exact replacements in existing files
Write Creates new files or completely overwrites them
Bash Runs any shell command: npm, git, python, etc.
Glob Lists files by default: **/*.ts, src/**
Grep Text/regex search in project files

✓ 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)
Tool call
A tool invocation
Tool result
What the tool returned
Permission
Action approved in settings.json
Sandboxing
Agent security limits
4

🎯 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.

Refactoring
Changes structure without changing behavior
Migration
Updates dependencies or patterns
Test
Validates code behavior
Boilerplate
Repetitive project structure
5

⚡ 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.”

Delegate
Give a complete task with context
Review
Check the result, not every step
Iterate
Refine until you get the result
Trust
Let the agent work
6

🚀 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

# Open the terminal and navigate to your project
$ cd meu-projeto
# Start Claude Code
$ claude
# Interactive prompt appears
> Read the README and tell me what this project does
# Agent reads the file and responds
● Read README.md
● This project is a Node.js server that...

💡 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."

Interactive
Default mode: conversation in the terminal
Headless
claude -p "tarefa" without a prompt
Tool log
Line by line, showing the tools used
Ctrl+C
Interrupt the task at any time

✅ Module 1.1 Summary

✓
Agent ≠ Chatbot — performs real actions in a continuous loop
✓
Terminal = real power — direct access to the OS, files, and processes
✓
Concrete tools — Read, Edit, Write, Bash, Glob, Grep
✓
Real cases — refactoring, migration, testing, debugging, boilerplate
✓
Right frame — delegate complete tasks; don’t ask questions

Next Module:

1.2 — How the agent thinks: the internal loop, tools, and how Claude Code decides what to do at each moment.