Getting Started with Claude Code

Beginner Guide ยท 10 min read ยท Updated April 2026

โœ“ Reviewed by AI Engineering Experts

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)
๐Ÿ’ก Tip: Claude Code works best on macOS and Linux. Windows users should use WSL2 for optimal experience.

Installation

Option 1: Using npm

npm install -g @anthropic-ai/claude-code
bun install -g @anthropic-ai/claude-code

Verify Installation

claude --version

You should see output like: Claude Code v2.1.88

โš ๏ธ Note: If you encounter permission errors on macOS/Linux, try prefixing with sudo or configure npm global permissions properly.

Authentication

After installation, authenticate with your Anthropic account:

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
๐Ÿ’ก Tip: OAuth login (interactive) provides access to additional features like KAIROS mode and Bridge remote control that aren't available with API key authentication.

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.

๐Ÿ’ก Tip: Press Ctrl+C to interrupt Claude if a response is taking too long or you want to stop execution.

Essential Commands for Beginners

  • /help - Show all available commands
  • /clear - Clear the conversation history
  • /exit or Ctrl+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 reading
  • Show me the package.json - View project configuration

Code Understanding

  • Explain how this codebase is structured - Get architecture overview
  • Find all usages of the User class - Search code references
  • What does this function do? - Get code explanations

Next Steps

Now that you're familiar with Claude Code basics, explore these guides:

๐Ÿ’ก Pro Tip: Check out the Code Leak Analysis section for deep technical insights into how Claude Code works internally.