Claude Code Setup for Windows, macOS, Linux
Why Claude Code plus 59API is a smart setup
Claude Code is strongest when it can stay open in your terminal and help with real work: reading a repo, proposing changes, editing files, and explaining what it is doing as it goes. That is great for daily development, but it can also become expensive if you use it a lot.
That is where 59API fits well. It is a low-cost API relay with pay-as-you-go pricing, official-quality Claude models, and compatibility with Claude Code and OpenAI-style tooling. In practice, that means you can keep the same developer workflow, point the CLI at https://api.59api.com, and pay less without sacrificing model quality. You also get access to Claude models such as Opus, Sonnet, Haiku, and Fable, plus GPT models if you want to switch later.
The rest of this guide is a real setup workflow for Windows, macOS, and Linux, so you can get from zero to your first AI-assisted commit with minimal friction.
Step 1: Install the basics
Before Claude Code, make sure your machine has three things: a recent Node.js runtime, Git, and a shell you are comfortable using. Node is the most common dependency for modern AI command-line tools, and Git is useful because Claude Code works best inside a real repository.
- Windows: Use WSL2 if you want the smoothest experience. Claude Code is a terminal tool, and WSL2 avoids path and shell quirks that can slow you down on native Windows shells.
- macOS: Install Homebrew if you do not already have it, then use it to install Node.js and Git.
- Linux: Use your distro package manager or nvm to install Node.js and Git, then confirm both are on your PATH.
Once that is done, verify that your shell can run Node and npm. If those commands work, you are ready for Claude Code.
Windows setup: use WSL2 for the least friction
On Windows, the easiest workflow is: enable WSL2, install Ubuntu, open the WSL terminal, and keep your code inside the Linux filesystem rather than a deeply nested Windows path. That simple choice avoids many file watching and permission headaches.
- Install WSL2 and Ubuntu from Microsoft’s instructions.
- Open Ubuntu, update packages, then install Node.js, npm, and Git.
- Install Claude Code with the official installer from Anthropic.
- Set your API environment values in the WSL shell: your Claude-compatible base URL should be https://api.59api.com, and your API key should be the one from 59API.
- Open your project in WSL, then launch Claude Code from the repo root.
If you want to keep using PowerShell for some tasks, that is fine. But for actual Claude Code sessions, WSL2 is usually the cleanest path.
macOS setup: the fastest path
macOS is usually the simplest environment for Claude Code. After installing Homebrew, install Node.js and Git, then install the Claude Code CLI. Because the shell is stable and the filesystem is Unix-like, there are fewer surprises than on Windows.
- Install Homebrew if it is missing.
- Install Node.js and Git through Homebrew.
- Install Claude Code using the current official install command.
- Add your 59API settings to your shell profile, such as ANTHROPIC_BASE_URL pointing to https://api.59api.com and your ANTHROPIC_API_KEY.
- Reload your shell profile, then run Claude Code from inside your project directory.
A practical tip: keep the first run simple. Open a small repo first, ask Claude to summarize the structure, then move on to code changes once you confirm the connection works.
Linux setup: great for servers and dev boxes
Linux is the most straightforward platform if you already live in the terminal. Install Node.js, npm, and Git using your distro tools or nvm, then install Claude Code. After that, wire in 59API using the same Anthropic-compatible configuration pattern you would use on macOS.
- Update your system packages.
- Install Node.js, npm, and Git.
- Install Claude Code.
- Export your 59API credentials in the shell or add them to your profile so they persist.
- Start Claude Code from the root of your Git repository.
If you work on a remote Linux box over SSH, this setup is especially useful: you can keep coding where the code already lives, rather than syncing files back and forth.
Your first Claude Code session
After installation, open a repository and ask Claude Code to do something concrete. A good first prompt is: inspect this project, explain the main folders, and suggest one small improvement. That gives you a safe test of the model, the repo context, and the edit workflow all at once.
Then try a real task, such as fixing a bug, adding a test, or refactoring a small component. Review the diff carefully, run your test suite, and only then commit. That workflow keeps the assistant useful instead of noisy.
Because 59API is pay-as-you-go and among the cheapest relays, it is a strong choice for this kind of iterative work. You get official-quality Claude output, lower running cost, and a single API layer that can also work with Codex and OpenAI SDK integrations later.
If you want the lowest-friction way to try it, sign up for 59API, grab your key, point Claude Code to https://api.59api.com, and start with one small repo today.
Ready to get started?
Connect Claude & GPT in minutes at the lowest prices — full-power, never downgraded. Sign up to get your API key.
Sign up free