[BUG] One folder, two sidebar projects; moved folders orphan sessions

Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 16, 2026

Preflight Checklist

  • [x] I have searched existing issues 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?

claude-code-report-2026-10-16.md

What Should Happen?

Sidebar project grouping: one folder split across two entries, and renamed or moved folders orphan their sessions

Error Messages/Logs

### Environment

- Claude Code desktop (Code tab), Windows 11 Pro 26200
- Versions involved: 2.1.296 → 2.1.299 (2.1.299 first ran 2026-10-16)

### Summary

Claude Code keys a sidebar project by the `cwd` recorded in each session
transcript (`~/.claude/projects/<encoded-cwd>/*.jsonl`). Two consequences of
that caused real confusion today, and I think both are worth addressing.

### Issue 1 — One folder shown as two sidebar projects

After updating to 2.1.299 the sidebar began labelling projects by git
repository name rather than folder name. For one folder this produced **two
separate rows with the same name**, disambiguated by different suffixes:

Steps to Reproduce

All three sessions have the identical cwd
(C:\Users\<user>\WORK\ssi-dashboard-project). They split because the folder's
git remote changed between sessions: the older session ran while origin
pointed at github.com/<owner>/ssi-dashboard-project, the newer ones ran after
that remote was gone.

So the grouping key appears to mix two identities — filesystem path and git
remote — and can disagree with itself for a single directory.

Expected: one folder, one project row.

Issue 2 — No way to re-point sessions when a folder is renamed or moved

The cwd value is written into every line of every session transcript. When a
project folder is renamed, or the machine changes, the entire history silently
detaches into a project whose folder no longer exists.

In my case there were 7 such projects holding 52 sessions:

| Cause | Projects | Sessions |
|---|---|---|
| New laptop (session records copied; the old machine mounted Google Drive at a different path) | 2 | 4 |
| Folder renamed (YouTube_analysis → YouTube) | 1 | 37 |
| Test folders deleted | 3 | 10 |

Nothing in the UI indicates these are dead, and there is no supported way to
re-point them. I recovered them by hand: rewriting the "cwd" values inside the
.jsonl files and moving the folders under ~/.claude/projects/. That worked,
but it is not something most users will attempt.

They had existed for weeks unnoticed, because the sidebar sorts by recent
activity and they stayed buried. Opening a few old sessions pushed them to the
top at once, which is what made this look like a sudden failure.

Suggestions

  1. Key a sidebar project on one identity only — the resolved filesystem path is

the stable one. If repo names are shown, show them as a label on the path,
not as the grouping key.

  1. Detect a session whose cwd no longer resolves and mark it in the UI, with a

"move to…" action that rewrites the stored path.

  1. Offer a migration step when ~/.claude is copied to a new machine: scan for

cwd values that do not resolve and offer to re-point them.

  1. Release notes for a change that alters how projects are named would have

saved a couple of hours of thinking something had broken.

Not a product defect

For completeness: a separate problem found during this investigation — one
repository had lost its origin remote and was five commits behind GitHub —
turned out to be caused by my own laptop migration copying a stale snapshot,
not by Claude Code.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.299

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

none

View original on GitHub ↗