anthropics / anthropics/claude-code
[BUG] Desktop-hosted sessions auto-archive on end since 2026-07-19, making them invisible in the mobile Code list
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### What happened
Since a desktop app update installed **2026-07-19**, every **desktop-hosted** Claude Code session is **archived automatically when it ends**. Because the iOS/mobile Code list only shows `status: active`, this makes all Mac-desktop-originated chats disappear from iPhone/web shortly after they finish.
Before 07-19 these same sessions stayed `active` indefinitely and remained listed on every device (rendering as `Disconnected · `). Sessions hosted by a `claude remote-control` daemon are **not** affected.
### Evidence
Desktop-hosted sessions (`config.origin: claude_code_cli`, empty `environment_id`), counted from `GET /v1/code/sessions`:
| Window | active | archived |
|---|---|---|
| Jul 2–4 | 28 | 1 |
| Jul 11 | 18 | 9 |
| Jul 17–18 | 12 | 1 |
| **Jul 20 onward** | **2** | **58** |
The app update installed at 2026-07-19 15:02 local (per the Squirrel/ShipIt log) is the only correlating event. The same update also flipped these sessions' `config.origin` from `null` to `claude_code_cli`.
The last event on every affected session is identical:
```
event_type: control_request
payload.request: { "subtype": "end_session", "reason": "archived" }
source: client
```
Sampled 6 independently archived sessions — all six show exactly this. It fires per-session as each chat ends, and also in bulk (all open sessions at the same second) when the app quits for an update or a reboot.
### Impact
Mac-as-host workflows break: with the Mac as the single host and phone/web as thin clients, a day's work becomes invisible from mobile as soon as each chat ends. Nothing is lost — transcripts are intact server-side — but they are unreachable from the mobile list, and there is no unarchive affordance in the desktop UI (#62428, #46631, #30869, #67835, #38234).
### Expected
Desktop-hosted sessions should remain `active` when they end, as they did before 2026-07-19 — or archiving should be opt-in (#60043 requests the same).
### Workaround
There *is* a working server-side unarchive endpoint, though it appears undocumented and the open issues above assume none exists:
```
POST /v1/code/sessions//unarchive -> 200
```
(`PATCH`/`POST` with `{"status":"active"}` both return 405.) Restoring 58 sessions this way brought them all back on iPhone immediately, and none re-archived — so #57586's "re-archives after ~1s" does not appear to affect the API path.
Editing `isArchived` in the local `claude-code-sessions/.../local_.json` (the workaround suggested elsewhere) only fixes the desktop's local view, not the server `status` the mobile app reads.
### Environment
- Claude Code CLI 2.1.220
- Claude desktop app 1.24012.9 (regression arrived with the build installed 2026-07-19)
- macOS 26 (Darwin 25.5.0), Apple Silicon
- Plan: Max
### Possibly related
#57586 (unarchive snaps back ~1s), #59449 (active session archived every ~5 min), #60043 (auto-archive, no opt-out), #65955 (session on desktop absent on iPhone), #67835 (archive is one-way)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the client-generated control_request with request subtype end_session for desktop-hosted sessions, comparing it with sessions hosted by a claude remote-control daemon. Use GET /v1/code/sessions to verify status transitions and the unarchive endpoint to confirm the expected behavior; done means desktop-hosted sessions remain active and visible in the mobile Code list after ending.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- api, backend, cli, desktop, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100