[BUG] ~30s of startup input lag: claude.ai connector-list fetch blocks the event loop (26 connectors)

Status Fixed / completed
Reported on v2.1.278
Maintainer reply None cached
Activity 1 comment · opened Sep 22, 2026 · closed Sep 23, 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?

On startup, typing is unresponsive for about 30 seconds, then works normally for the rest of the session.

Debug logs from claude -d --debug-file show the event loop stalling repeatedly during startup while the claude.ai connector list is fetched. With 26 connectors enabled, GET /v1/mcp_servers aborts on the first attempt with ECONNABORTED, retries after 5s, and does not resolve until about 29s into startup. During that window the event loop is blocked for a cumulative ~26.7s, so keystrokes are dropped or buffered.

Launching with --bare (which skips MCP) has zero event-loop stalls and typing is instant from the first keystroke.

This looks related to #29366 (closed as not planned), but the root cause is different: there is no render/blit loop here, and the stalls track the connector fetch, not the fast-mode check.

What Should Happen?

Input should stay responsive during startup. The connector-list fetch and MCP initialization should not block the event loop or keystroke handling. Connectors should load in the background without freezing the TUI.

Error Messages/Logs

Normal startup (session opens 09:40:33):
09:40:33.438 [claudeai-mcp] Fetching from https://api.anthropic.com/v1/mcp_servers?limit=1000&include_additional_installs=true
09:40:41.185 [event-loop-stall] blocked for 2240ms (cpu=276ms)
09:40:41.218 [claudeai-mcp] Retry budget exhausted after 1 attempt(s)
09:40:41.218 [claudeai-mcp] Fetch failed (ECONNABORTED) after 1 attempt(s)
09:40:41.218 [claudeai-mcp] Connector-list fetch failed transiently; background retry 1/3 in 5000ms
09:40:41.252 [event-loop-stall] blocked for 5138ms [likely sleep/wake]
09:40:44.039 [event-loop-stall] blocked for 1000ms
09:41:02.599 [event-loop-stall] blocked for 18349ms [likely sleep/wake]
09:41:02.601 [claudeai-mcp] Fetching from https://api.anthropic.com/v1/mcp_servers?limit=1000&include_additional_installs=true
09:41:02.922 [claudeai-mcp] Fetched 26 servers

--bare run (MCP skipped):
09:48:26.767 [claudeai-mcp] Disabled: API-key auth precedence active
0 event-loop stalls; typing instant.

Steps to Reproduce

  1. Enable a large set of claude.ai MCP connectors (26 in my case).
  2. Launch claude and start typing immediately.
  3. Keystrokes lag and buffer for about 30 seconds, then input becomes normal.

A/B that isolates it:

  • claude -d --debug-file normal.log produces event-loop stalls clustered on the mcp_servers fetch (see logs).
  • claude --bare -d --debug-file bare.log produces no stalls and instant typing.

Captured on Claude Code 2.1.278, macOS (Darwin 25.6.0, arm64).

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.278 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • 26 claude.ai connectors are enabled on the account. The lag scales with connector count and with how slow the mcp_servers fetch is.
  • The org has Fast mode disabled. It resolves cleanly in the logs ("disabled by your organization") and is not the cause.
  • Accuracy caveat: two of the larger stalls are tagged [likely sleep/wake] with near-zero CPU (for example 18349ms wall against 106ms CPU), so part of the ~26.7s may be process suspension rather than pure blocking. The smaller stalls (2240ms and 1000ms) are not tagged, coincide with the connector fetch, and the --bare run removes all of them.
  • Terminal is cmux (Ghostty-based).
  • Full debug logs available on request.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗