Skip to main content

Prerequisites

  • Node.js 18 or higher
  • npm
To check your Node.js version:
If you need to install or upgrade Node.js, download it from nodejs.org.

Step 1: Install Claude Code

Install the package globally with npm:
Verify the installation:

Step 2: Authenticate

Run claude from any directory to start the first-time setup:
On first run, Claude Code opens your browser and walks you through signing in with your Anthropic account. Once complete, your credentials are stored securely and reused for future sessions. Alternatively, set an API key directly if you prefer not to use OAuth:
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

Run claude to open an interactive session:
You’ll see a prompt where you can type tasks in plain language. Claude reads your project files, runs commands, and makes changes based on what you describe. Example first tasks to try:
Claude shows you what it plans to do before making changes that require permission. You can approve, deny, or ask for a different approach at each step.

Step 5: Initialize a CLAUDE.md file

Run /init inside your session to generate a CLAUDE.md file for your project:
Claude analyzes your repository — reading manifest files, existing documentation, and code structure — and produces a 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.
CLAUDE.md is loaded at the start of every session. It’s the best place to capture things like non-standard build commands, testing quirks, and coding conventions specific to your team.

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:

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