Claude Code Quickstart Guide
Get Claude Code running on your machine in under 5 minutes! This guide covers the essentials to start your AI-powered coding journey.
π Prerequisites
Before you begin, ensure you have:
- Node.js 18+ and npm (or Python 3.8+ for Python installation)
- Git installed and configured
- A supported operating system (macOS, Linux, or Windows)
- A terminal/command prompt
- An Anthropic API key (get one at console.anthropic.com)
π¦ Installation
Option 1: Install via npm (Recommended)
npm install -g claude-codeOption 2: Use without installation
npx claude-codeOption 3: Install via Python
pip install claude-codeOption 4: Install from source
git clone https://github.com/anthropics/claude-code.git
cd claude-code
npm install
npm linkπ Configuration
-
Set your API key:
export ANTHROPIC_API_KEY=your-api-key-hereOr add it to your shell profile (
~/.bashrc,~/.zshrc, etc.):echo 'export ANTHROPIC_API_KEY=your-api-key-here' >> ~/.zshrc -
Verify installation:
claude --version -
Initialize your project (optional):
claude initThis creates:
CLAUDE.mdfor project-specific instructions.claudeignorefor files to exclude- Basic configuration files
π― Your First Session
-
Start Claude Code in your project directory:
cd your-project claude -
Try these commands:
help- Show available commandsls- List files in current directorycat filename.js- View a fileedit filename.js- Edit a file with AI assistance
-
Example tasks to try:
"Add error handling to the login function" "Write unit tests for the user service" "Refactor this code to use async/await" "Add JSDoc comments to all functions"
π‘ Essential Commands
| Command | Description |
|---|---|
claude | Start interactive mode |
claude "task" | Execute a single task |
claude --help | Show all options |
claude --model opus-4 | Use a specific model |
claude --resume | Resume last session |
π οΈ Basic Configuration
Create a CLAUDE.md file in your project root for project-specific instructions:
# Project-Specific Instructions
- Use TypeScript for all new files
- Follow ESLint configuration
- Write tests for all new functions
- Use conventional commitsFor more advanced configuration options, see the Configuration Guide.
π₯ Quick Tips
- Be Specific: Clear, detailed requests get better results
- Use Context: Reference specific files and functions
- Iterate: Break complex tasks into smaller steps
- Review Output: Always review generated code before committing
π Next Steps
Now that you have Claude Code running:
- Complete the Tutorial - Learn advanced features
- Explore Patterns - Discover best practices
- Configure Hooks - Automate your workflow
- Try TypeScript SDK - Build custom integrations
π Need Help?
- Check the Troubleshooting Guide
- Visit our GitHub Discussions
- Report issues at GitHub Issues
π Congratulations!
Youβve successfully set up Claude Code! Youβre now ready to enhance your coding workflow with AI assistance.
π Dive Deeper
Youβve got the basics down. Hereβs where to go next to become an expert:
- Secure Your Code: As you write custom functionality, itβs crucial to understand the security implications. See our Core Hooks Security Guide for essential best practices.
- Master the Build: Ready to build for production? Learn how to integrate with modern tools in our Modern Build Tools Integration Guide.
- Explore the Core: Understand the fundamental building blocks of this project by reading about Our Core Philosophy.