Installation and Setup: CLI, Desktop, Web, and IDE Extensions
Before you can start coding with Claude Code, you need to get it installed and configured. The good news is that there are multiple ways to run Claude Code, and setup takes just a few minutes regardless of which method you choose.
In this lesson, you will learn how to install Claude Code through every available channel and get your environment ready for your first coding session.
What You Will Learn
- How to install Claude Code via the command line (npm)
- How to set up the desktop application on Mac or Windows
- How to access Claude Code on the web at claude.ai/code
- How to install the VS Code and JetBrains extensions
- How to authenticate and configure your account
- System requirements and prerequisites
Method 1: Command Line Installation (Recommended)
The CLI is the most powerful way to use Claude Code, and it is the method most developers prefer. Here is how to get it running.
Prerequisites
You need Node.js version 18 or later installed on your system. Check your version:
node --version
If you need to install or update Node.js, visit nodejs.org or use a version manager like nvm:
# Using nvm to install the latest LTS version
nvm install --lts
nvm use --lts
Install Claude Code Globally
Run this command in your terminal:
npm install -g @anthropic-ai/claude-code
This installs the claude command globally so you can use it from any directory. Verify the installation:
claude --version
Authenticate
The first time you run claude, it will prompt you to authenticate. You have two options:
Option A: Anthropic Account (recommended for individuals)
claude
This opens your browser to log in with your Anthropic account. You will need a Claude Pro, Team, or Enterprise subscription, or available API credits.
Option B: API Key
If you prefer to use an API key directly, set it as an environment variable:
export ANTHROPIC_API_KEY=sk-ant-your-key-here
You can add this to your shell profile (~/.bashrc, ~/.zshrc, etc.) so it persists across terminal sessions.
Launch Claude Code
Navigate to any project directory and start Claude Code:
cd ~/projects/my-app
claude
That is it. Claude Code starts up, reads your project, and waits for your instructions.
Useful CLI Flags
Here are some flags you will use frequently:
# Start with a specific prompt (non-interactive)
claude -p "explain the architecture of this project"
# Resume your most recent conversation
claude --continue
# Resume a specific conversation
claude --resume
# Print output as JSON (useful for scripts)
claude -p "list all TODO comments" --output-format json
# Run in non-interactive mode for CI/CD
claude -p "fix lint errors" --allowedTools "Edit,Write,Bash"
Method 2: Desktop Application
The Claude Code desktop app provides the same agentic capabilities as the CLI with a graphical interface.
Mac Installation
- Visit the Anthropic downloads page or the Mac App Store
- Download Claude Code for macOS
- Drag the app to your Applications folder
- Open the app and sign in with your Anthropic account
Windows Installation
- Visit the Anthropic downloads page or the Microsoft Store
- Download the Claude Code installer
- Run the installer and follow the prompts
- Open the app and sign in with your Anthropic account
Connecting to Your Project
Once the desktop app is open:
- Click Open Folder or drag a project folder into the window
- Claude Code indexes your project just like the CLI does
- Start typing your instructions in the conversation panel
The desktop app has the same capabilities as the CLI, including file editing, shell command execution, and git operations. The main difference is the visual interface, which some developers find more comfortable for longer sessions.
Method 3: Web Application
Claude Code is also available at claude.ai/code in your browser. This is ideal when:
- You want to try Claude Code without installing anything
- You are on a computer where you cannot install software
- You want to work on a cloud-hosted project
Getting Started on the Web
- Go to claude.ai/code
- Sign in with your Anthropic account
- Connect your project via the web interface
- Start coding
The web version supports connecting to GitHub repositories directly, making it easy to work on projects without cloning them locally.
Method 4: VS Code Extension
If Visual Studio Code is your primary editor, the Claude Code extension brings AI-powered coding directly into your IDE.
Installation
- Open VS Code
- Go to the Extensions panel (Ctrl+Shift+X or Cmd+Shift+X)
- Search for "Claude Code"
- Click Install on the official Anthropic extension
- Sign in when prompted
Using Claude Code in VS Code
Once installed, you will see a Claude Code icon in your sidebar. Click it to open the Claude Code panel. From there:
- Type natural language instructions to make changes to your code
- Claude Code has access to all files in your open workspace
- Changes appear directly in your editor tabs
- You can review diffs before accepting changes
The VS Code extension also supports inline suggestions, where Claude Code can help with the specific file you are editing.
Method 5: JetBrains Extension
For developers using IntelliJ IDEA, PyCharm, WebStorm, GoLand, or other JetBrains IDEs:
Installation
- Open your JetBrains IDE
- Go to Settings (or Preferences on Mac) then Plugins
- Search for "Claude Code" in the Marketplace
- Click Install and restart your IDE
- Sign in when prompted
Using Claude Code in JetBrains
The JetBrains plugin works similarly to the VS Code extension:
- A dedicated tool window appears for the Claude Code conversation
- Claude Code can read and edit files in your project
- Changes are reflected in your editor with diff highlighting
- You can review and accept or reject individual changes
Understanding Your Subscription
Claude Code requires one of the following:
Claude Pro subscription -- Includes a generous amount of Claude Code usage. Best for individual developers.
Claude Team subscription -- For teams with shared billing and usage management.
Claude Enterprise -- For organizations needing SSO, compliance features, and higher rate limits.
API credits -- If you prefer pay-per-use, you can authenticate with an API key and pay based on usage.
Checking Your Usage
In the CLI, you can check your remaining usage:
claude config
The desktop and web apps show usage information in the account settings panel.
Configuring Your Environment
After installation, there are a few optional but recommended configurations:
Set Your Preferred Editor
Tell Claude Code which editor to use when it needs to show you files:
# In your shell profile
export EDITOR=code # for VS Code
export EDITOR=vim # for Vim
Shell Integration
Claude Code can integrate with your shell for better command execution. The CLI automatically detects your shell (bash, zsh, fish) and adapts accordingly.
Proxy and Network Settings
If you are behind a corporate proxy:
export HTTPS_PROXY=http://proxy.company.com:8080
Troubleshooting Common Issues
"command not found: claude" -- Make sure the npm global bin directory is in your PATH. Run npm bin -g to find the path and add it to your shell profile.
Authentication failures -- Try running claude logout followed by claude to re-authenticate.
Permission errors on install -- Avoid using sudo with npm. Instead, configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to your shell profile:
export PATH=~/.npm-global/bin:$PATH
Slow startup -- Large projects may take a moment on first launch as Claude Code indexes your codebase. Subsequent starts are faster.
Key Takeaways
- The CLI installation via
npm install -g @anthropic-ai/claude-codeis the most powerful and recommended method - The desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code/JetBrains) provide the same core capabilities with different interfaces
- Authentication requires an Anthropic account with a Pro, Team, or Enterprise subscription, or API credits
- Useful CLI flags include
--continueto resume conversations,-pfor non-interactive mode, and--output-format jsonfor scripting - Common issues like "command not found" are usually PATH configuration problems that are easy to fix

