Claude Code

How to Install Claude Code: Complete Setup Guide (2026)

4 min read649 words
MT

Manas Takalpati

Founder, Blue Orchid

Getting Claude Code running should take five minutes. In practice, most people hit one or two snags. I've set it up on a dozen machines - MacBooks, Linux servers, Windows laptops with WSL - and I've seen every error the installer can throw.

This guide covers the entire process from zero to working session, including the gotchas.

Prerequisites

You need three things:

  1. Node.js 18+ - Claude Code is distributed as an npm package
  2. An Anthropic API key - For authentication
  3. A terminal - macOS Terminal, Linux shell, or Windows Terminal with WSL

Verifying Node.js

node --version

Need v18.0.0 or higher. If lower or missing, install via your platform's package manager or use nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 20
nvm use 20

Getting Your API Key

Go to console.anthropic.com, create an account, generate a key. You need credits loaded - start with $20-50.

Installation

One command:

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

Verify: claude --version

If "command not found," add npm's global bin to your PATH:

export PATH="$(npm config get prefix)/bin:$PATH"

Set Your API Key

export ANTHROPIC_API_KEY=sk-ant-your-key-here

Add to your shell profile (~/.zshrc or ~/.bashrc) to persist across sessions.

First Run

Navigate to any project and start:

cd ~/your-project
claude

Claude Code detects your project structure, reads any CLAUDE.md file, and presents an interactive prompt.

VS Code Integration

Open VS Code's integrated terminal and run claude. That's it - Claude Code works alongside any editor. For tighter integration, install the official Claude Code VS Code extension from the Extensions marketplace.

Platform Notes

macOS - Smoothest experience. If npm install fails with EACCES, don't use sudo. Configure npm's prefix instead:

mkdir ~/.npm-global && npm config set prefix '~/.npm-global'

Linux - Works well. Use NodeSource or nvm for modern Node.js versions.

Windows - Requires WSL. Install WSL 2, then follow Linux instructions inside your WSL environment. Performance is better with projects in WSL's native filesystem versus mounted Windows drives.

Setting Up CLAUDE.md

The first thing after installation: create a CLAUDE.md at your project root.

# My Project
## Stack
Next.js, TypeScript, Tailwind
## Commands
npm run dev / npm run build / npm run test
## Conventions
App Router, Server Components by default

This tells Claude Code how to behave in your project. See Claude Code Best Practices for advanced configuration.

Troubleshooting

"command not found: claude" - PATH issue. Run npm config get prefix and add its bin subdirectory to PATH.

"ANTHROPIC_API_KEY not set" - Key not in environment. Check with echo $ANTHROPIC_API_KEY.

Permission errors - Never use sudo npm install -g. Fix npm's directory instead.

Slow startup - Large projects cause slow scans. Add a .claudeignore file to exclude node_modules, dist, etc.

What's Next

With Claude Code installed: create your CLAUDE.md, try plan mode, and start with a small task. For the full workflow, read the Claude Code Complete Guide.

Frequently Asked Questions

Want more? Get tutorials and insights straight to your inbox.

Related Posts