Tutorial10 min read

Installation and First Launch - Tutorial

SFEIR Institute•

TL;DR

This tutorial guides you step by step to install Claude Code on your machine, configure OAuth authentication, and launch your first codebase analysis. In 30 minutes, you will go from a blank terminal to an operational AI assistant capable of navigating your projects.

This tutorial guides you step by step to install Claude Code on your machine, configure OAuth authentication, and launch your first codebase analysis. In 30 minutes, you will go from a blank terminal to an operational AI assistant capable of navigating your projects.

Claude Code is the command-line interface (CLI) developed by Anthropic that allows developers to interact with the Claude model directly from their terminal. over 500,000 developers use Claude Code daily to accelerate their development workflow.

The tool installs via npm in under 2 minutes and runs on macOS, Linux, and Windows via WSL2. This installation and first launch guide covers every step, from system prerequisites to mastering keyboard shortcuts, so you can be productive from your very first session.

What are the system prerequisites for installing Claude Code?

Before starting the installation, verify that your environment meets the minimum requirements. Claude Code requires Node.js version 18 or higher and Git installed on your system. In practice, 90% of installation errors come from an outdated Node.js version.

PrerequisiteMinimum VersionRecommended Version (February 2026)Verification Command
Node.js18.0.022.x LTSnode --version
npm9.0.010.xnpm --version
Git2.30+2.43+git --version
SystemmacOS 12+ / Linux / WSL2macOS 14+ / Ubuntu 22.04+uname -a

Run these three commands to validate your environment:

node --version
npm --version
git --version

If Node.js is not installed, use nvm (Node Version Manager) to install it properly. Nvm is a version manager that lets you switch between different Node.js versions with a single command. You will find additional details in the installation quickstart guide.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install 22
If you see nvm: command not found, restart your terminal or run source ~/.zshrc (macOS) / source ~/.bashrc (Linux).

Node.js 22 LTS offers 15% better performance than Node.js 18 for intensive CLI operations. Prefer this version for an optimal experience with Claude Code.

Key takeaway: Node.js 18+, npm 9+, and Git 2.30+ are the three essential prerequisites before any Claude Code installation.

How to install Claude Code via npm? (Step 1)

Open your terminal and launch the global installation with npm. A single command is all you need:

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

Verification (~30 seconds): run claude --version to confirm the installation. You should get a version number, for example claude-code v1.0.32.

If you see EACCES: permission denied, do not run sudo npm install. Instead, fix npm permissions with mkdir ~/.npm-global && npm config set prefix '~/.npm-global', then add export PATH=~/.npm-global/bin:$PATH to your ~/.bashrc or ~/.zshrc file.

The package weighs approximately 45 MB once installed. For environments that require a project-local installation, you can also use npx without a global install. In practice, the command npx @anthropic-ai/claude-code downloads and runs Claude Code in a single step. Check the installation FAQ for advanced use cases like installing behind an enterprise proxy.

Installation MethodCommandUse Case
Global (recommended)npm install -g @anthropic-ai/claude-codeDaily use, accessible everywhere
Project-localnpm install --save-dev @anthropic-ai/claude-codeCI/CD, version pinned per project
No installationnpx @anthropic-ai/claude-codeQuick test, temporary environment

Key takeaway: global installation via npm install -g is the recommended method for 95% of developers.

How to launch Claude Code for the first time? (Step 2)

Navigate to an existing project directory, then launch Claude Code:

cd ~/your-project
claude

Verification (~10 seconds): an interactive welcome screen appears with the claude> prompt ready to receive your instructions.

On first launch, Claude Code analyzes the current directory structure in under 3 seconds for a project with 10,000 files. The tool automatically detects the primary language, the framework in use, and the configuration files present. You can also launch Claude Code without a project to ask general questions.

If you want to explore different ways to start a conversation, the first conversations with Claude Code guide offers concrete examples for each situation.

If you see Error: Could not find project root, verify that you are in a directory containing at least one file (even an empty one). Claude Code needs a working context.

Key takeaway: always launch Claude Code from the root of your project so it has access to your entire codebase.

How to authenticate with the OAuth flow? (Step 3)

Run claude in your terminal. On first launch, the tool automatically prompts you for authentication:

claude
# → "Would you like to authenticate? (Y/n)"
# → Press Y, then Enter

Verification (~1 minute): a login page opens in your default browser. Sign in with your Anthropic account, then return to the terminal.

Claude Code uses the OAuth 2.0 protocol with PKCE (Proof Key for Code Exchange) to secure the token exchange. PKCE is an OAuth extension that protects against authorization code interception. No token is stored in plain text on your disk: credentials are encrypted in the system keychain (Keychain on macOS, libsecret on Linux).

Authentication TypeMethodValidity PeriodRenewal
OAuth (default)Browser + token30 daysAutomatic
API KeyANTHROPIC_API_KEY variableUnlimitedManual
Enterprise SSOSAML/OIDCPer policyAutomatic

For server environments without a browser, set an API key as an environment variable:

export ANTHROPIC_API_KEY="sk-ant-api03-your-key-here"
claude

the OAuth flow is recommended for developer workstations as it provides automatic renewal and centralized revocation. The API key remains useful for CI/CD pipelines and headless environments. To understand how Claude Code manages permissions after authentication, check the permissions and security guide.

If the browser does not open automatically, copy the URL displayed in the terminal and paste it manually into your browser.

Key takeaway: OAuth with PKCE is the default authentication method; it stores no secrets in plain text and renews automatically every 30 days.

How to analyze and understand your codebase with Claude Code?

Once authenticated, you can ask Claude Code to explore your project. Here is how to get an overview in a few seconds. Type your questions directly in natural language at the prompt.

claude> Explain the structure of this project
claude> What are the main dependencies?
claude> Show me the application entry points

Claude Code browses the file tree, reads configuration files (package.json, tsconfig.json, Dockerfile, etc.) and produces a structured summary. In practice, analyzing a 50,000-line codebase takes between 5 and 15 seconds depending on complexity.

You can also ask targeted questions about specific files:

claude> What does the handleAuth function in src/auth.ts do?
claude> Are there vulnerabilities in this file?

Claude Code's context capacity reaches 200,000 tokens, equivalent to approximately 150,000 words of analyzable source code in a single conversation. To master context management and avoid overflows, explore the techniques described in the context management guide.

The CLAUDE.md file at the root of your project lets you provide persistent instructions to Claude Code. CLAUDE.md is a memory file that Claude Code reads automatically at each launch. Create it to specify your team's conventions. The dedicated CLAUDE.md memory system tutorial shows you how to structure this file for optimal results.

claude> /init
# → Claude Code generates a CLAUDE.md file tailored to your project

Key takeaway: Claude Code understands your codebase in natural language - ask your questions directly, no special syntax needed.

What are the essential keyboard shortcuts and navigation commands?

Productivity with Claude Code comes from mastering shortcuts. Memorize these combinations to save time in every session. In practice, developers who use keyboard shortcuts reduce their interaction time by 40% compared to full manual typing.

ShortcutActionContext
TabAccept a suggestionWhile typing
Ctrl+CCancel current generationDuring a response
Ctrl+LClear the screenAnytime
Up / DownNavigate through historyEmpty prompt
EscapeExit edit modeDuring an edit
/helpDisplay full helpAnytime
/clearReset the conversationAnytime

Slash commands form the primary navigation system. A slash command is a text shortcut starting with / that triggers a predefined action. Discover all slash commands in the essential commands guide and the advanced slash commands tutorial.

claude> /help          # Displays all available commands
claude> /clear         # Starts a fresh conversation
claude> /compact       # Summarizes the conversation to free context
claude> /config        # Opens configuration settings

The /compact command is particularly useful for long sessions. It compresses conversation history while retaining key information, freeing up to 60% of available context.

Key takeaway: Tab to accept, Ctrl+C to cancel, /compact to free context - these three shortcuts cover 80% of daily interactions.

How to integrate Claude Code into your Git workflow?

Claude Code integrates natively with Git to automate repetitive tasks. Use it to generate commit messages, create pull requests, and resolve conflicts. Git integration supports all providers (GitHub, GitLab, Bitbucket).

claude> Create a commit with the current changes
claude> Generate a PR with a summary of the changes
claude> Help me resolve the conflict in src/index.ts

In practice, Claude Code analyzes the Git diff, understands the semantic context of changes, and produces commit messages conforming to your project's conventions (Conventional Commits, Gitmoji, etc.). using Claude Code for commit generation reduces code review time by 25%.

To leverage all of Claude Code's Git features, check the complete Git integration with practical examples guide. You will find workflows for interactive rebase, assisted cherry-pick, and automatic conflict resolution.

If you want to go further in mastering Claude Code, SFEIR Institute offers the one-day Claude Code training. You will practice installation, advanced configuration, and real-world enterprise use cases through labs led by certified instructors.

Key takeaway: Claude Code generates commits, PRs, and resolves Git conflicts directly from the terminal, without switching tools.

What common errors should you avoid during installation?

Here are the 5 most frequent problems encountered by developers during their first installation, along with their solutions. SFEIR Institute has compiled this feedback from hundreds of training sessions.

1. Incompatible Node.js version

# Error: "engine" requirements not met
nvm install 22 && nvm use 22

This error occurs in 35% of cases on machines with pre-installed Node.js 16.

2. npm global permissions

# Error: EACCES permission denied
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH

3. Enterprise proxy blocking OAuth

# Solution: use an API key
export ANTHROPIC_API_KEY="sk-ant-api03-..."
export HTTPS_PROXY="http://proxy.company.com:8080"

4. WSL2 without configured browser

# Solution: set the default browser
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"

5. Firewall blocking WebSockets

Claude Code uses WebSocket connections on port 443. WebSocket is a persistent bidirectional communication protocol between client and server. Verify that your firewall allows outbound connections on this port.

For other scenarios, the complete installation FAQ covers over 20 troubleshooting scenarios with tested solutions.

Key takeaway: 90% of installation problems are resolved by updating Node.js and fixing npm permissions.

How to go further after installation?

You have installed Claude Code, configured authentication, and explored your first project. Now move to the next level with these resources and advanced practices.

Recommended next steps:

  1. Configure the CLAUDE.md file to customize Claude Code's behavior on each project
  2. Explore advanced slash commands (/compact, /config, /cost)
  3. Integrate Claude Code into your CI/CD pipeline for automatic PR analysis
  4. Test multi-file mode for large-scale refactoring
  5. Enable custom hooks to automate pre-commit checks

To dive deeper into each of these topics, check the installation and first launch page which centralizes all available guides.

The 2-day AI-Augmented Developer training offered by SFEIR Institute covers advanced use of Claude Code combined with other AI tools. You will learn to orchestrate multiple AI assistants in a complete professional workflow with hands-on exercises on real projects. For those who already master the basics, the one-day AI-Augmented Developer - Advanced training covers prompt optimization strategies, fine-grained context management, and integration into enterprise architectures.

Key takeaway: installation is just the beginning - configure CLAUDE.md, master slash commands, and integrate Claude Code into your CI/CD pipeline to get the most out of it.

Recommended training

Claude Code Training

Master Claude Code with our expert instructors. Practical, hands-on training directly applicable to your projects.

View program