Introduction to Claude Code
Claude Code is an agentic coding tool made by Anthropic that lives in your terminal. It can understand your codebase, make edits across multiple files, run commands, and help you work faster as a developer. Think of it as a senior developer pair-programmer that never gets tired.
What Can Claude Code Do?
- Edit files – Create, modify, and refactor code across your project
- Run commands – Execute shell commands, run tests, manage git
- Search codebases – Find files, grep for patterns, understand architecture
- Debug issues – Analyze errors, trace bugs, suggest fixes
- Answer questions – Explain code, suggest approaches, teach concepts
Prerequisites
- Node.js 18 or later
- An Anthropic API key (or a Claude Pro/Max subscription)
- A terminal (macOS, Linux, or WSL on Windows)
Installation
Install Claude Code globally using npm:
npm install -g @anthropic-ai/claude-codeVerify the installation:
claude --versionFirst-Time Setup
Navigate to any project directory and launch Claude Code:
cd my-project
claudeOn first launch, Claude Code will:
- Ask you to authenticate (either via API key or OAuth with your Anthropic account)
- Request permission to access your project directory
- Present you with an interactive terminal prompt
Authentication Options
Option 1: Anthropic API Key
Set your API key as an environment variable:
export ANTHROPIC_API_KEY="sk-ant-your-key-here"Option 2: Claude Pro/Max Subscription
If you have a Claude Pro or Max subscription, Claude Code will open a browser window for OAuth authentication. This is the easiest option if you already have a subscription.
Configuration
Claude Code stores its configuration in ~/.claude/. Key settings can be configured via:
# View current settings
claude config list
# Set a configuration value
claude config set theme darkQuick Test
Let’s verify everything works. In your project directory, run:
claude "What files are in this directory?"Claude Code should list the files in your current directory, confirming it can read your filesystem and respond to queries.
Summary
You now have Claude Code installed and configured. In the next tutorial, we’ll learn how to have effective conversations with Claude Code to get the most out of it.