Lesson 1Basics

Introduction to Claude Code

AI-powered coding assistant

What is Claude Code?

Claude Code is an AI agent from Anthropic that works directly in your terminal. Unlike regular chatbots, it has full access to your code, file system, and can execute commands.

$ claude
> Analyze this project and fix the failing tests
Claude reads files, finds the issue, edits code, runs tests...

How Claude Code works: the agentic loop

Claude Code is an agent, not a plain chat. When you give it a task like "analyze this project and fix the failing tests", the model does not just reply with text. It runs an iterative loop: it reads files, builds a mental model of the project structure, forms a plan, calls tools (read and edit files, run shell commands, search the code), inspects the result, and adjusts the next step. The loop repeats until the task is done or the agent needs clarification. That is why the line Claude reads files, finds the issue, edits code, runs tests… above is literal, not a metaphor — it describes the actual sequence: read, edit, verify by running the tests.

Project context and permissions

The key difference from a web chat is that the agent has access to your file system and your project terminal. To understand a codebase, Claude Code does not load it all into context — it explores selectively: opening relevant files, searching by keyword, reading only what matters. Persistent project instructions live in a CLAUDE.md file at the repo root, which the agent reads automatically and treats as memory about conventions, build commands, and code style. Running commands and writing files are governed by a permissions system: by default the agent asks for confirmation before potentially destructive actions, while safe operations can be allow-listed so you are not prompted every time.

When to use it and what to watch for

Use Claude Code when a task needs action in a real repository rather than an answer: fixing a bug with a test run, refactoring, exploring an unfamiliar project, or preparing a commit or PR. You can extend the agent through MCP (Model Context Protocol) — a standard for connecting external sources such as databases, APIs, and monitoring systems. The main pitfall is trusting it without review: the agent can be wrong, so keep changes under version control (git), read its edits, and never disable confirmation for destructive commands. Concrete example: a request to "optimize the slow SQL query in the reports module" leads the agent to locate the query, propose an index or a rewrite, run the tests, and show you a diff before any commit — you remain the one who makes the final call.

Key Features

Terminal Interface

Works in your terminal — where you already code

Context Aware

Reads your code, understands project structure

Git Integration

Creates commits, PRs, works with branches

Executes Commands

Runs tests, builds, any shell commands

Sub-agents

Delegates complex tasks to specialized agents

MCP Integrations

Connects to databases, APIs, external services

Differences from ChatGPT / Claude Chat
FeatureClaude CodeChatGPT / Web Chat
File system access
Command execution
Git operations
Project understanding
External integrations (MCP)
Autonomous operation

Use Cases

Simple Tasks
  • Fix a bug
  • Refactor a function
  • Write tests
  • Add documentation
Medium Tasks
  • Add a feature
  • Optimize queries
  • Migrate API
  • Code review
Complex Tasks
  • Architectural changes
  • Service integration
  • CI/CD automation
  • Codebase exploration

Key Insight

Claude Code is not just a chatbot. It's a full AI agent that can independently explore code, make decisions, take actions, and verify results. It works in an iterative loop until the task is complete.

Frequently asked questions

What is Claude Code and how is it different from a chatbot?

Claude Code is an AI agent from Anthropic that runs in your terminal and has access to your project's file system and shell. Unlike a regular chatbot that only replies with text, the agent runs an iterative loop: it reads files, edits code, runs commands, and verifies the result, repeating until the task is done.

How does Claude Code understand a project's structure?

The agent does not load the whole codebase into context; it explores selectively by opening relevant files, searching by keyword, and reading only what matters. Persistent instructions, build commands, and code style live in a CLAUDE.md file at the repo root, which Claude Code reads automatically as memory about project conventions.

Is it safe to give Claude Code access to my code and commands?

Access is governed by a permissions system: by default the agent asks for confirmation before potentially destructive actions, while safe operations can be allow-listed. To stay safe, keep changes under version control (git), review the agent's edits, and never disable confirmation for destructive commands.

What tasks is Claude Code best for?

Claude Code is useful when a task needs action in a real repository rather than an answer: fixing a bug with a test run, refactoring, exploring an unfamiliar project, or preparing a commit or PR. You can extend it through MCP (Model Context Protocol), a standard for connecting external sources such as databases and APIs.

Lesson Quiz

1 of 2

1.What is Claude Code?

This lesson is part of a structured LLM course.

My Learning Path