Enable Claude Code to Work on Windows Environment

In this post I’m going to discuss how to allow Claude Code to work on Windows environment, which is not restricted by Windows Sub Linux. Yes, I will discuss how to allow your Claude Code to work on Windows directly.

If we try directly to run on Claude Code, you could see the errors as follows.

C:\Users\demo>winget install nodejs
Found Node.js [OpenJS.NodeJS] Version 24.3.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://nodejs.org/dist/v24.3.0/node-v24.3.0-arm64.msi
  ██████████████████████████████  27.4 MB / 27.4 MB
Successfully verified installer hash
Starting package install...
Successfully installed

C:\Users\demo>"C:\Program Files\nodejs\npm" install -g @anthropic-ai/claude-code
npm error code 1
npm error path C:\Users\demo\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node scripts/preinstall.js
npm error 'node' is not recognized as an internal or external command,
npm error operable program or batch file.
npm error A complete log of this run can be found in: C:\Users\demo\AppData\Local\npm-cache\_logs\2025-07-01T15_58_43_751Z-debug-0.log
ShellScript

Now, what we are going to do is to configure Windows such that it is accessible as a SSH server, you would need to configure you Mac or Linux machine to be able to access the Windows machine. It would be better to put those configurations onto a config file rather than feeding parameters to ssh command.

Now we are going to set up the Windows machine such that it acts as a SSH server, the following commands should be running in powershell.

C:\Users\demo>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\demo> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0


Path          :
Online        : True
RestartNeeded : False
PS C:\Users\demo> # Set the SSH-Server service to start automatically
PS C:\Users\demo> Set-Service -Name sshd -StartupType Automatic
PS C:\Users\demo> # Start the SSH-Server service now
PS C:\Users\demo> Start-Service sshd
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
ShellScript

Suppose we now could ssh to the Windows server, let’s do some experiments to see if it works: the idea is simple, once your computer could access the Windows SSH server, you could tell Claude Code to SSH to the Windows Server to work on various tasks, which bypasses the restriction that Claude Code cannot be running on Windows Machines.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *