[Bug] Performance Degradation: CLI Operations Running Slowly

Status Fixed / completed
Reported on v2.1.112
Maintainer reply None cached
Activity 3 comments · opened Apr 20, 2026 · closed Apr 20, 2026

Bug Description
All very slow this morning.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.112
  • Feedback ID: 134baa4d-858f-45a4-9a8c-78a280f89119

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/michael/.local/share/claude/versions/2.1.112 (expected in multi-process scenarios)\n    at Od_ (/$bunfs/root/src/entrypoints/cli.js:2748:2177)\n    at Ke6 (/$bunfs/root/src/entrypoints/cli.js:2748:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T16:05:13.383Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Sx5 (/$bunfs/root/src/entrypoints/cli.js:8242:9518)\n    at j (/$bunfs/root/src/entrypoints/cli.js:8242:8148)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:8242:8479)\n    at qX (/$bunfs/root/src/entrypoints/cli.js:477:63169)","timestamp":"2026-04-17T16:06:14.385Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Sx5 (/$bunfs/root/src/entrypoints/cli.js:8242:9518)\n    at j (/$bunfs/root/src/entrypoints/cli.js:8242:8148)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:8242:8479)\n    at qX (/$bunfs/root/src/entrypoints/cli.js:477:63169)","timestamp":"2026-04-17T16:06:14.385Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Qf8 (/$bunfs/root/src/entrypoints/cli.js:8242:9948)\n    at A (/$bunfs/root/src/entrypoints/cli.js:8242:9012)\n    at Sx5 (/$bunfs/root/src/entrypoints/cli.js:8242:9838)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T16:06:14.385Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Qf8 (/$bunfs/root/src/entrypoints/cli.js:8242:9948)\n    at closeTabInIDE (/$bunfs/root/src/entrypoints/cli.js:8242:8595)\n    at F (/$bunfs/root/src/entrypoints/cli.js:8242:19612)\n    at onChange (/$bunfs/root/src/entrypoints/cli.js:8242:20655)","timestamp":"2026-04-17T16:06:21.967Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Sx5 (/$bunfs/root/src/entrypoints/cli.js:8242:9518)\n    at j (/$bunfs/root/src/entrypoints/cli.js:8242:8148)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:8242:8479)\n    at qX (/$bunfs/root/src/entrypoints/cli.js:477:63169)","timestamp":"2026-04-17T17:47:09.087Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n    at request (/$bunfs/root/src/entrypoints/cli.js:93:54381)\n    at callTool (/$bunfs/root/src/entrypoints/cli.js:829:9909)\n    at qM7 (/$bunfs/root/src/entrypoints/cli.js:4753:3718)\n    at CB (/$bunfs/root/src/entrypoints/cli.js:4752:37989)\n    at Sx5 (/$bunfs/root/src/entrypoints/cli.js:8242:9518)\n    at j (/$bunfs/root/src/entrypoints/cli.js:8242:8148)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:8242:8479)\n    at qX (/$bunfs/root/src/entrypoints/cli.js:477:63169)","timestamp":"2026-04-17T17:47:09.087Z"},{"error":"Error: Not connected\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:93:54436)\n    at new Promise (native:1:11)\n   …

Note: Content was truncated.

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/48519
  2. https://github.com/anthropics/claude-code/issues/46489
  3. https://github.com/anthropics/claude-code/issues/50107

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

iveelane-fdatracker · 5 months ago

TL;DR

Claude Code CLI consistently fails with API Error: Unable to connect to API (ECONNRESET) against https://api.anthropic.com/v1/messages?beta=true after exhausting its 10-retry budget, specifically on long-running turns in sessions with large accumulated context. The errors are mid-stream resets, not connect-time failures — the server has already accepted the request and begun writing the response when the socket is RST'd. Retry-1 recovers ~64% of failures; retry-2 recovers only ~23%; retries 3–10 are effectively useless on the same turn. I have ~5 weeks of on-disk evidence across 11 projects and 17 sessions.

Full diagnostic report (41 KB, fully de-identified for public posting) is attached at the end of this issue.

Environment

| | |
|---|---|
| Claude Code versions seen in errors | 13 distinct, including current 2.1.114 |
| Model | claude-opus-4-7, including the 1M-context variant (claude-opus-4-7[1m]) in at least some of the affected sessions. Note: Claude Code's session jsonl records message.model as claude-opus-4-7 whether the 1M tier is active or not, so the log cannot distinguish 1M from standard context — this is itself worth fixing (see asks below). |
| OS | macOS 26.3, Apple Silicon iMac |
| Network | Comcast residential, no VPN, no proxy, no corporate filtering, no local packet-filter rules |
| ISP / path | Comcast CGNAT → Comcast iBone → Cloudflare peering → 160.79.104.10 |
| Connect-path health at rest | TCP 22–29 ms, TLS 1.3 51–64 ms, 100% handshake success across 11 probe rounds |

Reproduction pattern

Not a clean one-liner — this is a failure mode that emerges on large accumulated contexts:

  1. Work a Claude Code session long enough that the on-disk .jsonl exceeds ~6 MB (roughly a multi-hour session with many tool calls).
  2. Issue a prompt that requires a long generation or many tool-call round-trips in one turn.
  3. Observe API Error: Unable to connect to API (ECONNRESET) after ~10–20 minutes of retrying.

In my data, sessions >= 6 MB account for 74.6% of size-attributable errors despite being only 1.8% of all sessions on disk.

Key evidence from the data

  • 325 ECONNRESETs across 17 sessions / 11 projects, all against /v1/messages?beta=true.
  • Handshake is not the problem. 11 separate probe rounds showed 100% success with healthy timings. The resets happen after the request body has been accepted and the response has started streaming.
  • cf-ray, server: cloudflare, x-envoy-upstream-service-time all present on successful responses — the failing path is Cloudflare → Envoy → inference worker. The failure mode produces a raw TCP RST rather than a clean 5xx.
  • Retry decay curve: retry-1 success 63.6% → retry-2 22.5% → retry-3+ near zero. Classic "request can't fit in whatever budget is killing it" signature.
  • Longest failing turn: 20.7 minutes before the client gave up. Shape is well outside typical CDN/LB idle defaults.
  • The 1M-context Opus variant was in active use during at least some of the affected sessions (user testimony; unprovable from logs because Claude Code doesn't record the context tier — see ask #8). The 1M tier's larger payloads and potentially distinct backend routing may be a compounding factor or even the dominant failure surface.
  • Secondary signal (~22% of errors): co-time (per local hour) with net::ERR_INTERNET_DISCONNECTED events in the Claude desktop app's main.log. This rules out Wi-Fi link layer as the mechanism (confirmed by 72 h of debug-level log show --predicate 'subsystem == "com.apple.wifi"' with zero deauth / disassoc / roam / beacon-loss events) and points to CGNAT conntrack eviction or ISP-edge flaps on long-lived streams.
github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.