Skip to main content

Lesson 1: Getting Started

Learning Objectives

After completing this lesson, you will be able to:

  • Understand what Claude Code is and what it can do
  • Install Claude Code using your preferred method
  • Complete first-time setup and authentication
  • Start your first Claude Code session
  • Navigate the interface and get help

Prerequisites

Before starting this lesson, ensure you have:

  • Terminal/Command Line Access: Basic familiarity with running commands
  • Code Editor: Any editor (VS Code, JetBrains, Vim, etc.)
  • API Account: An Anthropic account with API access (sign up at console.anthropic.com)

Estimated Time: 20 minutes


What is Claude Code?

Claude Code is an AI-powered command-line tool that helps you write, understand, and improve code. Think of it as having an expert programming partner available directly in your terminal.

What Claude Code Can Do:

  • Write Code: Generate functions, classes, and entire features from natural language descriptions
  • Read & Understand: Analyze your codebase and explain how things work
  • Edit & Refactor: Make changes to existing code while maintaining functionality
  • Debug: Help identify and fix bugs
  • Search: Navigate complex codebases quickly
  • Automate: Run commands, manage git operations, and streamline workflows

How It Works:

Claude Code uses Claude, Anthropic's AI assistant, combined with specialized tools for file operations, code analysis, and terminal commands. Unlike chat-based AI tools, Claude Code has direct access to your files and can execute commands in your environment.


Installation

Claude Code supports multiple installation methods. Choose the one that works best for your system and workflow.

The native installer provides the best integration with your system.

macOS / Linux:

curl -fsSL https://cdn.anthropic.com/claude-code/install.sh | sh

This will:

  • Download the latest binary
  • Install it to ~/.claude/bin/
  • Add it to your PATH (if you confirm)
  • Set up shell completion

Windows (PowerShell):

irm https://cdn.anthropic.com/claude-code/install.ps1 | iex

Method 2: npm

If you already have Node.js installed, you can install via npm:

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

Method 3: Docker

For containerized environments:

docker pull anthropic/claude-code:latest

Run with:

docker run -it --rm \
-v $(pwd):/workspace \
anthropic/claude-code:latest

Verify Installation

After installation, verify it's working:

claude --version

You should see version information printed.


First-Time Setup

When you first run Claude Code, you'll need to authenticate with your Anthropic account.

Step 1: Start Claude Code

claude

Step 2: Authentication Flow

On first launch, Claude Code will guide you through authentication:

  1. Press Enter to open your browser for authentication
  2. Log in to your Anthropic account (or sign up if you haven't already)
  3. Grant permissions to Claude Code
  4. Return to the terminal - you should see a success message

Step 3: Configuration Check

Claude Code will create configuration files in:

  • Linux/macOS: ~/.config/claude-code/
  • Windows: %APPDATA%\claude-code\

These settings are managed automatically, but you can customize them later (covered in Lesson 6).


Your First Session

Let's start Claude Code and explore the interface.

Starting a Session

Simply run:

claude

You'll see a welcome message and a prompt:

Claude Code v1.0.0
─────────────────────

Connected: claude-sonnet-4-5

Type your message or use /help for commands

You>

The Interface

The prompt shows:

  • Version: Which version of Claude Code you're running
  • Model: Which Claude model is active (e.g., claude-sonnet-4-5)
  • Prompt: Where you type your messages

Getting Help

Type /help to see available commands:

You> /help

This displays:

  • Built-in slash commands (like /help, /exit, /config)
  • Keyboard shortcuts
  • Quick tips

Basic Navigation

Try these basic interactions:

  1. Ask a question:

    You> What can you help me with?
  2. Exit the session:

    You> /exit

    Or press Ctrl+D


Understanding the Architecture

Claude Code operates in different modes:

Chat Mode (Default)

In chat mode, you have conversations with Claude. Claude can:

  • Read files (with your permission)
  • Edit files (with your permission)
  • Run commands (with your permission)
  • Answer questions about your code

Command Flags

Claude Code accepts several command-line flags (covered in detail in Lesson 2):

  • -p "prompt" - Execute a single prompt and exit
  • -c "command" - Run a command with Claude's assistance
  • -r "read" - Have Claude read a file and process it

Example:

claude -p "Explain what's in the current directory"

Common First-Time Questions

Q: Is Claude Code safe to use?

A: Yes. Claude Code requires permission before:

  • Reading files
  • Making edits
  • Running commands
  • Installing dependencies

You always review actions before they execute.

Q: Does Claude Code send my code to Anthropic?

A: Claude Code sends file contents to Anthropic's API when:

  • You ask Claude to read a file
  • Claude needs context to answer a question
  • You're using chat mode

Data is processed securely and not used for training without your explicit opt-in.

Q: Can I use Claude Code offline?

A: No. Claude Code requires an internet connection to communicate with Claude via the Anthropic API.

Q: What's the difference between Claude Code and Claude.ai?

A:

  • Claude.ai is a web chat interface for general conversations
  • Claude Code is a CLI tool specifically designed for coding tasks, with direct file access and command execution

Try It Yourself

Exercise 1.1: Your First Conversation

  1. Navigate to a project directory (or create one):

    mkdir ~/claude-test
    cd ~/claude-test
  2. Start Claude Code:

    claude
  3. Have a conversation:

    You> Hello! Can you create a simple Python script that prints "Hello, World"?
  4. Follow Claude's response and approve file creation if prompted

  5. Exit when done:

    You> /exit

Exercise 1.2: Explore the Help System

  1. Start Claude Code again

  2. Check available commands:

    You> /help
  3. Ask about specific features:

    You> How do I read files with Claude Code?
  4. Exit the session


✅ Check Your Understanding

Answer these questions to test your knowledge:

  1. What command starts a Claude Code session?

    • start claude
    • claude
    • claude-code
    • ai claude
  2. How do you get help within Claude Code?

    • --help
    • /help
    • help
    • ?
  3. What happens the first time you run Claude Code?

    • It starts immediately
    • You need to authenticate via browser
    • You must create a configuration file manually
    • It requires an API key to be entered
  4. True or False: Claude Code can modify your files without asking permission.

    • True
    • False

Answers: 1-b, 2-b, 3-b, 4-False


Summary

In this lesson, you learned:

  • What Claude Code is - An AI-powered CLI coding assistant
  • How to install it - Native installer, npm, or Docker
  • How to authenticate - Browser-based authentication flow
  • How to start a session - Simply run claude
  • How to get help - Use /help command

Next Steps

In Lesson 2: Basic Operations, you'll learn:

  • Chat mode fundamentals
  • How to read files
  • Making edits to files
  • Understanding permissions
  • Essential CLI flags

Further Reading


Continue to Lesson 2: Basic Operations