[BUG] Desktop: empty custom sidebar groups vanish from the sidebar after restart but stay stored, so recreating them piles up duplicates
What happens
In the Claude desktop app's Code tab, a custom sidebar group that has no sessions in it is no longer shown after the app is restarted. The group is not deleted, though: it is still in the stored sidebar data, just not visible. Recreating it by name then leaves a second group with the same name, and the hidden one stays behind.
Steps to reproduce
- In the Code tab sidebar, create a custom group (e.g. "Outgoing My Turn") and leave it empty, or move its last session out.
- Quit and reopen the app.
- The empty group is gone from the sidebar.
- Create a group with the same name again. Repeat a few times.
Expected
An empty custom group stays visible across restarts (it is a label the user made on purpose, often a workflow stage that is empty for a while). If hiding empty groups is intended, it should be a visible setting, and creating a group with an existing hidden group's name should reuse it.
Actual
After several rounds, the sidebar's stored group list (as returned by the app's own sidebar tools, list_groups / list_sections) holds five separate groups all named "Outgoing My Turn", each with its own id and session_count: 0, plus two other empty groups. Other names are duplicated too (two "Approved", two "Cleanup"), presumably from the same loop at a time when they were empty. 23 custom groups are stored in total.
The two listings also disagree on order for the same groups (list_groups order vs list_sections order), in case that points at two stores that have drifted.
Whether the empty groups are hidden by the renderer or dropped from the view on load I can't tell from outside; the stored data is what shows they are not deleted.
Environment
- Claude desktop app 2.19675.1 (Code tab), macOS 26.6
- Local sessions
Possibly related: #79810 (custom groups disappear after switching accounts), #95979 (no way to hide empty groups).