anthropics / anthropics/claude-code
Project memory/session storage collides across different projects due to non-ASCII path slug encoding
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
### 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)
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- bash, powershell
- Domaine
- backend, security
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100