anthropics / anthropics/claude-code

Project memory/session storage collides across different projects due to non-ASCII path slug encoding

Offen
#93,743 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:core bug platform:windows
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

### Summary
Claude Code derives a project storage directory (under `~/.claude/projects/`) by
converting the working-directory path into a slug. Non-ASCII characters (e.g. Korean)
appear to be collapsed into a generic `-` regardless of their actual content, so two
completely different folder names can produce the *identical* slug. When that happens,
the new project silently inherits (and can overwrite) the memory/session data of an
unrelated — even long-deleted — project.

### Steps to reproduce
1. Create folder A: `C:\Users\\Downloads\근평 웹만들기`, start a Claude Code
session there, let it save project memory (`~/.claude/projects//memory/*.md`).
2. Delete folder A entirely from disk.
3. Create an unrelated new folder B: `C:\Users\\Downloads\비계량지표평가`,
start a Claude Code session there.
4. Observe: Claude Code loads memory files that were written for folder A's project
(a Supabase-based HR evaluation web app) inside folder B's session (an unrelated
HWP/PDF parsing tool), because both paths encoded to the same slug
`C--Users--Downloads--------` (dash count happened to match).

### Expected behavior
- The slug/identifier for a project's storage directory should be unique per real path
(e.g. via a hash of the full path, or percent-encoding non-ASCII bytes instead of
collapsing them to a fixed placeholder).
- Ideally, storage for a path that no longer exists on disk should not be silently
reused by an unrelated new path.

### Actual behavior
- Multiple distinct Korean-named folders under the same parent produced slugs that
differ only in dash *count*, and in this case two different names collided on the
same count, merging their project memories.
- The stale project's storage was never cleaned up after its source folder was deleted,
and was silently "revived" by the new project.

### Impact
- Cross-project data leakage: one project's persistent memory/context appears in an
unrelated project's session, which is confusing and could expose unrelated
business/technical details across projects.

### Environment
- OS: Windows 11 Pro (10.0.26200)
- Shell: Git Bash / PowerShell
- Claude Code (desktop app, Code tab)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by locating the code that converts working-directory paths into storage directories under ~/.claude/projects/, then reproduce the two Windows examples. Done means distinct real paths receive distinct identifiers and storage from a deleted path is not silently reused by an unrelated project; verify the behavior with the reported Korean folder names.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bash, powershell
Bereich
backend, security
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.