Yes, you can install the Claude Command Line Interface (CLI) on Windows. The official method requires Node.js (version 18 or newer) and uses the npm package manager, with the core command being npm install -g @anthropic-ai/claude-code. After installation, you authenticate with your Anthropic account or an API key, and you can then use Claude directly from PowerShell, Command Prompt, or Windows Terminal.

What the Claude CLI Actually Is

The Claude CLI, officially named Claude Code, is Anthropic's command-line tool for interacting with their Claude language models. It is not a simple chatbot wrapper; it is an agentic coding assistant that can read and modify files in your project, run shell commands, execute tests, and manage multi-step development tasks. On Windows, it runs as a Node.js application, which means it inherits the cross-platform support of Node while still integrating with Windows-specific tools like PowerShell and Git Bash.

Many users confuse the CLI with the Claude desktop app or the web interface. The CLI is text-based and designed for developers who want to keep their workflow inside a terminal. It supports features like diff-based code edits, automated commit messages, and the ability to pipe standard input and output, making it suitable for scripting and CI/CD pipelines.

Prerequisites Before You Begin

Before installing, you need three things:

  • Windows 10 or 11 – both 64-bit versions are supported. Windows 10 version 1809 or later is recommended.
  • Node.js version 18 or newer – the CLI relies on modern JavaScript features. You can check your version by running node --version in a terminal. If you don't have Node, download the LTS version from the official Node.js website.
  • An Anthropic account or API key – you can authenticate with your Anthropic console login (which includes a free tier) or use a paid API key. For heavy usage, an API key is more practical because it allows you to set spending limits.

You also need a terminal application. Windows Terminal is the best choice because it supports Unicode, proper color rendering, and keyboard shortcuts. The legacy Command Prompt (cmd.exe) works but may display some characters incorrectly. PowerShell 5.1 is fine, but PowerShell 7+ is recommended for better compatibility.

Step-by-Step Installation

  1. Install Node.js – Download the Windows Installer (.msi) from nodejs.org and run it. Accept the defaults; this installs npm as well. After installation, open a new terminal and verify with node --version and npm --version.
  2. Install the CLI globally – In your terminal, run npm install -g @anthropic-ai/claude-code. This downloads the package and makes the claude command available system-wide. The installation takes a minute or two depending on your internet speed.
  3. Verify the installation – Run claude --version. You should see a version number like 1.0.x. If you see an error about the command not being recognized, your npm global bin directory is not in your PATH (see troubleshooting below).
  4. Authenticate – Run claude in an empty directory. The CLI will open a browser window asking you to log in to your Anthropic account and grant permission. Alternatively, you can set the ANTHROPIC_API_KEY environment variable to your API key and skip the browser flow.
  5. Start using it – After authentication, you can start a session by typing claude and then asking questions or giving commands. To exit, type exit or press Ctrl+C twice.

Common Installation Problems and Fixes

The most frequent issue on Windows is the 'claude' is not recognized as an internal or external command error. This happens when npm's global bin directory is not in your system PATH. To fix it:

  • Find your npm global prefix by running npm prefix -g. It usually returns something like C:\Users\YourName\AppData\Roaming\npm.
  • Add that directory to your PATH environment variable. Open System Properties → Environment Variables, edit the Path variable, and add the npm directory. Then restart your terminal.

Another common problem is a permission error during installation. If you see EACCES or EPERM, you might be running an older Node setup. The simplest fix is to reinstall Node.js using the default installer, which sets up the correct permissions. Avoid using sudo on Windows; instead, close all terminals and re-run the installer.

If the CLI installs but crashes on startup, the issue is often a missing Visual C++ Redistributable. Node.js on Windows depends on these runtime libraries. Download and install the latest vc_redist.x64.exe from Microsoft's website, then restart your terminal.

Finally, if you are behind a corporate proxy or firewall, npm may fail to download packages. Configure npm to use your proxy with npm config set proxy http://your-proxy:port and npm config set https-proxy http://your-proxy:port.

Using Claude CLI on Windows Effectively

Once installed, the CLI works best when you run it from the root of your project directory. It can read your file structure, so starting it in a folder with code gives it context. For example, if you have a Python script, you can ask Claude to "explain this script" or "add error handling to the main function." It will read the file and propose changes, which you can apply directly.

The CLI supports several useful flags:

  • claude --continue – resumes the last conversation session.
  • claude --output-format json – returns responses in JSON, useful for scripting.
  • claude --dangerously-skip-permissions – bypasses permission prompts (use with caution, as it allows the AI to run arbitrary commands).
  • claude -p "query" – runs a one-off prompt in non-interactive mode, ideal for automation.

On Windows, you can also integrate the CLI with Git Bash or WSL (Windows Subsystem for Linux). If you prefer Linux-style commands, install the CLI inside WSL instead. The installation steps are the same, but you may need to install Node.js inside the WSL distribution first.

Comparing Installation Methods

There are two main ways to install the Claude CLI on Windows: via npm (as described above) or via a standalone binary. The standalone binary is a single executable file that does not require Node.js, but it is currently only officially provided for macOS and Linux. On Windows, the npm method is the only officially supported path. Some third-party tools offer a Windows binary, but they are not maintained by Anthropic and may lag behind in updates.

Another alternative is to use the CLI through a package manager like scoop or chocolatey. As of now, neither has an official Claude Code package, so you would have to create a custom manifest. The npm route is simpler and more reliable.

Safety and Best Practices

The Claude CLI can execute commands on your system, so treat it like a powerful tool. Always review the commands it proposes before running them, especially when it suggests deleting files or modifying system settings. The CLI has a permission system: by default, it asks for confirmation before running shell commands. Do not disable this unless you fully trust the codebase you are working on.

Also, be mindful of your API usage. If you authenticate with an API key, each request costs money based on the model's token pricing. You can set a spending limit in the Anthropic console to avoid unexpected charges. The CLI also stores conversation history locally in your user directory; this is useful for resuming sessions but be aware that sensitive code snippets are stored in plain text.

Finally, keep the CLI updated. Run npm update -g @anthropic-ai/claude-code periodically to get the latest features and security fixes. You can check the installed version with claude --version and compare it to the latest release on the npm registry.

Frequently Asked Questions

Do I need a paid Anthropic subscription to use the CLI? No. You can authenticate with a free Anthropic account, which gives you a limited number of requests per day. For heavier use, you can add a payment method or use an API key with pay-as-you-go pricing.

Can I use the Claude CLI with PowerShell? Yes, the CLI works perfectly in PowerShell 5.1 and PowerShell 7. Just run claude after installation. The only requirement is that your terminal supports ANSI colors; if you see garbled output, update to Windows Terminal.

Why is the CLI so slow on Windows? The CLI is a Node.js application, and Node's startup time on Windows can be a second or two. This is normal. If you are using it in a script, consider using the -p flag for non-interactive mode, which reduces overhead.

How do I uninstall the Claude CLI? Run npm uninstall -g @anthropic-ai/claude-code. This removes the executable and its dependencies. Your conversation history is stored separately in your home directory and is not removed automatically.

Can I use the CLI with other AI models? No, the Claude CLI is specifically designed for Anthropic's Claude models. It will not work with OpenAI, Google, or other providers. If you need a multi-provider CLI, consider using a tool like aider or open-interpreter, which support multiple backends.