Claude Code On Windows PowerShell: Install, PATH, HTTP_PROXY, And Network Fix
Claude Code not working in Windows PowerShell? Check installation state, PATH, HTTP_PROXY, HTTPS_PROXY, terminal sessions, local proxy listeners, and CLI network errors in this practical Windows troubleshooting guide.
Main answer
When Claude Code fails in Windows PowerShell, verify the CLI itself before debugging the network: install state, PATH, proxy variables, and the actual proxy listener.
Who should read this
Windows users searching for Claude Code installation, PowerShell setup, PATH problems, HTTP_PROXY, HTTPS_PROXY, or CLI connection failures.
Key check
A browser that works does not prove PowerShell is ready. The `claude` process needs a visible executable path and explicit network variables in the current terminal session.
Next step
Run `claude --version`. If that fails, fix installation or PATH first. If it works, check `HTTP_PROXY`, `HTTPS_PROXY`, and whether the proxy port is listening.
What You'll Learn
- + Why Claude Code can fail in PowerShell even when your browser works fine
- + The most common Windows problems around installation, PATH, and proxy setup
- + Why an explicit HTTP proxy is often more reliable than assuming system-wide proxy settings
- + What to check first in a local HTTP proxy setup
- + A stable troubleshooting sequence that avoids random guesswork
Start Here: Is This An Install Problem Or A Network Problem?
Most Windows Claude Code failures get misdiagnosed because people start with the proxy.
Start with this split:
| Symptom | First place to look |
|---|---|
claude is not recognized | installation or PATH |
claude --version works, but login or requests fail | PowerShell network environment |
| browser works, PowerShell fails | CLI proxy variables |
| proxy is set, still fails | proxy listener, auth, or target connectivity |
The common pattern looks like this:
Browser can open websites
PowerShell can run commands
Claude Code still cannot connect
That does not automatically mean the model service is down. It usually means the terminal session does not have the same network path as the browser.
Use this order:
| Check | Command or clue |
|---|---|
| Command exists | claude --version |
| PATH is active | open a new PowerShell session and run the command again |
| Proxy variables exist | $env:HTTP_PROXY, $env:HTTPS_PROXY |
| Proxy target is reachable | confirm the local HTTP proxy port is actually listening |
| Error type is clear | separate install errors, network errors, and auth errors |
Do not change all of these at once. Fix one layer, open a fresh terminal, test again.
Claude Code Installation On Windows PowerShell: The Fast Check
Before touching any network setting, open a new PowerShell window and run:
claude --version
If PowerShell says the command is not recognized, this page is still useful, but your first task is not proxy setup. Your first task is making sure the Claude Code CLI is installed and visible in the current PATH.
Once claude --version works, move to HTTP_PROXY and HTTPS_PROXY.
If You Only Want The Short Answer
- Your browser reaching the internet does not guarantee that
Claude Codewill work inside PowerShell. - On Windows, the most common causes are not always a generic network failure. They are often missing PATH setup, incomplete installation, or the lack of an explicit HTTP proxy.
- A local
HTTPproxy is often a better first choice for CLI troubleshooting than blindly tryingSOCKS. - The cleanest diagnostic order is: install -> PATH -> proxy -> target connectivity -> specific error type.
Why This Problem Is So Common
Claude Code is hot right now, so a lot of people try it immediately on Windows.
Then the familiar pattern appears:
- the browser works
- some internet access seems fine
- but PowerShell fails as soon as
clauderuns
At that point, many people assume:
- the proxy is broken
- the node is broken
- Anthropic is down
But the most common causes are usually much simpler:
- the command was not installed correctly, or PATH is not active
- the terminal was never given an explicit HTTP proxy
- one or more required network targets are not reachable
First Question: Does The claude Command Even Exist
Start here:
claude --version
If PowerShell says:
- command not found
- not recognized as a command
- not an executable program
then your current problem is not “network access” yet.
It means:
Claude Code is not actually usable in your current PowerShell environment.
This matters because many people start changing proxy settings before confirming that the CLI exists at all.
Common Windows Problem #1: Installed, But PATH Did Not Refresh
This is extremely common with Windows CLI tools.
You think it is installed, but one of these happened:
- the installer did not finish properly
- PATH has not refreshed in the current terminal
- the binary is available somewhere, but not in the current session
The fastest check is:
- open a fresh PowerShell window
- run
claude --versionagain - if it still fails, go back to installation before touching proxy settings
The rule is simple:
confirm the command exists before debugging networking.
Common Windows Problem #2: Browser Proxy Does Not Mean CLI Proxy
This is the most common misunderstanding.
People often say:
- the desktop proxy is already enabled
- the browser works
- so why does PowerShell still fail
The answer is usually:
many CLI tools do not automatically follow the same proxy path as Windows GUI apps.
If the browser works, that only proves the browser path works.
It says very little about what a command-line tool is doing.
Common Windows Problem #3: Do Not Guess Between HTTP And SOCKS
In many local proxy setups, you may see more than one proxy style:
SOCKSHTTP
For many CLI tools, the safest move is not guessing which one they might inherit automatically.
Instead, explicitly set:
$env:HTTP_PROXY="http://127.0.0.1:10809"
$env:HTTPS_PROXY="http://127.0.0.1:10809"
$env:NO_PROXY="localhost,127.0.0.1"
Then test:
claude --version
claude
That helps answer a much more useful question:
- is the issue really that the terminal never had a working proxy path
Why HTTP Proxy Often Matters More Than “Global Proxy”
From the point of view of many CLI tools, what matters most is not what the Windows settings panel looks like.
What matters is whether the process sees clear environment variables such as:
HTTP_PROXYHTTPS_PROXYNO_PROXY
That is why a GUI showing “global proxy enabled” is often not enough by itself.
For CLI tools, explicit proxy configuration is often much more reliable.
A Better Troubleshooting Sequence
If you are stuck right now, use this order and do not skip steps.
1. Check Whether The Command Exists
claude --version
If it does not, stop and fix installation or PATH first.
2. Check Whether Your Local Proxy Is Actually Running
Confirm the local HTTP proxy really exists before you spend time on anything else.
3. Set An Explicit HTTP Proxy
$env:HTTP_PROXY="http://127.0.0.1:10809"
$env:HTTPS_PROXY="http://127.0.0.1:10809"
$env:NO_PROXY="localhost,127.0.0.1"
Then run claude again.
4. Classify The Error Correctly
Different error types point in very different directions:
- command not found: installation or PATH
- timeout or reset: network path
- login failure: connectivity or authentication flow
- startup failure: runtime environment or dependency issue
Do not collapse all of these into “proxy problem.”
5. Only Then Inspect Specific Network Targets
If the basic steps still fail, move on to:
- whether required domains are reachable
- whether your network adds extra restrictions
- whether the PowerShell session has conflicting environment variables
When It Makes Sense To Put Proxy Variables Into Your PowerShell Profile
If you will use Claude Code regularly on Windows, manually setting proxy variables every session gets old fast.
At that point, it makes sense to place them in your PowerShell profile:
$env:HTTP_PROXY="http://127.0.0.1:10809"
$env:HTTPS_PROXY="http://127.0.0.1:10809"
$env:NO_PROXY="localhost,127.0.0.1"
That way every new terminal session starts with a consistent environment.
Just make sure the port you are using is actually stable in your setup.
The Biggest Time-Wasting Mistakes
These are the patterns that usually waste the most time.
1. Blaming The Network Before Confirming The Command Exists
This is the most common mistake.
2. Assuming Browser Success Means CLI Success
That is especially unreliable on Windows.
3. Changing Too Many Variables At Once
If you change PATH, proxy, terminal profile, execution policy, and install method all at once, you will not know what really fixed the issue.
4. Mixing Up HTTP Proxy And SOCKS Proxy
Many people see multiple ports and start guessing randomly.
The Best Mental Model
Treat Claude Code as an environment-sensitive CLI, not as an app that will automatically adapt to everything for you.
That means it needs:
- correct installation
- correct PATH
- a clear proxy path
- access to the right network targets
Once you debug it from that perspective, the whole process usually gets much simpler.
Final Thoughts
If Claude Code is failing on Windows or in PowerShell, the key thing to remember is not one magic command. It is the order:
- confirm the command exists
- confirm the proxy exists
- explicitly set the HTTP proxy
- classify the error type correctly
With the right order, these problems are usually much less mysterious than they first appear.
Continue Reading
- Event background: After The Claude Code Source Leak Went Viral, These Are The 3 Things That Actually Matter
- Technical background: What Is A Source Map, Why Can It Expose Source Structure, And What Does The Claude Code Story Actually Teach?
- CLI comparison: Claude Code vs Codex CLI
References And Related Reading
- Official repository: anthropics/claude-code
- Official setup docs: Claude Code Setup Docs
- Related post: After The Claude Code Source Leak Went Viral, These Are The 3 Things That Actually Matter
Key Takeaways
- - On Windows, Claude Code failures are often caused by PATH or HTTP proxy setup rather than a generic network problem
- - Many CLI tools do not automatically follow the same proxy path as your browser
- - In local proxy setups, the HTTP proxy endpoint is often the safer first choice for CLI tooling
- - The best troubleshooting path is install -> PATH -> proxy -> target connectivity -> specific error type
- - A fixed diagnostic order saves a lot more time than changing multiple settings at once
Need another practical guide?
Search for related tools, error messages, setup guides, and engineering notes across the site.
FAQ
Why does my browser work while Claude Code fails in PowerShell?
Because many CLI tools do not automatically inherit the same proxy behavior as Windows GUI apps or browsers.
What if PowerShell says the `claude` command does not exist?
Then the first problem is installation or PATH, not networking. Confirm the command is actually available before debugging proxy issues.
Should I start with HTTP proxy or SOCKS?
For many CLI tools, an explicit local HTTP proxy is the safer first thing to test.
What is the best first troubleshooting step?
Run `claude --version` first. If the command is not available, stop there and fix installation or PATH before moving to networking.
How do I install Claude Code on Windows PowerShell?
Install the official Claude Code CLI first, open a fresh PowerShell window, then run `claude --version`. Only after the command is visible should you configure proxy variables or login flows.