Getting Started & Installation
Install Claude Code, authenticate with your API key, and run your first AI-assisted command in under five minutes.
Install Claude Code, authenticate with your API key, and run your first AI-assisted command in under five minutes.
Claude Code is Anthropic's terminal-native AI coding assistant. Unlike IDE plugins, it runs directly in your shell — making it available in any editor, over SSH, and inside CI pipelines. You interact with it through a conversational REPL and a set of slash commands that map to common development tasks.
Before installing, confirm you have the following:
Check your versions:
node --version # should be v18+
npm --version # should be 9+Install Claude Code globally via npm:
npm install -g @anthropic-ai/claude-codeVerify the install:
claude --versionYou should see output like claude-code 1.x.x.
If you see a permissions error on macOS/Linux, do not use sudo. Instead, fix npm's global prefix: npm config set prefix ~/.npm-global and add ~/.npm-global/bin to your PATH.
Claude Code reads your API key from the environment. The safest approach is to add it to your shell profile:
# ~/.zshrc or ~/.bashrc
export ANTHROPIC_API_KEY="sk-ant-..."Then reload:
source ~/.zshrcAlternatively, create a .env file in your project root:
ANTHROPIC_API_KEY=sk-ant-...
Never commit your API key to version control. Add .env to your .gitignore and use environment variables in CI instead.
Launch the REPL:
claudeYou will see the welcome banner and a > prompt. Type a natural language request:
> explain the purpose of this repo
Claude will read files in the current directory and respond with a summary. That is all there is to it — no configuration, no IDE extension, no mouse clicks.
/help CommandTo see all available slash commands, type:
> /help
Sample output:
Available commands:
/review Review the current file for issues
/fix Apply a suggested fix
/explain Explain selected code
/commit Generate a commit message
/test Generate unit tests
/bug Debug an error
/clear Clear conversation context
/exit Quit Claude Code
To leave the REPL:
> /exit
# or
Ctrl+CYou now have Claude Code installed and authenticated. The key workflow is simple: claude opens the REPL, slash commands trigger specific tasks, and plain text asks free-form questions. In the next module you will learn every slash command in depth.