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
- How to set up the desktop application on Mac, Windows, or Linux
- 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.
Install with the Native Installer
The native installer is the recommended method. It needs no Node.js and updates itself in the background.
On macOS, Linux, or WSL, run:
curl -fsSL https://claude.ai/install.sh | bash
In Windows PowerShell, run:
irm https://claude.ai/install.ps1 | iex
Homebrew (brew install --cask claude-code) and WinGet (winget install Anthropic.ClaudeCode) also work, but those installs do not update automatically by default.
Open a new terminal window and verify the installation:
claude --version
Alternative: Install with npm
You can also install Claude Code as a global npm package. This route needs a recent version of Node.js (see the official setup docs for the current minimum). Check your version:
node --version
Then install the package. Do not use sudo:
npm install -g @anthropic-ai/claude-code
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. You will need a paid Claude subscription (such as Pro, Max, Team, or Enterprise) or a Console account with API credits. The free claude.ai plan does not include Claude Code.
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 Claude download page at claude.com/download
- Download the desktop app for macOS
- Drag the app to your Applications folder
- Open the app and sign in with your Anthropic account
Windows Installation
- Visit the Claude download page at claude.com/download
- Download the Windows installer
- Run the installer and follow the prompts
- Open the app and sign in with your Anthropic account
A Linux build of the desktop app is also available. See the Claude Code docs for its setup steps.
Connecting to Your Project
Once the desktop app is open:
- Click Open Folder or drag a project folder into the window
- Claude Code can now read 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
Claude Code automatically sees the text you select. You can also type @ followed by a file name to point it at a specific file. The extension is a chat-style panel, so it does not offer tab completions as you type.
Method 5: JetBrains Extension
For developers using IntelliJ IDEA, PyCharm, WebStorm, GoLand, or other JetBrains IDEs:
Installation
The plugin runs the claude command in your IDE's terminal, so install the CLI first (see Method 1).
- 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
Using Claude Code in JetBrains
Run claude in your IDE's integrated terminal to connect it to the IDE:
- Claude Code runs in the terminal and can read and edit files in your project
- Changes open in the IDE's diff viewer
- Your current selection or tab is shared with Claude Code automatically
- You can review and accept or reject changes
Understanding Your Subscription
Claude Code requires one of the following:
Claude Pro or Max subscription -- Includes Claude Code usage. Best for individual developers. Higher tiers give you higher usage limits.
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
Inside a session, you can check your usage with the /usage command:
/usage
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" -- Open a new terminal first. If that does not help, make sure the install directory is in your PATH. For the native installer on macOS and Linux, this is ~/.local/bin. For npm, run npm prefix -g and add its bin folder to your shell profile.
Authentication failures -- Try running claude auth logout followed by claude auth login to re-authenticate.
Permission errors on npm install -- Use the native installer if you can. If you stay on npm, avoid using sudo. 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
Something else is wrong -- Run claude doctor in your terminal. It checks your install and settings and suggests fixes.
Key Takeaways
- The CLI is the most powerful way to use Claude Code. The native installer is the recommended way to install it, and it needs no Node.js
- The desktop app, web app (claude.ai/code), and IDE extensions (VS Code/JetBrains) provide the same core capabilities with different interfaces
- Authentication requires a paid Claude subscription or a Console account with API credits. The free plan does not include Claude Code
- 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
Quiz
Up next ยท Lesson 3 of 14
Your First Conversation and the Permission System
7 min read
2 of 14 lessons done

