[BUG] Window goes blank after laptop sleep/wake; session state is already persisted and could be restored without restart #ux

Resolved 💬 3 comments Opened Apr 17, 2026 by ArmorBearer Closed May 25, 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 a laptop wakes from sleep, the Claude Code window goes blank and is unusable. The only workaround is to close and reopen the app. This is unnecessary — Claude Code already persists full session state to disk, and a restart proves it can restore that state correctly. The blank window is therefore a bug in the wake/reconnect path, not a missing persistence feature.

What Should Happen?

Suspected Root Cause
When the WebSocket connection is lost on sleep, something in the UI layer clears or resets the rendered state rather than preserving it. The fix does not require any new persistence infrastructure — it only requires that the UI not clear itself when the connection drops.

Proposed Fix
On WebSocket close / connection-loss event, do not reset the UI state — keep the existing conversation rendered
Display a non-blocking "Reconnecting…" indicator
On successful reconnect, resume the session using the already-persisted on-disk state
If reconnection fails permanently, then (and only then) offer a "Session ended — start new?" prompt
This is a minimal change. The hard part (persistence and restore) is already implemented and working.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code and have an active session with conversation history
  2. Close the laptop lid (sleep/standby)
  3. Open the laptop lid (wake - perhaps the next day)
  4. Observe Claude Code window

Expected: The conversation remains visible; a "Reconnecting…" indicator appears while the WebSocket re-establishes

Actual: The window is blank and non-functional

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.3109.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

This problem occurs when using the Claude desktop app. I have Claude Code in use within the app.

Evidence That This Is Not a Persistence Problem
When the user closes Claude Code entirely and reopens it, the full conversation history is restored from disk. This demonstrates that:

Session state is already being persisted to disk (in ~/.claude/projects/… JSONL files)
The rendering path that reads that state and displays it already works correctly
The wake-from-sleep path simply does not invoke that same restore logic when the connection drops.

View original on GitHub ↗

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