What Is Claude Code and How to Use It

By Ricardo Gutierrez · · 21 min read

In this article

  1. What is Claude Code
  2. Architecture and how it works
  3. Step-by-step installation
  4. .claude/ directory structure
  5. Key features
  6. Hooks: automatic actions
  7. Agents and subagents
  8. MCP: connecting with tools
  9. Comparison with other tools
  10. Real workflow example
  11. Pricing and plans
  12. Quick start guide
  13. FAQ
  14. Next step

Quick summary

Complete guide to Claude Code: what it is, how to install it, hooks, agents, MCP and commands. With practical examples and video tutorial.

What is Claude Code

Claude Code is Anthropic's official command-line tool (CLI). It's not a chatbot: it's a development agent that works directly in your terminal, reads your code, executes commands and modifies files.

Common mistake: At first I used Claude Code as a glorified autocomplete. The breakthrough came when I started treating it as a teammate: I pass it the CLAUDE.md with project rules, use parallel agents for independent tasks, and let it make architectural decisions within clear boundaries.

Unlike using Claude in the browser, Claude Code has access to your file system, can execute scripts, connect to databases and operate as another programmer on your team. For more details, check our guide on How to install Claude Code step by step.

Claude Code vs Claude.ai

Claude.ai is the web chat. You type, it responds. It has no access to your files.

Claude Code is an agent in your terminal. It reads your code, executes commands, creates files, makes git commits. It's like having a senior developer by your side.

Architecture and how it works

Claude Code works as an agentic loop: it receives your instruction, analyzes the context (files, project structure, history), plans actions, executes them and verifies the result. If something fails, it iterates automatically.

Internal components:

Flow of a typical interaction:

  1. You type: "Add tests for the authentication module"
  2. Claude Code reads the project structure, finds the auth files
  3. Analyzes the existing code, identifies functions without tests
  4. Generates the tests, writes them to the corresponding file
  5. Runs the tests to verify they pass
  6. If they fail, reads the error, fixes it and re-runs
  7. When everything passes: shows you the result

This plan-execute-verify-iterate loop is what sets Claude Code apart from a simple text generator. It doesn't stop until the task is complete or until it detects it needs your input.

Step-by-step installation

Claude Code is installed via npm (Node.js). If you don't have Node, install it first from nodejs.org.

# Install Claude Code globally
npm install -g @anthropic-ai/claude-code

# Verify the installation
claude --version

# Start a session
claude

The first time it will ask you to authenticate with your Anthropic account. You need a plan that includes Claude Code (Max or Team). For more details, check our guide on CLAUDE.md: complete guide to configuring Claude Code.

Team experience: I've spent over 1,000 hours using Claude Code across 15 real projects. I've generated over 30,000 lines of code, created 22 specialized agents and built a complete cyber intelligence platform with 62 API endpoints. What I share here comes from making many mistakes first.

.claude/ directory structure

The .claude/ directory is where all your project configuration lives. It's what transforms Claude Code from a chat into a system configured for your use case.

.claude/ CLAUDE.md Project instructions settings.json Configuration and permissions commands/ Reusable commands (/) hooks/ Automatic actions docs/ Project documentation memory/ Persistent memory between sessions skills/ Custom skills
Complete .claude/ directory structure

The most important file is CLAUDE.md. It's where you tell Claude Code who you are, what project this is and how it should behave. Think of it as the README but for the AI.

Key features

Claude Code has capabilities that go far beyond generating code:

Persistent memory: Claude Code remembers between sessions. The CLAUDE.md file loads automatically every time you open a session in that directory. You can have a global CLAUDE.md (~/.claude/CLAUDE.md) for personal preferences and one per project for specific rules.

Hooks (automation): scripts that run automatically when events occur. Pre-commit, post-file-write, etc. They allow Claude Code to be proactive without you having to ask for anything.

MCP (Model Context Protocol): protocol that connects Claude Code with external tools. GitHub, Slack, databases, APIs, browser. Over 100 MCP servers available in the ecosystem.

Subagents: Claude Code can launch parallel agents for independent tasks. For example: while one subagent writes tests, another refactors code, and another updates documentation. All in parallel.

Skills: reusable commands that encapsulate complex prompts. You create a skill once and invoke it with /name. Example: /commit generates semantic commits, /review analyzes PRs.

Worktrees: clones your repository into separate branches so agents can work in parallel without conflicts. Ideal for large tasks that require multiple independent changes.

Hooks: automatic actions

Hooks are scripts that run automatically when an event occurs. For example: before each commit, after creating a file, or when Claude Code reads a file. For more details, check our guide on Claude Code vs Cursor vs Copilot: which to choose.

// .claude/settings.json
{
 "hooks": {
 "PreCommit": [{
 "command": "npm run lint",
 "description": "Lint before commit"
 }],
 "PostFileWrite": [{
 "command": "prettier --write $FILE",
 "description": "Format created file"
 }]
 }
}

Hooks turn Claude Code into a proactive system. You don't have to ask it to format code: it does it automatically.

Available hooks:

Agents and subagents

An agent in Claude Code is a complex instruction that runs autonomously. It can read files, execute commands, create files and make decisions.

The difference from a normal prompt is that the agent iterates: tries, evaluates, fixes and retries until the task is complete.

Task "Fix this bug" Analyze Read files Execute Modify, test Done Retry if fails
Agent execution flow in Claude Code

Parallel subagents: Claude Code can launch multiple agents working simultaneously. Real example: "Refactor the auth module, add tests and update the README". Claude Code launches 3 subagents: one refactors, another writes tests (waiting for the first), another updates docs. Result: a 2-hour task completed in 10 minutes.

MCP: connecting with tools

MCP (Model Context Protocol) allows Claude Code to connect with external tools: GitHub, databases, browser, APIs, Slack and more.

Each MCP connection is a "server" that exposes tools. Claude Code discovers them automatically and uses them when needed.

// Example: connect with GitHub and PostgreSQL
{
 "mcpServers": {
 "github": {
 "command": "npx",
 "args": ["-y", "@modelcontextprotocol/server-github"]
 },
 "postgres": {
 "command": "npx",
 "args": ["-y", "@modelcontextprotocol/server-postgres"],
 "env": { "DATABASE_URL": "postgresql://..." }
 }
 }
}

MCP by the numbers

There are 100+ MCP servers available: GitHub, Slack, databases, browser, file systems, REST APIs, and more. Any tool you use probably already has an MCP server.

Comparison with other tools

Claude Code isn't the only AI development tool. Here's how it positions itself against the alternatives:

Claude Code vs GitHub Copilot:

Claude Code vs Cursor:

Claude Code vs Windsurf (Codeium):

Claude Code vs Aider:

Real workflow example

Real workflow for developing an API endpoint with Claude Code:

# Real session (simplified)

> claude "Create a POST /api/v1/alerts endpoint that receives
  security alerts, validates them against the MITRE ATT&CK schema,
  persists them in Supabase and sends a Slack notification if the
  severity is critical."

# Claude Code does (automatically):
# 1. Reads the project structure (fastapi, supabase client, etc.)
# 2. Reads the existing alert schema
# 3. Creates the endpoint in routes/alerts.py
# 4. Creates the Pydantic model with MITRE validation
# 5. Adds the Supabase persistence function
# 6. Adds the Slack webhook for critical alerts
# 7. Creates unit tests
# 8. Runs the tests
# 9. Fixes an error in the validation schema
# 10. Re-runs tests: all pass
# 11. Shows you the result

# Total time: ~3 minutes
# Without Claude Code: 45-90 minutes

The key isn't just that it generates code. It's that it executes, verifies, fixes and completes. It doesn't hand you a draft: it hands you a working feature.

Pricing and plans

Claude Code is included in certain Anthropic plans. It doesn't have a separate price:

Max Plan (100 USD/month): includes Claude Code with generous usage. For most individual developers it's enough. Includes Opus 4 model (1M context) and Sonnet 4.6.

Max Plan (200 USD/month): 5x more usage than the 100 plan. For power users who use Claude Code 8+ hours daily.

Team Plan (30 USD/user/month + usage): for teams. Each member has access to Claude Code. Centralized administration, SSO, per-team permissions.

API (pay per use): you can use Claude Code with your own API key. You pay per tokens consumed. Models: Sonnet 4.6 (~3 USD/M input, ~15 USD/M output), Opus 4 (~15 USD/M input, ~75 USD/M output). For intensive use it can be more expensive than Max.

Recommendation:

Quick start guide

In 10 minutes you can have Claude Code running in your project:

Step 1: Install

npm install -g @anthropic-ai/claude-code
claude --version

Step 2: Authenticate

claude
# Follow the OAuth authentication instructions

Step 3: Create a basic CLAUDE.md

# At the root of your project, create CLAUDE.md:

# My Project

## Stack
- Backend: FastAPI + Python 3.11
- DB: PostgreSQL via Supabase
- Frontend: Next.js 14

## Rules
- Tests required for every new feature
- Conventional commits (feat:, fix:, docs:)
- Strict typing (no Any in Python, no any in TypeScript)

Step 4: First task

claude "Explain the structure of this project and suggest improvements"

Step 5: First real task

claude "Add email validation to the registration form"

From here, iterate. Add more rules to CLAUDE.md when Claude Code does something you don't want. Configure hooks to automate repetitive tasks. Connect MCPs as you need them.

FAQ

What is Claude Code?

Claude Code is Anthropic's official command-line tool (CLI). It's a development agent that works in your terminal: reads code, executes commands, modifies files and connects with external tools via MCP.

Is Claude Code free?

Claude Code requires an Anthropic plan that includes it (Max or Team). There's no additional cost on top of the plan, but you need an active subscription. Max plan starts at 100 USD/month with included usage, or API with pay-per-use.

What's the difference between Claude Code and ChatGPT?

ChatGPT is a web chat. Claude Code is an agent in your terminal that can read files, execute commands, make commits, connect to databases and operate autonomously in your project.

How do you install Claude Code?

Install it with npm: 'npm install -g @anthropic-ai/claude-code'. Requires Node.js installed first. The first time it asks for authentication with your Anthropic account.

What is MCP in Claude Code?

MCP (Model Context Protocol) is a protocol that allows Claude Code to connect with external tools like GitHub, databases, Slack and more. There are 100+ MCP servers available.

Next step

Now you know what Claude Code is. The next step is to install it and create your first workflow. In IAcademy's Module 03 we guide you step by step: installation, .claude/ configuration, your first hook, your first agent and your first reusable command.

Learn Claude Code from scratch

The first 3 IAcademy modules are free. They include the complete Claude Code guide (52 pages).

Start free