Skip to content

[BUG] CLI hangs indefinitely on network interruption, unresponsive to Escape/clear #15151

@VibeThrifter

Description

@VibeThrifter

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When network connectivity is briefly interrupted during a Claude Code session, the CLI becomes completely unresponsive. No keyboard input (Ctrl+C, Escape, /clear, etc.) restores functionality. The only recovery method is to close the terminal entirely and restart with claude.

Impact:
High - Loses all conversation context and requires full restart. Particularly frustrating during long sessions or complex tasks.

What Should Happen?

Expected Behavior:

  • The CLI should detect connection timeout/failure and surface an error message
  • Keyboard interrupts (Ctrl+C) should remain functional to cancel the hung request
  • User should be able to retry or continue the session without full restart

Actual Behavior:

  • CLI becomes completely frozen
  • No user input is processed
  • No timeout occurs (waited 5+ minutes)
  • Process must be killed externally (pkill -f claude) or terminal closed

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce:

  1. Start a Claude Code session with claude
  2. Begin a request (or have one in progress)
  3. Experience a brief network interruption (WiFi dropout, VPN reconnect, ISP hiccup)
  4. Observe that the CLI hangs indefinitely
  5. Attempt Ctrl+C, Escape, or typing /clear - none work
  6. Must close terminal and restart

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Environment:

  • OS: macOS (Darwin 24.6.0)
  • Claude Code version: [run claude --version to fill in]
  • Shell: [zsh/bash]
  • Network: [WiFi/Ethernet]

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions