WEEK 1 LEARN

Claude Code Fundamentals

Master the essential commands and workflows for effective AI-assisted development.

Learning Progress 0/5 Lessons
Quiz Score: 0/10

LESSONS

0

Getting Started

Claude Code Installation & Setup

Not Started

What is Claude Code?

Claude Code is an agentic coding tool from Anthropic that lives in your terminal. It understands your codebase, helps you edit files, and executes terminal commands—all within a chat-based interface.

  • Natural language coding - Describe what you want in plain English
  • Context-aware - Understands your entire project structure
  • File editing - Can read, create, and modify files
  • Terminal integration - Runs commands and shows results

Requirements

  • macOS or Linux (Windows via WSL2)
  • Node.js 18+ - node --version
  • npm (comes with Node.js)
  • Anthropic API Key or Anthropic Max Plan

Installation

Install Claude Code globally using npm:

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

# Verify installation
claude --version

# Start Claude Code
claude
Tip: If you get permission errors, try sudo npm install -g @anthropic-ai/claude-code or fix npm permissions.

API Key Setup

Claude Code needs your Anthropic API key. You can set it up in two ways:

Option 1: Interactive Login (Recommended)

Run claude and follow the prompts to log in with your Anthropic account.

# Start Claude Code and follow login prompts
claude
Option 2: Environment Variable

Set your API key as an environment variable in your shell profile:

# Add to ~/.zshrc or ~/.bashrc
export ANTHROPIC_API_KEY="sk-ant-..."

# Reload your shell
source ~/.zshrc

Your First Run

Navigate to a project directory and start Claude Code:

Terminal
# Navigate to your project
cd /path/to/your/project

# Start Claude Code
claude

# Try these commands:
/init           # Analyze project and create CLAUDE.md
/help           # Show all available commands
/status         # Show current context and settings
Success! You're now ready to start using Claude Code. Try asking it to explain your codebase or make a small change!
1

Adding Context

/init, CLAUDE.md, # memory, @ references

Not Started

/init - Project Initialization

The /init command analyzes your project structure and generates a CLAUDE.md file containing project context.

Terminal
# Run this at the start of any new project
/init

# Claude will analyze:
# - File structure
# - Dependencies (package.json, requirements.txt, etc.)
# - Existing documentation
# - Code patterns and conventions
💡
Pro Tip

Always run /init when starting work on a new codebase. It helps Claude understand the project context.

CLAUDE.md - Project Memory

The CLAUDE.md file stores project-specific context that persists across sessions. It has three levels:

Project Level
./CLAUDE.md

Specific to current project

Local Level
~/.claude/CLAUDE.md

Shared across local projects

Global Level
Enterprise settings

Organization-wide context

# - Add to Memory

Use the # prefix to add information directly to CLAUDE.md. This is useful for recording learnings or project conventions.

Example Usage
# When you discover important patterns:
# Always use TypeScript strict mode in this project

# Record learned lessons:
# FileSystemContext requires FileSystemProvider wrapper

# Document conventions:
# API routes follow /api/v1/resource pattern

@ - File References

Use @ to reference specific files in your prompts. This adds the file content to context.

Example Usage
# Reference a specific file
@src/components/Button.tsx add a loading state

# Reference multiple files
@package.json @tsconfig.json explain the build setup

# Reference with context
Based on @types/user.ts create a user form component
2

Plan Mode

Think before you act with structured planning

Not Started

What is Plan Mode?

Plan Mode lets Claude analyze and plan without executing code changes. It's essential for complex tasks where you want to understand the approach before implementation.

Activation
# Press Shift+Tab twice to toggle Plan Mode
Shift + Tab + Tab

# Or use the command
/plan

When to Use Plan Mode

Use Plan Mode
  • - Analyzing unfamiliar codebases
  • - Planning complex refactors
  • - Exploring multiple approaches
  • - Understanding dependencies
Skip Plan Mode
  • - Simple, one-line fixes
  • - Familiar, routine tasks
  • - Urgent bug fixes
  • - Quick code generation

Plan Mode Workflow

Example Session
# 1. Enter Plan Mode
[Plan Mode ON]

# 2. Ask Claude to analyze
Analyze how authentication works in this project

# 3. Claude explores without changing files
# - Reads relevant files
# - Identifies patterns
# - Creates a plan

# 4. Review the plan
# 5. Exit Plan Mode and execute
[Plan Mode OFF]
Implement the plan
⚠️
Important

Plan Mode only affects file modifications. Claude can still read files, search, and explore in Plan Mode.

3

Thinking Modes

"think more", "ultrathink" for deep analysis

Not Started

Extended Thinking

Claude can use extended thinking for complex problems. Use keywords in your prompt to trigger deeper analysis.

"think more"

Extended reasoning mode. Good for moderately complex problems.

think more about this architecture
"ultrathink"

Maximum reasoning capacity. Use for highly complex analysis.

ultrathink about this bug

When to Use Extended Thinking

Good Use Cases
# Debugging complex issues
ultrathink about why this race condition occurs

# Architecture decisions
think more about the trade-offs between these approaches

# Security analysis
ultrathink about potential vulnerabilities in this code

# Performance optimization
think more about how to optimize this database query
💡
Usage Tip

Extended thinking uses more tokens. Use it for genuinely complex problems, not simple tasks where quick answers suffice.

4

Context Management

/clear, /compact for efficient token usage

Not Started

Why Context Management Matters

Claude has a context window limit. As you work, the conversation accumulates tokens. Managing context helps maintain performance and relevance.

/clear - Reset Conversation

Completely resets the conversation. Use when switching to a completely different task.

Usage
# Clear entire conversation
/clear

# When to use:
# - Switching to unrelated work
# - After completing a major task
# - When context becomes cluttered

/compact - Compress Context

Summarizes and compresses the conversation while retaining key information. Use to continue work with less token usage.

Usage
# Compress conversation
/compact

# When to use:
# - Long sessions approaching token limit
# - Before adding large file references
# - To maintain context across breaks
/clear
  • - Complete reset
  • - Loses all context
  • - Fresh start
/compact
  • - Preserves key info
  • - Reduces token usage
  • - Continues session

KNOWLEDGE CHECK

Quiz: Week 1 Fundamentals

Question 1/10

Ready for the Challenge?

Apply what you've learned by building features in a real project.

Start Challenge