anthropics / anthropics/claude-code
Auto-update at boot invalidates session, forces relogin
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### 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?
- Version: 2.1.235 → auto-updated to 2.1.237 at boot
- Symptom: session says "expired", forces /login, right after native auto-update runs at cold-start on Windows 11
- .credentials.json refreshToken still valid (not actually expired) — update process itself invalidates session, not token expiry
- .last-update-result.json timestamp matches failure time
- OS: Windows 11, native install, domain-joined machine
### What Should Happen?
Session should survive native auto-update. Refresh token isn't actually expired — relogin shouldn't be needed after an update completes.
### Error Messages/Logs
```shell
.last-update-result.json:
{"timestamp":"2026-08-20T03:58:42.322Z","path":"native","outcome":"success","status":"success","version_from":"2.1.235","version_to":"2.1.237","error_code":null}
CLI message on launch: "Please run /login" (session expired)
```
### Steps to Reproduce
1. Have Claude Code running, close laptop / shutdown
2. Reboot, open terminal, run claude
3. CLI auto-updates itself in background (check .claude/.last-update-result.json for timestamp)
4. Session immediately shows "expired", prompts /login
5. Manually /login — works fine, valid until next reboot+update cycle
### Claude Model
Not sure / Multiple models
### Is this a regression?
No, this never worked
### Last Working Version
_No response_
### Claude Code Version
2.1.237
### Platform
Anthropic API
### Operating System
Windows
### Terminal/Shell
PowerShell
### Additional Information
Machine is domain-joined (Windows 11). Config backup at ~/.claude/backups/.claude.json.backup shrank in size right after the failing update (79KB → 76KB), suggesting the update process partially resets local config/session state, not just the token.
Fast Startup (hiberboot) enabled — ruled out as cause (cold boot vs hybrid boot both trigger the issue).
Verified refreshToken in .credentials.json is NOT expired at time of failure — expiresAt several days out.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start by comparing .last-update-result.json, .credentials.json, and the ~/.claude/backups/.claude.json.backup state before and after the native update. Trace the boot-time update and session-loading path in the repository, then reproduce on Windows 11 with the listed version transition. Done means a valid refresh token remains usable after a native auto-update and reboot without requiring /login.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- powershell, python
- Lĩnh vực
- authentication, cli, operating-systems
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100