PILOT — Private preview. Progress is saved for this browser session only.
HaiPhai.AI Fluency for Biotech

Installing Claude Code CLI — First Run Walkthrough

Lesson 2~20 min2-question check

Module 10 · Lesson 02

Installing Claude Code CLI — First Run Walkthrough

Reading time: 20 minutes Track: Claude Fluency for Teams · Developer path


What Claude Code is

Claude Code is Anthropic's official CLI for working with Claude directly in your terminal and IDE. It's not just a chat interface — it can read your codebase, edit files, run commands, execute tests, and work autonomously on multi-step tasks, all within your development environment.

Key things it does that the chat interface doesn't:

  • Reads files from your actual project (not copies you paste)
  • Can edit files directly with your approval
  • Runs shell commands (tests, builds, linters) and incorporates results
  • Has persistent project context through CLAUDE.md
  • Supports agentic workflows where it takes sequences of actions

Installation

Prerequisites: Node.js 18+ and npm.

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

Verify installation:

claude --version

Authentication: Claude Code uses your Anthropic API key. Set it as an environment variable:

export ANTHROPIC_API_KEY=your_key_here

Add this to your shell profile (~/.zshrc or ~/.bashrc) to persist across sessions. Or run claude and it will walk you through authentication interactively on first launch.

Your first session

Navigate to a project you're working on and run:

cd your-project
claude

This opens an interactive session. Claude can now see your project structure. Try:

> What's the overall structure of this project?
> Find all the API endpoints in this codebase
> What does the authentication flow look like?

Claude will read the relevant files and give you real, accurate answers about your actual code.

Essential commands

CommandWhat it does
claudeStart interactive session in current directory
claude "your prompt"One-shot: run a prompt and exit
claude --continueResume your most recent session
claude --resumePick from recent sessions to resume
/helpShow available slash commands (inside session)
/clearClear conversation history
/compactSummarize conversation to free context
/costShow token usage and cost for session
/exitEnd the session

File and edit operations

When you ask Claude to make changes, it will show you a diff and ask for approval before writing to disk. This is by design — you stay in control.

> Add error handling to the fetchUser function in src/api/users.ts

Claude will:

  1. Read the relevant file(s)
  2. Generate the change
  3. Show you exactly what it proposes to add/change
  4. Wait for your approval before writing

Running commands

Claude Code can run shell commands when needed (with your permission). When debugging:

> The tests are failing. Figure out what's wrong and fix it.

Claude will run your test suite, read the output, identify the failure, propose a fix, and ask before making changes. This tight loop — observe → hypothesize → change → verify — is where Claude Code really accelerates debugging.

Permission modes

Claude Code has three permission modes for how much autonomy it has:

  • Default: Asks before any file edit or shell command
  • Auto-approve edits: Approves file edits automatically, still asks for shell commands
  • Full auto (--dangerously-skip-permissions): Runs autonomously — use only in disposable environments like CI containers

For daily development, the default mode is right. For running automated tasks in CI, you may want full auto within an isolated container.

First week goals

By the end of your first week with Claude Code, aim to have:

  1. Used it to understand a part of your codebase you didn't write
  2. Used it to debug at least one real bug
  3. Used it to generate a small feature or function
  4. Created a CLAUDE.md for your project (covered in Lesson 4)

Knowledge check

2 questions · select an answer to see if you got it
1.What's the key difference between using Claude Code CLI vs. pasting code into Claude.ai chat?
2.Claude Code proposes a change to a critical production file. What happens before the file is actually modified?
Prompt Exercise

You've just cloned an unfamiliar 50,000-line codebase and need to understand it quickly. Write the first prompt you'd send to Claude Code.

Hints
  • Claude Code can already see your file structure
  • Start with architecture before diving into specifics
  • Ask for what you'll actually need to do your work
Ready to apply this?
Practice with AI →

Bring a real challenge from your work — the AI will help you apply what you just learned.