[BUG] ERR_BAD_REQUEST on startup persists across MSIX and npm installs — confirmed not network/proxy/TLS/DNS related

Status Open
Reported on v2.1.209
Maintainer reply None cached
Activity 0 comments · opened Jul 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment:

OS: Windows 11
Node.js: v24.18.0
Claude Code (MSIX/desktop bundle): v2.1.209
Claude Code (npm-global): v2.1.211
Terminal: PowerShell

claude fails immediately on startup, before the login/auth menu appears:
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR_BAD_REQUEST
Please check your internet connection and network settings.
This happens identically with both the MSIX-bundled binary (from Claude Desktop's bundled claude-code\2.1.209\claude.exe) and a completely separate npm install -g @anthropic-ai/claude-code install (v2.1.211, standard Node.js runtime) — ruling out the MSIX/Bun runtime as the cause.
Claude Desktop's own GUI app authenticates and works fine on the same machine, same network, same account — only the CLI fails.
What I've already ruled out:

No system proxy: netsh winhttp show proxy → direct access, no proxy
HTTPS_PROXY / HTTP_PROXY / ANTHROPIC_API_KEY env vars: all empty
Invoke-WebRequest -Uri "https://api.anthropic.com" from the same PowerShell session succeeds and returns a well-formed 403 forbidden / Request not allowed JSON (expected without an API key) — confirms the network path to api.anthropic.com works fine at the HTTP layer
Forced IPv4 via NODE_OPTIONS="--dns-result-order=ipv4first" — no change
Disabled TLS certificate validation via NODE_TLS_REJECT_UNAUTHORIZED=0 — no change (rules out TLS-inspecting proxy/antivirus SSL scanning)
Windows Defender folder exclusion added for the Claude Code binary path — no change
C:\Windows\System32\drivers\etc\hosts — clean, no anthropic/claude entries
Full credential wipe (~/.claude, ~/.claude.json) before retesting — no change
claude --debug — no additional output; the failure happens too early to be captured
No .claude/.log files exist to inspect (Get-ChildItem "$env:USERPROFILE\.claude" -Recurse -Filter ".log" returns nothing)

What Should Happen?

The login menu should appear so I can authenticate via /login (I already have an active Claude subscription and the desktop app confirms my account works).
Additional Information
This appears to match other open reports of the same signature (#38099, #26935, #42319 marked duplicate, #35768) where the failure is isolated to Claude Code's internal HTTP client configuration (configureGlobalAgents) rather than the network stack — direct curl/node https/node http2 calls to the same endpoint succeed in all these reports, same as mine.

Error Messages/Logs

Steps to Reproduce

  1. Install Claude Code via MSIX bundle (Claude Desktop) or via npm install -g @anthropic-ai/claude-code
  2. Run claude in PowerShell on Windows 11
  3. Observe the error below immediately on startup, before the login/auth menu appears

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.211

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗