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
| Command | What it does |
|---|---|
claude | Start interactive session in current directory |
claude "your prompt" | One-shot: run a prompt and exit |
claude --continue | Resume your most recent session |
claude --resume | Pick from recent sessions to resume |
/help | Show available slash commands (inside session) |
/clear | Clear conversation history |
/compact | Summarize conversation to free context |
/cost | Show token usage and cost for session |
/exit | End 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:
- Read the relevant file(s)
- Generate the change
- Show you exactly what it proposes to add/change
- 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:
- Used it to understand a part of your codebase you didn't write
- Used it to debug at least one real bug
- Used it to generate a small feature or function
- Created a CLAUDE.md for your project (covered in Lesson 4)