anthropics / anthropics/claude-code

[BUG] Connection drops and recent messages lost after re-logging in

オープン
#92,572 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:core bug data-loss platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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 reconnecting to a Claude Code session (remote/mobile access) after a disconnect ("Cannot connect to computer"), several of the most recent messages/turns from right before the disconnect are lost. Severity varies — sometimes only ~5 recent messages, other times close to a full day's worth of conversation/work.

This is NOT caused by:
- Host PC sleep/standby (confirmed sleep timeout is set to "Never" on the host machine)
- Concurrent/duplicate logins (reproduces even with sequential single-session logins only)
- A specific machine (reproduces across different physical computers)

Since there's no indicator of what was or wasn't saved before the drop, in-progress project work becomes impossible to reliably continue after any disconnect.

### What Should Happen?

On reconnect, the session should restore up to the actual last durably-saved turn, and any message that failed to persist before a disconnect should be clearly flagged to the user (e.g. "not saved") instead of silently disappearing — so in-progress work is never lost without warning

### Error Messages/Logs

```shell
No stack trace/console error available. The only message shown to the user is the in-app disconnect notice:

"컴퓨터에 연결할 수 없습니다
절전 모드이거나 오프라인 상태일 수 있습니다. 다시 연결되면 이 세션이 재연결됩니다."

(Translation: "Cannot connect to computer. It may be in sleep mode or offline. This session will reconnect once reconnected.")

No error is shown when the reconnect happens and recent messages turn out to be missing — the loss is silent.
```

### Steps to Reproduce

1. Start a Claude Code session via remote/mobile access to a host machine.
2. Continue working normally until a disconnect occurs ("컴퓨터에 연결할 수 없습니다" / "Cannot connect to computer, may be asleep or offline").
3. Reconnect once the host is available again.
4. Observe that the most recent messages before the disconnect are missing, and work cannot be resumed from where it left off.

### Claude Model

Sonnet (default)

### Is this a regression?

No, this never worked

### Last Working Version

Not working

### Claude Code Version

2.1.252

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

PowerShell

### Additional Information

OS: Windows 11
Note: reproduced on multiple different machines, not tied to one device's power settings.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No repository files, tests, or code entry points are identified in the report. Start by reproducing the remote/mobile disconnect and reconnect sequence on Windows 11 with PowerShell, then trace how session turns are persisted and restored. Done means reconnecting restores the last durably saved turn and clearly flags any unsaved message instead of silently dropping it.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell, python
領域
backend, distributed-systems
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。