https://github.com/anthropics/claude-code/issues/new/choose

Resolved 💬 2 comments Opened Jun 26, 2026 by kazuya-kazuya-kazuya Closed Jun 29, 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
  • Claude Code: v2.1.191
  • Node.js: v24.16.0

Issue

claude -p "hello" freezes with "Unable to connect to API (ConnectionRefused)"

What I tried

  • claude auth status → logged in (Claude Pro)
  • api.anthropic.com:443 → TcpTestSucceeded: True
  • HTTPS → HTTP 401 (connection works)
  • No proxy, Defender disabled
  • Reinstall, downgrade to v2.1.150 → same error
  • NODE_TLS_REJECT_UNAUTHORIZED=0 → "Execution error" immediately

Works fine

  • WSL: Ubuntu with nvm-installed Claude Code works perfectly
  • VSCode extension with WSL project works perfectly

What Should Happen?

I want to get "Claude Code" working properly in PowerShell.

Error Messages/Logs

Steps to Reproduce

お世話になっております。

Windows環境でClaude Codeを使用すると、常に「Unable to connect to API (ConnectionRefused)」エラーが発生する問題を報告します。

環境

  • OS: Windows 11
  • Claude Codeバージョン: v2.1.191
  • Node.jsバージョン: v24.16.0
  • インストール方法: npm install -g @anthropic-ai/claude-code
  • アカウント: Claude Pro (yumenotabi.kazu@gmail.com)

発生している問題

PowerShell(VSCode内外問わず)で claude または claude -p "hello" を実行すると、以下のエラーが表示されてフリーズします:

Unable to connect to API (ConnectionRefused) · Retrying in 2s · attempt X/10

確認済みの事項

  • claude auth status → 正常にログイン済み(Claude Pro)
  • Test-NetConnection -ComputerName api.anthropic.com -Port 443 → TcpTestSucceeded: True(ネットワーク接続は正常)
  • Invoke-WebRequest -Uri "https://api.anthropic.com/v1/models" → HTTP 401(HTTPS通信は正常)
  • プロキシ設定なし(netsh winhttp show proxy: 直接アクセス)
  • Windows Defenderは無効
  • Claude Codeの再インストールでも解決せず
  • v2.1.150へのダウングレードでも解決せず

WSL環境では正常動作する

以下の方法では正常に動作することを確認しています:

  • VSCodeでプロジェクトをWSL: Ubuntuで開いた場合、サイドパネルの拡張機能は正常に動作する
  • WSL内にnvmでNode.jsをインストールしてClaude Codeを実行すると正常に動作する

Windowsネイティブ環境でのClaude Codeのターミナル実行が全く動作しない状態です。
ご調査いただけますと幸いです。

よろしくお願いいたします。

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.193 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗