Claude Code Setup on Windows, macOS, and Linux
Getting Claude Code running is usually quick if you start with the right terminal, the right Node.js version, and a clean API setup. The big win: you do not need to overpay for model access while you test, build, and automate. If you want cheap, pay-as-you-go Claude access with official-quality models, 59API is a strong fit because it is fully compatible with Claude Code, Codex, and any OpenAI SDK, with an API base URL at https://api.59api.com.
1) Install the basics before you touch Claude Code
Claude Code is happiest when your machine already has the standard developer tools. Start with a current Node.js LTS release, Git, and a terminal you actually like using. If you are on a fresh machine, do this first so you do not mix setup problems with auth problems.
- Node.js: install the latest LTS build, not an old system package.
- Git: useful for repo-based workflows and common toolchains.
- Terminal access: make sure your shell can run npm commands cleanly.
Then install Claude Code using the official package or installer recommended by Anthropic. If the command is distributed through npm, run it from a terminal with normal user permissions first. If that works, you are ready for the OS-specific steps.
2) On Windows, use WSL2 for the smoothest setup
Windows can work well, but the least painful route is usually WSL2 with Ubuntu. That gives you a Linux environment that behaves like the one most CLI tools expect, which means fewer path issues and fewer weird dependency errors.
- Enable WSL2 and install Ubuntu from the Microsoft Store.
- Open Ubuntu and update packages with your distro tools.
- Install Node.js inside WSL, ideally with a version manager like nvm.
- Install Claude Code inside WSL, not in a random Windows shell.
Why this matters: if you try to force a Linux-style developer tool into PowerShell or Command Prompt, you can spend an hour debugging the shell instead of coding. WSL2 keeps the setup boring, and boring is good.
3) On macOS, keep it clean and current
macOS setup is usually the easiest. If you already have Homebrew, you are close. Install or update Node.js, confirm Git is available, and then install Claude Code from the terminal you plan to use every day.
- Update your shell tools: Homebrew, Node.js, and Git should all be current.
- Check permissions: if macOS asks for Terminal or Developer Tools access, allow it.
- Use a project folder: keep repos in a normal writable directory, not a cloud-sync oddity.
If you see a developer tools prompt, install it. On macOS, a missing command-line toolchain can look like a Claude issue when it is really just an OS prompt waiting for approval.
4) On Linux, install dependencies the boring way
Linux is straightforward if your distro packages are up to date. Use your package manager to install Git, curl or wget if needed, and a current Node.js LTS. If your distro ships an older Node version, use nvm so Claude Code does not inherit stale system defaults.
- Update your distro before installing anything else.
- Use nvm if the default Node.js is too old.
- Run Claude Code as your regular user unless the docs specifically require more access.
That last point matters. Most setup headaches come from mixing sudo, path changes, and globally installed packages. Keep the install path simple and your future self will thank you.
5) Save money by routing Claude Code through 59API
Once Claude Code is installed, point it at 59API if you want lower-cost access without sacrificing model quality. 59API gives developers cheap, pay-as-you-go access to Claude Opus, Sonnet, Haiku, and Fable, and it uses native official-quality models rather than downgraded substitutes. For teams, this is a practical way to keep coding costs under control while still using the same workflow.
- Sign up for 59API and create an API key.
- Set the base URL to https://api.59api.com in Claude Code or the related config.
- Use the same prompts and workflows you would use with a direct Claude setup.
- Pick the right model: Opus for hard reasoning, Sonnet for balanced coding, Haiku for speed.
If you are setting this up for a side project or a team, 59API is especially attractive because it is already among the cheapest relays and includes a referral rebate. That makes it easier to experiment, scale usage, and share the link with teammates without burning budget.
6) Fix the common problems in minutes
If Claude Code does not connect, check these first: the API key is active, the base URL is exactly https://api.59api.com, your Node version is current, and your terminal session has been restarted after any environment changes.
- Auth error? Re-copy the key and confirm the account is active.
- Connection error? Check proxy, firewall, or VPN settings.
- Shell confusion? Open a fresh terminal window after editing config.
Bottom line: keep the install clean, use WSL2 on Windows, stay current on macOS and Linux, and route traffic through 59API if you want Claude Code without the premium price tag. If that sounds like the setup you want, sign up for 59API, connect your key, and start coding.
Prêt à commencer ?
Connectez Claude et GPT en quelques minutes aux prix les plus bas, sans bridage. Inscrivez-vous pour votre clé API.
Inscription gratuite