~15s input lag on startup: network fetches (MCP servers, security.json, marketplace git pulls) block the input loop

Resolved 💬 6 comments Opened Mar 5, 2026 by marckohlbrugge Closed Apr 3, 2026

Description

After launching claude, the TUI renders quickly but the input field is unresponsive for approximately 15 seconds. Keystrokes typed during this period are buffered and appear all at once when input becomes active.

Environment

  • Claude Code version: 2.1.69
  • Platform: macOS (Darwin 25.3.0)
  • Terminal: Ghostty, Terminal.app (same behavior on both)
  • Shell: zsh

Reproduction

  1. Run claude
  2. Immediately try typing — input is unresponsive for ~15s
  3. After ~15s, input becomes active and buffered keystrokes appear

Root cause (from debug log analysis)

All local operations are fast. The input lag is caused by startup tasks blocking the input loop. Network is healthy (13ms ping, 0% packet loss) and the endpoints respond quickly when called directly with curl (~0.2s) — the issue is internal to Claude Code's startup sequencing.

Fast parts (all fine)

| Phase | Duration |
|---|---|
| setup() | 10ms |
| Commands/agents loading | 16ms |
| MCP configs | 26ms |
| Plugin loading | ~200ms |

Slow parts (blocking input)

1. ~10 second gap (14:18:34.721 → 14:18:44.202)
Two network fetches kicked off at ~34.719s:

  • api.anthropic.com/v1/mcp_servers (claudeai-mcp fetch) — result at ~44.2s
  • raw.githubusercontent.com/.../security.json (plugin security messages) — result at ~45.6s

However, calling the same endpoint directly with curl completes in ~0.2s:

$ curl -s -w "Total: %{time_total}s" "https://api.anthropic.com/v1/mcp_servers?limit=1000" ...
Total: 0.214683s

So the 10s gap is not network latency — it's something in Claude Code's internal handling (auth, serialization, or queuing).

2. ~8 second gap (14:18:45.646 → 14:18:54.022)
Likely related to marketplace git pulls (git pull on claude-plugins-official and claude-code-plugins repos)

3. ~11 second gap (14:18:54.646 → 14:19:05.325)
Idle time before the first prompt is processed — unclear what's blocking

4. showSetupScreens() — 283ms (minor)

Note

There is no user-facing setting to disable the claudeai-mcp fetch — it's controlled by a server-side gate.

Additional diagnosis

  • claude --version completes in ~50ms — not a startup issue
  • time claude -p "hi" shows ~1.9s user/system CPU time — significant local overhead
  • Disabled MCP servers (moved settings.local.json) — no improvement
  • Toggled fast mode off — no improvement (not #29366)
  • Reproduced on both Ghostty and Terminal.app — not terminal-specific

Related issues

  • #21261 — macOS showSetupScreens() ~3.1s delay (closed/stale, only accounts for ~3s)
  • #29366 — fast mode render loop (ruled out)
  • #28080 — CLI freezes on startup during initial prompt input

Demo

https://github.com/user-attachments/assets/629a0628-d193-499f-b062-202eeca364f9

View original on GitHub ↗

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