AI coding tools are becoming a popular choice for developers who want to work faster and handle tasks more efficiently. Many users choose to install Claude Code to streamline coding workflows, automate repetitive work, and manage multi-step processes from a single environment. A proper setup on Windows or Mac helps ensure smooth performance and better integration with advanced AI services. Keep reading to learn how to install Claude Code in Windows and Mac.
How to install Claude Code on Windows?
Windows 11 provides a smooth environment for running modern AI development tools. A few simple setup steps can help ensure Claude Code works properly and connects with the services you plan to use. Follow the instructions below to complete the installation process and start using its features without issues.
Step 1: Install Claude Code using PowerShell
Open PowerShell by pressing Win + S and searching for "PowerShell". Copy and paste the installation command below into PowerShell, then press "Enter" to run it:
PowerShell will automatically download and install Claude Code. Wait until the installation process is complete before continuing. If you prefer CMD or WinGet, Claude Code also provides alternative installation methods in the official documentation.
Step 2: Install Git and Launch Git Bash
Download and install Git for Windows. Keep the default installation settings to ensure Claude Code can access the required command-line tools and run properly.
After downloading Git, open the installer and complete the setup process with the default settings. Keep the installation path unchanged, select "Visual Studio Code" as the default editor if prompted, and make sure "Git from the command line and 3rd-party software" is selected in the PATH configuration options.
Once the installation is complete, open "Git Bash" from the Start menu to verify that Git is working correctly. Git Bash provides the terminal environment needed for Claude Code to run commands on Windows.
Step 3: Verify Claude Code installation
Go back to PowerShell or Command Prompt and run:
If the version number appears, Claude Code has been installed successfully. If not, continue with the PATH configuration steps.
Step 4: Installation complete
Once everything is done, sign in to Claude Code and finish the setup process. After login, the tool is ready to use for running commands and managing AI-assisted workflows directly from the terminal on Windows 11.
How to install Claude Code on Mac/MacOS?
macOS provides a clean and simple way to set up developer tools using built-in terminal support, making installation smooth and consistent for developers. Setting up Claude Code involves following a clear terminal-based process that keeps everything organized and easy to manage. Here's how to install Claude Code on Mac.
Step 1: Install Claude Code via Terminal (curl command)
Open "Terminal" on your Mac using Spotlight Search (Cmd + Space → type "Terminal"). Copy and paste the installation command below into Terminal, then press "Enter":
Terminal will automatically download and install Claude Code. Wait until the installation process is complete before moving to the next step.
Step 2: Confirm Claude Code installation
Wait for the installation process to complete fully. Once done, a confirmation message will appear showing that Claude Code has been installed successfully. If the terminal asks for additional setup, run the suggested command to add Claude Code to your zshrc configuration file for proper access.
Step 3: Load environment configuration
After installation, run the provided command or reload your shell configuration file. This step updates environment variables, so Claude Code works globally in your terminal without path issues. It ensures smooth access whenever you open a new terminal window.
Step 4: Launch Claude Code
In Terminal, type:
Press Enter to start the Claude Code CLI. The setup screen will appear, where you can choose your preferred theme and sign-in method to complete the final configuration.
How to integrate other LLM APIs into Claude Code?
Using Claude Code with external AI models makes development more flexible. Connecting third-party LLM APIs allows developers to run different models in one environment and manage tasks more efficiently. For example, APIs with strong long-context understanding and structured output capabilities can further enhance coding workflows. In the following steps, Kimi is used as an example to demonstrate how to connect an external LLM API with Claude Code.
Step 1: Get the Kimi Code API Key
Note: the api.kimi.ai/coding/ endpoint used in this guide is part of the Kimi Code membership benefit. Make sure you have an active Kimi membership with Kimi Code benefits activated before creating your key — keys from free accounts will be rejected at launch.
Go to the Kimi Code Console, click Create API Key, enter a name and confirm, then copy the key immediately — the full key is shown only once. Your available models and context windows depend on your membership plan (for example, legacy Andante plans use kimi-for-coding with 1M context; Plus/Moderato plans can use k3-256k; Pro/Allegretto and above can use k3 with 1M context or the high-speed variant).
Step 2: Skip login (optional setup script)
After installation, do not start Claude Code yet. Run the following script in your terminal to bypass the default onboarding/login flow and clean up historical configuration. It enables third-party model support and fast mode, and removes stale endpoint, credential, and model entries from ~/.claude/settings.json (leftovers there override environment variables exported in your terminal):
This script requires Node.js (check with node --version; install the LTS version from nodejs.org first if the command is not found). It prints no output when it succeeds — that is expected. Also check shell config files such as ~/.zshrc and ~/.bashrc for stale ANTHROPIC_* exports (Windows users: check user environment variables) and delete them, otherwise they will interfere with the new configuration.
Step 3: Configure API access and launch Claude Code
Two configuration methods are available — pick one, do not mix them. Method 1 writes to ~/.claude/settings.json and takes effect permanently; Method 2 exports variables in the current terminal only, effective for that session. The example below uses k3-256k (256K context); if your plan includes the 1M-context k3, replace every model value with k3[1m] and set both context values to 1048576.
Method 1: Write to settings.json (recommended, persistent)
Write the following into the env field of ~/.claude/settings.json (on Windows: %USERPROFILE%\.claude\settings.json; create the file if it does not exist), then restart Claude Code for them to take effect:
Replace Your API Key with the key you copied in Step 1. The file stores the key in plain text — do not commit it to git. Note that the env block in settings.json overrides same-named variables exported in your terminal.
Method 2: Terminal environment variables (current session only)
macOS / Linux
Windows
Set the same environment variables in PowerShell or system settings, then run:
Replace Your API Key with the key you copied in Step 1. Configuring only some of the model variables makes the corresponding scenarios (main conversation, background summarization, sub-agents) fail silently, so keep the complete set.
If prompted whether to use this API key, confirm to proceed. Afterwards, follow the prompts to select your trusted project folder to complete the authorization.
Step 4: Verify integration status
After launch, run:
If the Base URL shows:
Then integration is successful. Even if the interface still shows Claude models, all requests are being routed through the Kimi Code API.
Benefits of using the Kimi API
Using advanced AI tools in development has become a practical way to speed up work and improve overall code quality. The Kimi API adds strong support for understanding, automation, and team-based workflows in real projects. Here's how it helps developers build and manage systems more efficiently.
Multimodal context understanding for development tasks
The Kimi API understands different types of input like text, design mockups, architecture diagrams, flowcharts, and even videos. It turns this information into clear technical plans that developers can directly use. This helps convert ideas into working code with less manual planning.
More cost-efficient with context reuse
The Kimi API supports context reuse, allowing developers to continue working with existing conversations and project context instead of repeatedly sending the same information. This helps reduce unnecessary token usage, lower API costs, and make long-term development workflows more efficient.
Automates repetitive engineering workflows
Routine and repeated coding tasks can be automated using scripts or AI-driven workflows. These tasks can run with simple commands instead of manual effort every time. This saves time and reduces the chances of human error in daily development processes.
Customizable development workflows with skills and tools
The Kimi API supports custom Skills and tool integrations for different development needs. Teams can connect their own internal tools, scripts, and systems directly into the workflow. This makes the development process more flexible and project-specific.
Multi-agent collaboration for higher quality and efficiency
Different AI agents handle different roles such as coding, testing, architecture, and documentation. These agents can work together in sequence or in parallel to complete tasks faster. This improves both development speed and overall output quality.
Troubleshooting for installing Claude Code
When installing Claude Code on Windows or Mac, users may sometimes face small technical issues due to environment setup, Node.js version, or network conditions. These problems are common in CLI-based tools and can usually be fixed. Below are the most frequent issues and how to understand them practically.
"command not found: claude"
This error usually means Claude Code is not added to your system PATH. The terminal cannot locate the installed binary file. Restarting the terminal or fixing PATH settings normally resolves this issue in most cases quickly and reliably.
Authentication fails, or the browser does not open
This happens when the login process cannot trigger the browser automatically, often on restricted systems or remote environments. In such cases, authentication may need to be done manually using an API key. Once configured, the login process works normally without further issues.
"Network Error" or timeout during installation
Often caused by slow internet, firewall restrictions, or blocked npm access. The installer may fail to connect to required servers during setup. Adjusting network settings, proxy configuration, or switching connections usually fixes the problem effectively.
Claude Code runs slowly
Performance issues are generally not caused by the tool itself but by network latency. Since Claude Code relies on cloud API requests, unstable internet or VPN usage can slow it down. A stable connection usually improves speed significantly and consistently.
Conclusion
Learning how to install Claude Code on Windows or Mac helps you get started with a smoother AI-assisted development workflow. Once set up, you can manage coding tasks more efficiently and streamline everyday development work in a more integrated environment. For more advanced or flexible use cases, you can try the Kimi API to extend these capabilities and improve real-world development workflows.