What is going on
Claude Code stops in the middle of a task and prints API Error: Connection lost mid-response. The response above may be incomplete. Older versions said "Connection closed mid-response" instead.
The message means the connection ended before the reply was finished. Part of what you see may be missing, and a step it was about to take may have run only halfway.
Error messages you might see
Common causes
- The internet connection dropped for a moment, for example on Wi-Fi or a phone hotspot.
- A VPN, proxy or company gateway ended the connection before the reply was complete.
- A very long reply or a long task, where one interruption loses the rest.
- A temporary problem on the service side, which many people see at the same time.
How to fix it
These steps are suggestions from users and from the error message itself.
- Check what already happened before you go on. Run
git statusandgit diffto see whether a file was changed halfway. - Tell Claude Code to continue, and ask it to first list what it has already done.
- Try a different network, or turn off the VPN or proxy for a moment.
- Update Claude Code to the latest version and start a new session if the error keeps coming back at once.
- Split the task into smaller steps. A short task has less to lose when a connection drops.
- If many people report the same thing at the same time, check the service status page and wait.
Getting help takes about a minute
No hiring, no back and forth. A real person looks at your app.
-
1
Describe it
Tell us what you need in plain words. You don't have to be technical or have an account to start.
-
2
Free 15-minute call
A verified developer calls you. Many tasks are sorted right there, and it costs nothing.
-
3
Pay after you approve
If there is more to do, you get one fixed price up front. You pay only once you are happy.
Real people, reviewed by hand
Developers who do this every day
Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.
Get helpQuestions
Was my work lost?
Not usually. Files Claude Code already wrote stay on disk. Check git status and git diff to see exactly what changed.
Is it safe to just say continue?
Check what ran first. If a file was changed halfway, ask Claude Code to look at it before it goes on.