anthropics / anthropics/claude-code

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

未关闭
#92,572 0 条评论 0 个 reaction 已指派 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
预计耗时
一周以上
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。