[BUG] Input latency severely affected by API response times - typing becomes unusable during API slowdowns

Resolved 💬 11 comments Opened Dec 18, 2025 by burakyalti Closed Mar 26, 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?

When Anthropic API experiences slowdowns (even minor ones not reported on status page), keyboard input in Claude Code CLI becomes extremely slow. Each keystroke takes approximately 1 second to
appear on screen.

This issue is particularly severe when:

  • Working on large codebases with extensive context
  • Using Opus model
  • During peak API usage hours (US business hours)
  • Sessions with long conversation history

The problem appears to be that Claude Code's Node.js event loop gets blocked when API responses are slow. Since keyboard input (stdin) runs on the same event loop, it gets affected even though
input handling should be completely local and independent of API communication.

Confirmed this is NOT a system/network issue:

  • System Load: 0.4
  • Memory: 24GB available out of 31GB
  • Network latency: 0.6ms
  • Tested on multiple servers - same issue
  • Tested from different client machines - same issue
  • After exiting Claude Code, typing in same terminal is instant

What Should Happen?

Keyboard input should be processed locally and remain responsive regardless of API latency. The input buffer should be independent of the API communication layer.

User should be able to type messages at normal speed even when API is slow. The slowness should only affect the response generation, not the input experience.

Suggested fixes:

  1. Separate input handling into its own thread/worker
  2. Use non-blocking I/O for API communication
  3. Buffer user input locally, independent of API state

Error Messages/Logs

No error messages - the application continues to function, just with severe input lag.

  Diagnostic output:

  # Inside Claude Code session - typing "hello" takes ~5 seconds
  # Each character appears with ~1 second delay

  # Isolation test (same terminal, after exiting Claude Code):
  $ echo "test"
  # Types instantly - no delay

  # System resources during issue:
  $ uptime
   14:34:00 up 30 days, load average: 0.40, 0.35, 0.32

  $ free -h
                total        used        free      shared  buff/cache   available
  Mem:           31Gi       6.8Gi       4.4Gi        71Mi        20Gi        24Gi

  $ ps aux | grep node
  # Claude Code process running normally, no excessive CPU/memory

Steps to Reproduce

Steps to Reproduce

  1. Open Claude Code CLI: claude
  2. Work on a large project with many files (to build up context)
  3. Have a conversation with multiple back-and-forth messages
  4. Wait for API to experience any slowdown (often during US business hours)
  5. Try typing a new message
  6. Observe: each keystroke takes ~1 second to appear on screen
  7. Exit Claude Code with /quit
  8. Type in same terminal - observe instant response (proving it's not terminal/SSH issue)

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.72

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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