Prerequisites
- Node.js 18 or higher
- npm
Step 1: Install Claude Code
Install the package globally with npm:Step 2: Authenticate
Runclaude from any directory to start the first-time setup:
API keys take priority when the
ANTHROPIC_API_KEY environment variable is set. For interactive use, OAuth is recommended because it handles token refresh automatically.Step 3: Navigate to your project
Claude Code works within your current directory. Navigate to any project you want to work on:Step 4: Start an interactive session
Runclaude to open an interactive session:
Step 5: Initialize a CLAUDE.md file
Run/init inside your session to generate a CLAUDE.md file for your project:
CLAUDE.md with the commands and context it needs to work effectively in your codebase. You should review and edit the generated file before committing it.
Running a non-interactive command
Use the-p flag to run a single task and print the result, without entering an interactive session. This is useful for scripting or one-off queries:
Key slash commands
Once you’re inside an interactive session, these slash commands are the most useful to know:| Command | Description |
|---|---|
/help | Show available commands and keyboard shortcuts |
/init | Generate or update a CLAUDE.md for the current project |
/memory | View and edit memory files (CLAUDE.md, CLAUDE.local.md) |
/permissions | View or change the current permission mode |
/mcp | Manage connected MCP servers |
/clear | Clear the current conversation context |
/exit | End the session |
Next steps
Core concepts
Understand how Claude Code thinks, plans, and acts on tasks
Permission modes
Learn how to configure how much autonomy Claude has
CLAUDE.md reference
Write effective memory files for your projects
MCP servers
Extend Claude with databases, APIs, and internal tools