Chapter 1

Getting Started with Claude Code

Getting Started with Claude Code A recent internal survey of professional developers found something surprising: a majority of time spent “coding” isn’t writing new code at all—it’s reading, understanding, and navigating existing codebases. That’s the problem Claude Code is designed to attack head-on. This chapter is about turning Claude from a passive chat window into an active participant in your real development environment.

What Claude Code Is (and Is Not)

Chapter illustration

Claude Code is not a smarter chat box, and it’s not an autocomplete engine living inside your editor. Claude Code is a command-line tool that lets Claude read, reason about, and work directly with your local codebase.

Think of it like this: chat-based AI tools are consultants who only know what you paste into an email. Claude Code is the teammate who actually opened the repo, skimmed the folders, followed the imports, and understands how things connect.

What Claude Code is:

  • A CLI tool that runs in your terminal
  • Context-aware of your project files and structure
  • Designed for real development workflows (Git repos, frameworks, large codebases)

What Claude Code is not:

  • A replacement for your IDE
  • A magic “write my app” button
  • A black box that commits code without your involvement

The “aha” moment most developers have is realizing this: Claude Code doesn’t replace thinking—it reduces the cost of understanding.


Claude Code vs Chat-Based AI Tools

Let’s make this concrete.

If you paste a single file into a chat tool and ask, “What does this do?”, the AI answers based on that isolated snippet.

With Claude Code, you can ask:

“How does authentication flow through this app?”

And Claude can:

  • Inspect multiple files
  • Follow imports and routes
  • Notice config files and environment variables
  • Summarize the actual architecture, not a guess

Analogy: Chat-based AI is like looking at one page torn from a manual. Claude Code is like having someone read the entire manual and explain how the system works.

This difference becomes massive once your project grows beyond a few files.


Installation and Setup

Claude Code is designed to feel like any other developer tool you install once and then forget about.

Prerequisites:

  • Node.js installed (LTS recommended)
  • A terminal you’re comfortable using
  • An Anthropic account with API access

Install Claude Code (typical setup):

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

Once installed, verify it works:

claude --version

If you see a version number, you’re ready for the next step.


Authentication and Permissions

Claude Code needs permission to:

  • Access your local files
  • Use the Claude API on your behalf

Authentication is explicit and opt-in. Nothing is hidden.

Authenticate Claude Code:

claude auth login

This will:

  1. Open a browser window
  2. Ask you to log into your Anthropic account
  3. Store a local token for future use

Important mental model: Claude Code only sees the files in the directory you run it from (and below). If you don’t want Claude reading a folder, don’t run it there.

That’s your first safety guardrail.


Your First Claude Code Commands

Navigate to an existing project:

cd your-project

Start Claude Code:

claude

You’re now in an interactive session where Claude understands your repo.

Try a few foundational commands:

Explore the project:

What is this project? Give me a high-level overview.

Understand structure:

Explain the folder structure and what each main directory is for.

Locate logic:

Where is user authentication handled?

Notice what’s happening: you didn’t paste a file, name a framework, or explain context. Claude inferred all of that from the codebase itself.

That’s the core superpower you’ll build on in the rest of this course.


The Aha Insight

Most developers think AI saves time by writing code faster.

In practice, the biggest win comes from understanding code faster—especially code you didn’t write. Claude Code is optimized for that reality, not the fantasy of greenfield projects.

Key Takeaways

  • Claude Code works directly with your local codebase, not just pasted snippets
  • It’s fundamentally different from chat-based AI because it understands project-wide context
  • Installation is a one-time CLI setup using familiar developer tools
  • Authentication is explicit and scoped to where you run Claude Code
  • Your first wins will come from asking high-level questions about real projects

Try It

Pick an existing repository you haven’t touched in a while (or one you didn’t write).

  1. Install and authenticate Claude Code
  2. Navigate to the repo root
  3. Start Claude Code
  4. Ask:
    • “What does this project do?”
    • “Which files are most important to understand first?”
    • “If I were onboarding a new developer, what would they need to know?”

Spend 10 minutes comparing Claude’s explanation to your own mental model. That gap—what you learned quickly—is exactly why Claude Code is worth mastering.