This guide covers how to install Claude Code locally and the different environments you can use it from.
Note: Claude Code is pre-configured in the DataCamp learning environment. You only need these steps to set it up on your own machine.
Before installing, make sure you have:
- A Claude Pro, Max, Teams, Enterprise, or API Console account — the free Claude.ai plan does not include Claude Code access.
- macOS 10.15+, Linux (64-bit), or Windows with Git for Windows or WSL2.
Run the following in your terminal (macOS or Linux):
curl -fsSL https://claude.ai/install.sh | bashOn Windows (PowerShell):
irm https://claude.ai/install.ps1 | iexOn Windows with WSL2 (recommended): use the macOS/Linux command above inside your WSL terminal.
The native installer requires no dependencies (no Node.js needed), adds Claude Code to your PATH, and enables automatic background updates.
After installation, run:
claudeThis opens a browser window to log in with your Anthropic account.
The most direct way to use Claude Code. Run claude from any project directory in your terminal. Full access to all features including hooks, MCP servers, and agentic workflows.
Claude Code has native extensions for the most widely used editors.
VS Code, Cursor, and Windsurf
Install the Claude Code extension from the Extensions panel (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows/Linux). It works in VS Code and in VS Code forks like Cursor and Windsurf without any additional setup.
The extension adds a graphical panel where you can review Claude's plans, accept edits as visual diffs, reference files with @-mentions, and manage multiple conversations in separate tabs. It includes the CLI, and conversation history is shared between the panel and the integrated terminal.
JetBrains IDEs
Claude Code is available inside JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, and others) through the JetBrains AI subscription. It runs directly in the AI chat panel — no extra plugins or logins required. Supports multi-file diffs, approval-based edits, and MCP server integration.
There is also a standalone Claude Code (Beta) plugin on the JetBrains Marketplace if you prefer to use it outside the JetBrains AI subscription.
Claude Code is available as a tab inside the Claude Desktop app (macOS and Windows). A good option if you want a GUI experience without setting up an IDE extension. The Desktop app also supports Remote Control, which lets you hand off tasks to your machine from your phone.
claude.ai/code runs entirely in a managed sandbox on Anthropic's infrastructure — no local clone or environment setup needed. Link a GitHub repository, describe the task, and Claude executes it end-to-end in an isolated environment, then opens a pull request when done. Useful for kicking off longer tasks or making quick fixes without opening your local dev environment.
Claude Code sessions can be monitored and continued from the Claude iOS app. Particularly useful alongside Remote Sessions, which run on Anthropic's cloud and stay active even when your computer is off.
Close and reopen your terminal. If the issue persists, add the install directory to your PATH manually:
# Add to ~/.zshrc or ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
source ~/.zshrcDo not use sudo. The native installer handles permissions automatically. If you previously used the npm install method, switch to the native installer instead.
Make sure your key is set and has no extra spaces:
export ANTHROPIC_API_KEY="your-key-here"Get your key at console.anthropic.com.
Run these in order to identify most issues:
claude --version # Is Claude Code installed?
echo $ANTHROPIC_API_KEY # Is the key set?
ping claude.ai # Can it reach the network?rm ~/.claude.json
rm -rf ~/.claude/
curl -fsSL https://claude.ai/install.sh | bash