Claude Code Setup on Windows, Mac and Linux
What you need before installing Claude Code
Claude Code is a terminal-based coding assistant, so the setup is simple if your system already has a modern shell, Node.js, and Git. On macOS and Linux, you can usually install everything directly. On Windows, the most reliable path is WSL2, because it gives Claude Code a Linux environment that behaves like a normal developer machine.
Before you start, make sure you have:
- Node.js installed, ideally the current LTS release
- Git for working inside repos
- An Anthropic-compatible Claude API account or relay
- A terminal you are comfortable using
Step 1: Install Claude Code on macOS
macOS is the easiest place to begin. Open Terminal and install the basics if needed. Homebrew is the fastest way to get ready:
- Install Homebrew if you do not already have it
- Install Node.js and Git with Homebrew
- Install Claude Code using the package manager command from Anthropic’s docs
Once installed, launch the CLI from the folder where your code lives. If it asks for authentication, provide your API credentials or complete the browser login flow depending on the version you are using.
A practical tip: use a clean project folder first, not your entire home directory. That keeps your first test safe and easy to undo.
Step 2: Install Claude Code on Linux
On Linux, the process is almost identical. Update your packages, install Node.js, Git, and the Claude Code CLI, then verify that the command runs in your shell.
- Update packages with your distro’s package manager
- Install Node.js LTS and Git
- Install Claude Code globally
- Open a project directory and start the tool
If you use nvm, that is often the cleanest approach because you can switch Node versions without breaking system packages. This matters when you want Claude Code to work consistently across different projects and CI environments.
Step 3: Set up Claude Code on Windows with WSL2
Windows users should not fight native shell quirks. Use WSL2 with Ubuntu instead. This gives you a real Linux environment, which is much closer to how most AI coding tools are tested.
- Enable WSL2 from an elevated PowerShell window
- Install Ubuntu from the Microsoft Store
- Open Ubuntu and update packages
- Install Node.js, Git, and Claude Code inside WSL
Keep your code inside the WSL filesystem, such as your Linux home directory, rather than inside a Windows-mounted path. That improves speed and avoids file permission problems.
If you want to use Visual Studio Code, install the WSL extension so you can edit files on Windows while Claude Code runs inside Linux.
Step 4: Connect Claude Code to 59API for lower costs
Here is where setup becomes more affordable. 59API is an AI API relay that gives you pay-as-you-go access to Claude models like Opus, Sonnet, Haiku, and Fable, using native, official-quality models without a downgrade. It is also among the cheapest relay options, which matters if you use Claude Code every day.
To use 59API, sign in, create your API key, and point your Claude-compatible client to the base URL https://api.59api.com. In practice, that means configuring Claude Code with your 59API credentials instead of a direct Anthropic billing account, so your requests route through the relay.
This is especially useful if you are running long coding sessions, testing multiple prompts, or working across several projects. You get the same model family, pay only for usage, and can also benefit from the referral rebate.
Step 5: Test the setup with a real coding task
After installation, open a repo and ask Claude Code to do something small and verifiable, such as explaining the project structure, finding a bug, or suggesting a refactor. A good first test is:
- Summarize the current repository
- Locate a function and explain what it does
- Generate a small patch and review the diff carefully
If the tool can read files, answer questions, and propose edits, your setup is working.
Common problems and quick fixes
If Claude Code fails to start, check these first:
- Node.js version mismatch: install the current LTS release
- Wrong shell environment: on Windows, use WSL2, not PowerShell
- Bad API settings: confirm your key and base URL are correct
- Permission issues: avoid running everything as root
If you want the lowest-cost path to keep using Claude Code regularly, 59API is a strong choice. It keeps the setup simple, supports pay-as-you-go usage, and gives you access to the same class of Claude models developers want for real work. If you have not tried it yet, sign up, grab your key, and connect it to your terminal workflow.
शुरू करने के लिए तैयार?
कुछ ही मिनटों में Claude और GPT जोड़ें, सबसे कम कीमत पर। साइन अप करें और API key पाएं।
मुफ़्त साइन अप