Getting Started with Claude Code
๐ Table of Contents
What is Claude Code?
Claude Code is Anthropic's official command-line interface (CLI) for Claude, designed specifically for developers. It brings the power of Claude AI directly into your terminal, enabling you to:
- Get help with coding tasks and debugging
- Read, write, and edit files
- Execute shell commands safely
- Search through codebases
- Work with Git repositories
- Integrate with external tools via MCP
Unlike web-based interfaces, Claude Code runs natively in your terminal with deep filesystem access and the ability to execute commands, making it an ideal pair programmer for development workflows.
Prerequisites
Before installing Claude Code, ensure you have:
- Node.js version 18 or higher (or Bun runtime)
- npm or bun package manager
- Anthropic account with active subscription (Pro, Max, or Team)
- Terminal access on macOS, Linux, or Windows (WSL)
Installation
Option 1: Using npm
npm install -g @anthropic-ai/claude-code
Option 2: Using Bun (Recommended)
bun install -g @anthropic-ai/claude-code
Verify Installation
claude --version
You should see output like: Claude Code v2.1.88
sudo or configure npm global permissions properly.
Authentication
After installation, authenticate with your Anthropic account:
Interactive Login (Recommended)
claude login
This opens a browser window for OAuth authentication. Once approved, your terminal will be authenticated automatically.
API Key Login
For CI/CD or headless environments:
export ANTHROPIC_API_KEY="your-api-key-here"
claude --help
Your First Session
Navigate to a project directory and start Claude Code:
cd ~/projects/my-app
claude
Understanding the Interface
When Claude Code starts, you'll see:
- Status line at the top showing model, token usage, and mode
- Message area displaying conversation history
- Input prompt at the bottom for entering commands
Try Your First Task
What files are in this directory?
Claude will use the GlobTool to list files and provide a summary.
Ctrl+C to interrupt Claude if a response is taking too long or you want to stop execution.
Essential Commands for Beginners
Navigation & Help
/help- Show all available commands/clear- Clear the conversation history/exitorCtrl+D- Exit Claude Code
Model Selection
/model- Switch between Claude models (Sonnet, Opus)/model opus- Use Claude Opus for complex tasks/model sonnet- Use Claude Sonnet for faster responses
File Operations
Read the file src/index.ts- Natural language file readingShow me the package.json- View project configuration
Code Understanding
Explain how this codebase is structured- Get architecture overviewFind all usages of the User class- Search code referencesWhat does this function do?- Get code explanations
Next Steps
Now that you're familiar with Claude Code basics, explore these guides:
- Installation & Setup Guide - Detailed setup for all platforms
- Complete Commands Reference - All 117+ commands explained
- Understanding the Tools System - Learn about all 54 tools
- Security Best Practices - Safe usage guidelines