How to Install Claude Code on Windows and Get It Running

Share
A Windows laptop on a desk with a terminal window open on the screen.

Claude Code does not install as a native Windows app. On a Windows laptop, the practical setup is to use WSL2 and install Claude Code inside a Linux distro, usually Ubuntu. The steps below show the exact path, from WSL setup to the first launch and the common Windows-specific problems.

Can you install Claude Code on Windows directly?

Not directly, in the normal sense. Claude Code is meant to run in a Linux shell, so on Windows you should use WSL2 instead of trying to install it in PowerShell or Command Prompt.

Windows can be the host system, but Claude Code itself should live inside the Linux environment that WSL2 provides. If you treat it like a normal Windows package, you usually run into missing commands, PATH problems, or a setup that only partly works.

So the short version is: Windows is fine as the desktop, but Claude Code should be installed and run from WSL2, not from a native Windows shell.

What you need before you start

  • Windows 11, or a recent Windows 10 build with WSL2 support.
  • WSL2 enabled on your machine.
  • A Linux distro installed in WSL, such as Ubuntu.
  • Node.js available inside that Linux environment.
  • An Anthropic account you can sign in with.
  • A user account with permission to install software on your PC.

You also want enough free disk space for the Linux distro and the Node.js tools you install inside it. If you already use WSL for other development work, check which distro you plan to use so you do not install Claude Code into the wrong environment by accident.

Set up WSL2 the right way

Start by making sure WSL is enabled and using version 2. The easiest path on current Windows versions is to open PowerShell as Administrator and let Windows install WSL and a default Linux distro for you.

  1. Open PowerShell as Administrator.
  2. Run the WSL install command.
wsl --install

PowerShell (run as Administrator)

  1. Restart your computer when Windows asks you to.
  2. Open the Linux distro that was installed, or install Ubuntu from the Microsoft Store if Windows did not add a distro automatically.
  3. Finish the Linux first-run setup by creating a username and password.
  4. Confirm that WSL is using version 2.
wsl -l -v

PowerShell

You want your distro to show version 2. If it does not, you may need to convert it with wsl --set-version <distro> 2.

Do not skip the Linux first-run setup. If you open WSL and never create the Linux user account, later install steps can fail or behave strangely.

A quick check is to open Ubuntu from the Start menu and make sure you land in a Linux shell prompt, not back in PowerShell. That tells you the Windows side and the Linux side are both working.

Install Claude Code inside WSL

Run the install from inside the WSL Linux terminal, not from PowerShell or Command Prompt. If you are using Ubuntu, open it and stay there for the whole install.

  1. Open your WSL distro, such as Ubuntu.
  2. Make sure Node.js is installed in that Linux environment.

If Node.js is not already there, install it in WSL before you continue. Claude Code needs the Linux-side Node.js, not a Node.js install that only exists on Windows.

  1. Run the Claude Code install command from the WSL shell.
npm install -g @anthropic-ai/claude-code

Linux shell

  1. Wait for the install to finish.
  2. Keep using the same WSL terminal for the first launch.

The main thing to avoid here is mixing environments. Installing Node on Windows and then running Claude Code in WSL usually creates confusion, because WSL and Windows do not share the same toolchain in a way that makes this painless. Keep the install inside Linux, and it is much simpler.

Connect your Anthropic account and first launch

After the install, launch Claude Code from the same WSL terminal. The first run normally starts an authentication flow tied to your Anthropic account.

  1. In the WSL shell, start Claude Code.
claude

Linux shell

  1. Complete the sign-in or authorization prompts that appear.
  2. Follow any browser-based login step if Claude Code opens one.
  3. Return to the terminal when the login finishes.

On first launch, expect a setup flow before you reach the normal prompt. A common pattern is that Claude Code asks you to authenticate, confirms your account, and then drops you into its interactive session. If you see that flow, the install is behaving the way it should.

If the browser opens outside WSL, that is usually fine as long as the terminal session completes the login afterward. The key point is that the terminal ends up authenticated and ready to accept Claude Code commands.

Check that it’s working

A working install should do three things cleanly: the claude command should start, authentication should complete, and you should end up at an interactive prompt instead of an error.

Use this quick check:

  • Run claude in the WSL terminal.
  • Confirm that the terminal recognizes the command.
  • Finish the first-time sign-in if prompted.
  • Look for a Claude Code session prompt rather than a shell error.

If you want one more sanity check, try a tiny first task once you are in the session, such as asking it to describe the files in the current folder. A healthy install responds normally instead of complaining about missing commands or an unauthenticated account.

A normal first-time setup usually looks like a short auth step, then a prompt that is ready to take input. If you reached that point, the install worked.

The Windows mistakes that usually break the setup

A lot of setup trouble comes from mixing Windows and WSL as if they were the same environment. They are not.

The most common mistake is using the wrong terminal. If you install or run Claude Code in PowerShell or Command Prompt, you may get command-not-found errors or a setup that does not persist in the Linux environment.

Another frequent problem is missing WSL integration. You may have WSL installed, but not actually be inside the Linux distro when you run the install. The prompt should look like a Linux shell, not a Windows shell.

Node.js is another trap. If Node is installed only on Windows, WSL usually cannot use it the way Claude Code expects. Install Node inside the Linux distro instead.

Running projects from the Windows filesystem can also cause friction. If possible, keep your repos in the Linux filesystem inside WSL, not under C:\. That usually gives fewer permission and performance issues when Claude Code works with files.

What to do if the terminal says it can’t find Claude Code

If claude is not found, the first thing to check is where you installed it. Run these checks inside WSL, not Windows.

  1. Confirm you are in the Linux shell.
  2. Check whether the package installed globally inside WSL.
  3. Check whether your Linux PATH includes the global npm bin directory.
  4. Restart the WSL terminal and try again.

If the command still is not found, the problem is often one of these:

  • Claude Code was installed in Windows, not WSL.
  • Node.js was installed in Windows, not the Linux distro.
  • The npm global bin directory is not on the Linux PATH.
  • You are opening the wrong shell after install.

If the command exists but still refuses to start, re-open the Ubuntu terminal and try again from a clean WSL session. A stale shell session can keep old PATH values around. If you changed anything in your shell profile, make sure those changes happened in the Linux home directory, not in a Windows profile file.

A good first project to try after installation

Start small. A good first task is to open a tiny repository or even a folder with a few files and ask Claude Code to explain what the code does, list the main files, or point out the entry point.

That gives you a clean test of the whole workflow: WSL is running, Claude Code can read your files, and the session can respond normally. If you already have a small personal project, that is a better first target than a large codebase, because it is easier to tell whether the setup is working or whether you are just fighting your project layout.

Once that works, you can move on to a real task, like reviewing a module, summarizing changes, or helping you edit a file inside the repo.

Conclusion

If you follow the WSL2 path, Claude Code on Windows is straightforward: enable WSL2, install a Linux distro, make sure Node.js is available inside that distro, then install and launch Claude Code from the WSL terminal. Once you have a working first login, keep using that same Linux environment for your projects. If anything feels off, start by checking the shell you are in, because most Windows-specific problems come from mixing up Windows and WSL.

Frequently Asked Questions

Do I need Windows 11 to use Claude Code?

Windows 11 is the easiest setup, but recent Windows 10 builds with WSL2 support can also work. The important part is having WSL2 and a Linux distro available.

Can I install Claude Code with PowerShell?

No, not as the runtime environment. PowerShell can help you install WSL, but Claude Code itself should be installed and run inside the WSL Linux terminal.

Should I install Node.js on Windows or in WSL?

Install it in WSL. Claude Code needs the Linux-side Node.js environment, not a Windows-only Node install.

Where should I keep my code projects?

For the smoothest setup, keep them in the Linux filesystem inside WSL instead of under `C:\` on the Windows side.

Read more