anthropics / anthropics/claude-code

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

オープン
#93,743 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:core bug platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### 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)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
bash, powershell
領域
backend, security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。