Claude Code - Complete Beginner's Guide
Everything you need to get started with Claude Code effectively

Claude Code: Complete Beginner’s Guide
Table of Contents
- Getting Started
- Prompts
- Summary of Claude Code Features
- Essential Commands
- Best Practices for Beginners
- Common Use Cases
- Troubleshooting
- Advanced Features
- Additional Resources
- Quick Reference Card
Getting Started
What is Claude Code?
Claude Code is an AI-powered coding assistant that helps you understand, write, debug, and refactor code. It can work with your entire codebase and maintain context across conversations.
Installation Instructions
For VS Code Users
macOS Installation
Install VS Code (if not already installed):
# Using Homebrew brew install --cask visual-studio-code # Or download from: https://code.visualstudio.com/
Install Claude Code Extension:
- Open VS Code
- Go to Extensions (
Cmd + Shift + X
) - Search for “Claude Code” or “Anthropic Claude”
- Click “Install”
Alternative: Command Line
code --install-extension anthropic.claude-code
Setup Authentication:
- Open Command Palette (
Cmd + Shift + P
) - Type “Claude: Sign In”
- Follow the authentication prompts
- Enter your Anthropic API key when prompted
- Open Command Palette (
Windows Installation
Install VS Code (if not already installed):
- Download from: https://code.visualstudio.com/
- Run the installer as Administrator
- Choose “Add to PATH” during installation
Install Claude Code Extension:
- Open VS Code
- Go to Extensions (
Ctrl + Shift + X
) - Search for “Claude Code” or “Anthropic Claude”
- Click “Install”
Alternative: Command Line
code --install-extension anthropic.claude-code
Setup Authentication:
- Open Command Palette (
Ctrl + Shift + P
) - Type “Claude: Sign In”
- Follow the authentication prompts
- Enter your Anthropic API key when prompted
- Open Command Palette (
For Cursor Users
macOS Installation
Install Cursor:
# Download from: https://cursor.sh/ # Or using Homebrew brew install --cask cursor
Install Claude Code Extension:
- Open Cursor
- Go to Extensions (
Cmd + Shift + X
) - Search for “Claude Code” or “Anthropic Claude”
- Click “Install”
Alternative: Command Line
# If you have npm installed npm install -g @anthropic-ai/claude-code # Or use the extension marketplace cursor --install-extension anthropic.claude-code
Setup Authentication:
- Open Cursor
- Go to Settings (
Cmd + ,
) - Navigate to “AI” or “Claude” settings
- Enter your Anthropic API key
- Or use Cursor’s built-in authentication
Windows Installation
Install Cursor:
- Download from: https://cursor.sh/
- Run the installer as Administrator
- Follow the installation wizard
Install Claude Code Extension:
- Open Cursor
- Go to Extensions (
Ctrl + Shift + X
) - Search for “Claude Code” or “Anthropic Claude”
- Click “Install”
Alternative: Command Line
# If you have npm installed npm install -g @anthropic-ai/claude-code # Or use the extension marketplace cursor --install-extension anthropic.claude-code
Setup Authentication:
- Open Cursor
- Go to Settings (
Ctrl + ,
) - Navigate to “AI” or “Claude” settings
- Enter your Anthropic API key
- Or use Cursor’s built-in authentication
Getting Your API Key
- Create an Anthropic Account:
- Visit: https://console.anthropic.com/
- Sign up or log in
- Generate API Key:
- Go to “API Keys” section
- Click “Create Key”
- Copy your API key (keep it secure!)
- Set Usage Limits (recommended):
- Set monthly spending limits
- Monitor your usage regularly
First Steps After Installation
- Navigate to your project directory in the terminal
- Open your editor (VS Code or Cursor)
- Launch Claude Code:
- VS Code: Use Command Palette (
Cmd/Ctrl + Shift + P
) → “Claude: Start Chat” - Cursor: Use the built-in chat interface or
Cmd/Ctrl + L
- VS Code: Use Command Palette (
- Run
/init
to let Claude scan your codebase and create aCLAUDE.md
file - Start coding! Ask Claude questions about your code or request help with tasks
Setting Up Your First Project
# Navigate to your project
cd your-project-directory
# Open in your editor
code . # For VS Code
cursor . # For Cursor
# In Claude Code interface, run:
/init
Verification Steps
After installation, verify everything works:
Test Basic Commands:
/init # Should scan your project /clear # Should clear chat history
Test File References:
@package.json # Should load file content
Test Project Understanding:
"Explain what this project does"
Troubleshooting Installation
Common Issues:
- API Key Issues: Make sure your key is valid and has sufficient credits
- Extension Not Loading: Restart your editor after installation
- Permission Errors: Run installer as Administrator (Windows) or check file permissions (macOS)
- Network Issues: Check firewall settings and proxy configuration
Getting Help:
- Check the official documentation
- Visit the Anthropic support portal
- Join the community forums
Prompts
Here are the links to the lessons’ notes and prompts:
- Prompts of Lesson 2: Setup & Codebase Understanding
- Prompts of Lesson 3: Adding Features
- Prompts of Lesson 4: Testing, Error Debugging and Code Refactoring
- Prompts of Lesson 5: Adding Multiple Features Simultaneously - Using Git Worktrees
- Notes for Lesson 6: References to GitHub Integration & Hooks
- Prompts of Lesson 7: Refactoring a Jupyter Notebook & Creating a Dashboard
- Prompts of Lesson 8: Creating Web App based on a Figma Mockup
Summary of Claude Code Features
Managing Project Memory
Types of CLAUDE.md Files
There are three types of CLAUDE.md files, each serving different purposes:
File Type | Location | Purpose | Sharing |
---|---|---|---|
CLAUDE.md | Project directory | Generated with /init Contains project structure, architecture, and coding style Shared with team | ✅ Commit to source control ✅ Shared with other engineers |
CLAUDE.local.md | Project directory | Personal instructions and customizations Not shared with other engineers Contains your personal preferences | ❌ Not shared (add to .gitignore) ❌ Personal use only |
~/.claude/CLAUDE.md | User home directory | Global settings and preferences Applies to all projects Personal configuration | ❌ Not shared ❌ Personal system-wide settings |
Setting Up Your CLAUDE.md Files
/init
: Claude Code scans your codebase and createsCLAUDE.md
file inside your project directory.CLAUDE.md
guides Claude through your codebase, pointing out important commands, architecture and coding style. It’s automatically included in the context each time you launch Claude Code.- Here’s an example of a CLAUDE.md file generated by init for the RAG chatbot example.
#
: Use#
to quickly add a memory. Useful when you see Claude Code repeats an error.Example 1: Since the project is a uv project, we added these to
CLAUDE.md
file using#
:#use uv to run python files or add any dependencies
Example 2: You can inform Claude Code about the database schema, in this case since you have a vector database, you can inform Claude Code about the collections stored in the vector database:
#The vector database has two collections: course_catalog: stores course titles for name resolution metadata for each course: title, instructor, course_link, lesson_count, lessons_json (list of lessons: lesson_number, lesson_title, lesson_link) course_content: stores text chunks for semantic search metadata for each chunk: course_title, lesson_number, chunk_index
Essential Commands
Command | Description |
---|---|
/clear | clears current conversation history |
/compact | summarizes current conversation history |
ESC | interrupt Claude to redirect or correct it |
ESC ESC | rewind the conversation to an earlier point in time |
@ | Mention files with @ to include its content in your request |
/mcp | Manage MCP connection & check available MCP servers with their provided tools (MCP with Claude Code) |
You can use regular bash command within Claude Code, but you need to start the command with !
(for example: !pwd
). You can type exit
to quit Claude Code.
Shortcuts
Shortcut | Description |
---|---|
shift+tab | switch between planning and auto-accept mode |
take a screenshot | cmd+ shift+ ctrl + 4 (Mac) or Win + Shift + S (Windows) |
paste a screenshot | Ctrl + V (might not work on Windows) |
Best Practices for Beginners
1. Start with /init
Always run /init
when you start working on a new project. This helps Claude understand your codebase structure and coding style.
2. Be Specific in Your Requests
Instead of: “Fix my code” Try: “Fix the authentication bug in the login function where users can’t log in with valid credentials”
3. Use @
to Reference Files
When asking about specific files, use @filename.py
to include the file content in your request.
4. Break Down Complex Tasks
For large features, break them into smaller, manageable steps:
- “Create the user model”
- “Add user authentication”
- “Create the user dashboard”
5. Utilize Project Memory
Use #
to add important project-specific information to the appropriate CLAUDE.md
file:
For team-shared information (add to CLAUDE.md
):
#This project uses Django with PostgreSQL
#All API endpoints should return JSON responses
#Follow PEP 8 style guidelines
For personal preferences (add to CLAUDE.local.md
):
#I prefer verbose error messages in debugging
#Always explain the reasoning behind code suggestions
#Use my preferred variable naming convention: snake_case
6. Ask for Explanations
Don’t just ask for code - ask Claude to explain what it’s doing: “Explain how this authentication system works and why you chose this approach”
Common Use Cases
Understanding Existing Code
- “Explain what this function does:
@utils.py
” - “Walk me through the authentication flow in this app”
- “What does this error message mean and how do I fix it?”
Writing New Code
- “Create a REST API endpoint for user registration”
- “Write unit tests for the payment processing module”
- “Add error handling to the database connection function”
Debugging
- “Why is my React component not re-rendering when state changes?”
- “Help me debug this SQL query that’s returning unexpected results”
- “Fix the memory leak in this Python script”
Refactoring
- “Refactor this function to be more readable and efficient”
- “Convert this class-based component to a functional component with hooks”
- “Optimize this database query for better performance”
Learning
- “Explain the difference between async/await and Promises in JavaScript”
- “Show me best practices for error handling in Python”
- “What are the security considerations for this authentication method?”
Troubleshooting
Common Issues and Solutions
Issue: Claude doesn’t understand my project structure
Solution: Run /init
and make sure CLAUDE.md
is created. Add project-specific information using #
.
Issue: Claude gives generic answers
Solution: Be more specific, use @
to reference files, and provide context about your project.
Issue: Long conversation becomes slow
Solution: Use /compact
to summarize the conversation or /clear
to start fresh.
Issue: Claude repeats the same mistakes
Solution: Add a note to CLAUDE.md
using #
to remind Claude about the specific requirement.
Issue: Need to undo recent changes
Solution: Use ESC ESC
to rewind the conversation to an earlier point.
Getting Help
- Use “think” for complex problems that need deeper analysis
- Ask Claude to break down complex tasks into steps
- Request explanations for any code or concepts you don’t understand
Advanced Features
Extended Thinking Mode
For complex tasks (e.g., complex architectural changes, debugging complicated issues), you can use the word “think” to trigger extended thinking mode. There are several levels of thinking:
"think"
< "think hard"
< "think harder"
< "ultrathink"
Each level allocates more thinking budget for Claude.
Use of Subagents
You’ve learned that one of the out-of-the-box tools for Claude Code is Task, which Claude Code can use to launch subagents for complex multi-step tasks. You can explicitly ask Claude Code to use subagents to brainstorm ideas or to investigate multiple aspects of a question or a problem you want to solve. These built-in agents are of general purpose.
You can also create your customized specialized subagents. Each subagent has its own context window, and you can define a custom system prompt and specific tools for each subagent. This part is not covered in this course, but you can check the details in the documentation here.
Additional Resources
To learn more about these features as well as other features, you can check:
- Claude Code Documentation
- Claude Code Common Workflows
- Claude Code Best Practices
- Claude Code Use Cases
There’s also a great course on Anthropic Academy that you can check out to see more examples with Claude Code:
Quick Reference Card
Essential Commands for Daily Use
/init # Initialize project understanding
/clear # Clear conversation history
/compact # Summarize conversation
@filename # Include file in request
#note # Add to project memory
ESC # Interrupt Claude
ESC ESC # Rewind conversation
!command # Run bash command
Sample Beginner Prompts
# Getting started
"Help me understand what this codebase does"
"Explain the main components of this project"
# Writing code
"Create a function that validates email addresses"
"Add error handling to this API endpoint"
# Debugging
"Why is this test failing?"
"Help me fix this TypeError"
# Learning
"Explain this design pattern to me"
"What are the best practices for this framework?"
Pro Tips for Beginners
- Always start with
/init
on new projects - Be specific - include error messages, file names, and context
- Use
@
liberally to reference files - Ask for explanations not just solutions
- Break large tasks into smaller steps
- Choose the right CLAUDE.md file:
- Team info →
CLAUDE.md
(shared) - Personal preferences →
CLAUDE.local.md
(private) - Global settings →
~/.claude/CLAUDE.md
(system-wide)
- Team info →
- Use
/compact
when conversations get long - Don’t hesitate to ask “why” or “how does this work?”
This guide represents my curated notes and insights from working with Claude Code. As AI tools continue to evolve rapidly, I’ll keep this post updated with the latest best practices and features.