Skip to content

[BUG] API Error: Connection closed mid-response ==> frequent enough to make Claude Code unusable for any task #69415

Description

@mrctito

Preflight Checklist

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

What's Wrong?

Summary

"API Error: Connection closed mid-response. The response above may be incomplete."
occurs frequently during normal usage. The response is cut off mid-generation with no way
to recover it.

Environment

  • OS: Windows 11 / WSL2 (Ubuntu, kernel 6.18.33.1-microsoft-standard-WSL2)
  • RAM: 64 GB
  • Claude Code: latest version
  • IDE: VSCode (latest), Claude Code extension (latest)
  • Proxy: none
  • Network: direct connection, no corporate firewall

Reproduction

The error occurs consistently when Claude generates long responses — for example,
reading multiple large files and producing a structured report. It does NOT require
any special conditions: no proxy, no low memory, no version mismatch.

Key observation

The same task on the same machine with the same network does NOT produce this error
with any other AI assistant (e.g., GitHub Copilot, Cursor, GPT-4). This strongly
suggests the issue is on Claude Code's streaming layer, not the environment.

Impact

The error is frequent enough to make Claude Code unusable for any task that produces
long responses. The user has to restart and retry repeatedly, often unsuccessfully.

Expected behavior

Long responses should complete normally or, at minimum, be resumable after a
connection drop.

Related issues

What Should Happen?

I just want that Claude works.

Error Messages/Logs

API Error: Connection closed mid-response

Steps to Reproduce

  1. Try to use Claude inside VScode or CLI.

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.181

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:networkingbugSomething isn't workingplatform:vscodeIssue specifically occurs in VS Codeplatform:wslIssue specifically occurs on WSL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions