Quick Summary: Claude Code is a terminal-based AI coding assistant that runs on macOS and Linux natively, or on Windows via WSL2. Setting it up requires creating an Anthropic API key, running a platform-specific installer, authenticating with the key, and verifying the installation with a test command.
Claude Code represents Anthropic’s official terminal-based coding assistant. It lives directly in the command line and handles everything from code generation to bug fixes through natural language commands.
But the setup process isn’t always straightforward. Windows users need WSL2. API authentication can trip up first-timers. Version conflicts happen.
This guide walks through the complete setup process for all platforms, from system requirements to your first coding session.

What Claude Code Actually Is
Claude Code is an agentic terminal application that integrates with development environments. It understands codebases, executes routine tasks, and manages git workflows through conversational commands.
Unlike browser-based tools, Claude Code runs locally in the terminal. It accesses project files directly, maintains context across sessions, and integrates with existing development workflows. According to the official Claude Code documentation, the tool connects to Anthropic’s API and supports integration with Amazon Bedrock, Google Cloud Vertex AI, and Azure AI.
The tool operates differently than traditional coding assistants. Real talk: it’s more like having a pair programmer in your terminal than a code completion tool.
System Requirements for Claude Code
Before installation, systems need to meet specific requirements. Here’s what each platform needs:
| Platform | Requirements | Notes |
|---|---|---|
| macOS | macOS 13.0 or later | Native support, straightforward install |
| Linux | 64-bit distribution with glibc 2.28+ | Native support for most modern distros |
| Windows | Windows 10 Build 19041+ or Windows 11 | Requires WSL2 installation first |
All platforms need a stable internet connection for API calls. Claude Code downloads typically require around 50MB, with WSL2 on Windows adding approximately 500MB for the Linux subsystem.
Storage-wise, expect at least 4GB of free space. The application itself is small, but room for dependencies and project files matters.
Windows-Specific Requirements
Claude Code can run on Windows via PowerShell or Command Prompt if Node.js is installed. The tool requires Windows Subsystem for Linux 2 to create a Linux environment.
According to installation guides from claude.ai, Windows 10 systems need Version 1903 or later with Build 19041 or higher. Windows 11 users have WSL2 support built-in. Administrator privileges are required for the initial WSL2 setup.
The process involves enabling virtualization in BIOS, activating Windows features, and installing a Linux distribution. Ubuntu 22.04 LTS is the recommended distribution for compatibility.
Installing Claude Code: Step-by-Step Process
The installation process varies by platform. Here’s how to get Claude Code running on each operating system.
Installing on macOS and Linux
macOS and Linux installations follow the same pattern. Both platforms support native installation without additional setup.
The process starts with downloading the installer. Open a terminal and run:
curl -fsSL claude.ai/install.sh | sh
The script detects the operating system, downloads the appropriate binary, and installs Claude Code to the local bin directory. Installation typically completes in under two minutes with a stable connection.
For systems without curl, wget works as an alternative. The installer adds Claude Code to the system PATH automatically.
Installing on Windows via WSL2
Windows installation requires setting up WSL2 first. Here’s the complete process:
Open PowerShell as Administrator and enable WSL:
wsl –install
This command enables required Windows features, downloads the WSL2 kernel, and installs Ubuntu by default. The system will prompt for a restart. After rebooting, Ubuntu launches automatically to complete user setup.
Create a username and password when prompted. These credentials are for the Linux environment, separate from Windows login details.
Once WSL2 is running, the Linux installation process applies. In the Ubuntu terminal, run the curl command from the macOS/Linux section above.
The installer handles the rest. Claude Code installs within the WSL2 environment and runs through the Ubuntu terminal.
Getting an Anthropic API Key
Claude Code requires an Anthropic API key for authentication. The key connects the local installation to Anthropic’s servers.
Visit the Anthropic Console at console.anthropic.com. Create an account or sign in with existing credentials. Navigate to API Keys in the account settings.
Click “Create Key” to generate a new API key. The key appears once—copy it immediately. Anthropic doesn’t display the full key again after leaving the page.
Store the key securely. It provides full access to the Anthropic API and any associated billing.
Understanding API Costs
Claude Code operates on a pay-per-use model through the Anthropic API. Based on data from claude.ai installation guides, costs vary by model:
| Model | Input Cost | Output Cost |
|---|---|---|
| Claude Opus 4.6 | $5 per million tokens | $25 per million tokens |
| Claude Sonnet 4.6 | $3 per million tokens | $15 per million tokens |
The minimum purchase to activate billing is $5, though community discussions suggest $20-30 provides better headroom for testing. Alternative subscription options include Claude Pro at $20 monthly or Claude Max at $100 monthly for heavy usage.
Default behavior uses Opus until reaching 50% of usage limits, then switches to Sonnet for cost efficiency.
Authentication and First Launch
After installation, Claude Code needs authentication before first use. Launch Claude Code by running:
claude
The first launch prompts for the API key. Paste the key from the Anthropic Console and press Enter. Claude Code validates the key and stores it securely in local configuration files.
Authentication persists across sessions. The API key doesn’t need re-entry unless explicitly removed or when switching accounts.
To verify authentication worked, Claude Code displays a welcome message and command prompt. The interface shows available commands and confirms connection to Anthropic’s API.
Configuring Model Preferences
Claude Code defaults to automatic model selection, but manual configuration is possible. According to the official documentation, users can adjust model selection through the /model command or by setting the CLAUDE_CODE_EFFORT_LEVEL environment variable.
The effort level controls thinking depth for Opus 4.6 and Sonnet 4.6 models: low, medium, or high. Higher effort levels increase reasoning depth but also cost and response time.
For projects requiring deep analysis, including “ultrathink” in prompts temporarily sets effort to high for that specific turn.
Verifying Installation Success
After authentication, verify Claude Code works correctly. Run these basic tests:
claude –help
claude –version
The help command displays available options and commands. Version output confirms which release is installed. Both commands should execute without errors.
Next, test Claude Code in a project directory. Create a test folder:
mkdir test-project
cd test-project
echo “# Test Project” > README.md
claude
Inside the Claude Code session, try basic interactions:
- Type “help” to see available commands
- Ask “explain what you can do”
- Request “summarize this project”
- Test the /help command
These interactions confirm Claude Code can read project files and respond to prompts. Successful responses mean the installation is functional.

Configuring Claude Code for Projects
Claude Code stores project-specific settings in configuration files. These files customize behavior, define memory, and establish workflows.
The primary configuration file is CLAUDE.md in the project root. This file contains instructions, context, and project-specific guidelines that Claude Code references during sessions.
Create a basic CLAUDE.md file:
# Project Context
This is a [project type] built with [technologies].
## Key Guidelines
– [Important rule 1]
– [Important rule 2]
## Project Structure
[Brief explanation of folder organization]
The file accepts Markdown formatting. Claude Code reads this context at session start and maintains it throughout the conversation.
Advanced Configuration Options
Beyond basic context, Claude Code supports advanced configuration through the .claude directory. This directory can contain:
- Skills: Specialized capabilities defined in .claude/skills/SKILL.md
- Commands: Custom slash commands in .claude/commands/*.md
- Hooks: Automated workflows triggered by events
- Plugins: Extended functionality through programmatic integration
According to the official Agent SDK documentation, these features enable sophisticated customization. Skills define reusable capabilities. Commands create shortcuts for common tasks. Hooks automate responses to file changes or tool use.
Using Claude Code: Basic Workflows
With installation complete, Claude Code handles common development tasks through natural language.
Start a session by navigating to a project directory and running:
claude
The prompt accepts plain language requests. Some common workflows:
- Code Generation: “Create a Python function that validates email addresses with proper error handling.”
- Bug Fixing: “This function is throwing a null pointer exception. Can you identify and fix the issue?”
- Refactoring: “Refactor this component to use dependency injection instead of direct instantiation.”
- Git Operations: “Create a new branch, commit these changes with a descriptive message, and push to origin.”
Claude Code maintains context across the session. It remembers previous interactions, tracks file modifications, and understands the broader project structure.
Understanding Plan Mode
For complex changes, Claude Code offers Plan Mode. This mode creates a detailed execution plan before making modifications.
Activate Plan Mode by prefixing requests with “plan:” or using the /plan command. Claude Code then outlines proposed changes, explains the reasoning, and waits for approval before execution.
Plan Mode is particularly useful for refactoring, architectural changes, or modifications affecting multiple files. It provides visibility into what Claude Code intends to do before committing to changes.
Integrating with VS Code and IDEs
While Claude Code runs in the terminal, integration with code editors enhances the workflow. The official VS Code extension brings Claude Code capabilities directly into the editor.
Install the extension from the VS Code marketplace. Search for “Claude Code” and click Install. The extension adds a Claude Code panel to the sidebar.
According to the official VS Code documentation, the extension supports:
| Feature | Shortcut | Description |
|---|---|---|
| Focus Input | Cmd+Esc / Ctrl+Esc | Toggle between editor and Claude |
| Open in New Tab | Cmd+Shift+Esc / Ctrl+Shift+Esc | Start new conversation as tab |
| Open in Terminal | – | Launch terminal mode from VS Code |
The extension maintains feature parity with the terminal version while adding IDE-specific conveniences like inline diffs and @-mention file references.
Updating and Managing Claude Code
Claude Code updates automatically by default. The application checks for new versions periodically and installs updates in the background.
To update manually, run:
claude –update
This forces an immediate check and installation of the latest version. The update process preserves configuration files and authentication credentials.
For organizations requiring version control, auto-updates can be disabled. Set the CLAUDE_CODE_AUTO_UPDATE environment variable to false or configure through server-managed settings.
To install a specific version, use:
curl -fsSL claude.ai/install.sh | sh -s — –version=X.Y.Z
Replace X.Y.Z with the target version number.
Common Setup Issues and Solutions
Several issues commonly occur during setup. Here’s how to resolve them:
- API Key Rejection: If Claude Code rejects the API key, verify there are no extra spaces or characters. Re-copy the key from the Anthropic Console. Check that billing is activated—keys won’t work without a payment method on file.
- WSL2 Installation Failures: Windows systems sometimes fail WSL2 installation due to virtualization settings. Enter BIOS and enable virtualization (Intel VT-x or AMD-V). Ensure Windows version meets minimum requirements.
- Command Not Found: If the terminal doesn’t recognize the claude command, the PATH wasn’t updated correctly. Close and reopen the terminal. For persistent issues, manually add the installation directory to PATH.
- Connection Timeouts: Network restrictions or firewalls can block API calls. Claude Code requires HTTPS access to api.anthropic.com. Corporate networks may need proxy configuration.
- Permission Errors: Linux and macOS installations occasionally hit permission issues. Run the installer with appropriate permissions or install to a user directory instead of system-wide locations.

Check Available AI Credits Before Setting Up Claude Code
Setting up Claude Code usually means experimenting—running prompts, testing integrations, and building small prototypes before anything goes into production. That early stage often leads to a lot of API usage. Instead of paying for every request right away, many developers first look for available credits or startup programs that help reduce those initial costs.
Get AI Perks collects these opportunities in one place. The platform lists AI credits, discounts, and partner programs across AI providers, cloud platforms, and developer tools, with step by step guides explaining how to claim them. In total, the database includes perks from more than 200 tools and millions of dollars in available credits that startups and builders can apply for.
Before you finish setting up Claude Code, check Get AI Perks and claim the AI credits that can cover your first experiments.
Frequently Asked Questions
Do I need to pay for Claude Code?
Claude Code itself is free software, but it requires an Anthropic API key that operates on a pay-per-use model. The minimum account activation is $5, though practical usage typically requires $20-30 in credits. Alternative subscription plans like Claude Pro ($20/month) or Claude Max ($100/month) provide different pricing structures for heavy users.
Can Claude Code run completely offline?
No. Claude Code requires an active internet connection to communicate with Anthropic’s API servers. The application processes requests locally but sends prompts to Claude models running on Anthropic’s infrastructure. There’s no offline mode or local model option.
What’s the difference between Claude Code and Claude.ai?
Claude.ai is a web-based chat interface for general Claude interactions. Claude Code is a specialized terminal application designed specifically for software development. Claude Code integrates with git, reads project files directly, maintains longer development context, and includes coding-specific features like Plan Mode and file editing capabilities.
How do I switch between Claude models?
Use the /model command within a Claude Code session to switch between available models. The default configuration uses Opus until reaching 50% usage, then switches to Sonnet. Manual selection allows choosing specific models based on task requirements—Opus for complex reasoning, Sonnet for faster, cost-effective responses.
Can I use Claude Code in VS Code?
Yes. An official VS Code extension brings Claude Code functionality into the editor. Install it from the VS Code marketplace. The extension provides the same capabilities as the terminal version with additional IDE integration like inline diffs, sidebar panels, and keyboard shortcuts for quick access.
Does Claude Code store my code or conversations?
According to Anthropic’s data usage policies, API interactions are not used to train models. Organizations can configure zero data retention policies through enterprise settings. Code and prompts are transmitted to Anthropic’s servers for processing but handling depends on account configuration and data retention settings.
What happens if Claude Code makes a mistake?
Claude Code includes safety features like git integration and Plan Mode to minimize errors. For mistakes that do occur, standard version control practices apply—git history provides rollback capability. The permission system requires approval for sensitive operations. Some community discussions suggest success rates in the 80-90% range for routine tasks, with supervision recommended for critical changes.
Moving Forward with Claude Code
Claude Code transforms terminal-based development by integrating AI assistance directly into the command line. Setup requires platform-specific installation, API authentication, and basic configuration, but the process is straightforward when following proper steps.
The tool excels at routine development tasks, code generation, and git workflow management. Plan Mode provides safety for complex operations. IDE integration extends capabilities beyond the terminal.
Start with simple tasks to understand how Claude Code interprets requests. Build up to more complex workflows as familiarity grows. Use the /clear command between distinct tasks to maintain clean context. Configure CLAUDE.md files for project-specific guidance.
Teams can explore server-managed settings and plugin marketplaces. Individual developers can benefit from skills and custom commands tailored to frequent patterns.
The GitHub repository at anthropics/claude-code contains additional examples, community plugins, and troubleshooting resources. Official documentation at docs.anthropic.com provides comprehensive technical references.
Now it’s time to start coding. Navigate to a project, launch Claude Code, and see how AI-assisted development changes your workflow.

