{"slug": "don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are", "title": "Don't Open Claude Code With a Non-Latin Directory Name. Your Conversations Are Disappearing.", "summary": "A developer discovered a critical bug in Claude Code where non-Latin characters in directory names are replaced with hyphens, causing different project folders to map to the same session directory. This leads to conversation loss, session collisions, and potential data leakage across projects using Chinese, Japanese, Korean, Arabic, or other non-Latin scripts. The developer released an open-source scanner to detect the issue.", "body_md": "Confirmed across 4 languages. 6 layers of impact. One root cause.\n\nJune 24. I had a 30-minute session with Claude Code in `C:\\Users\\...\\Desktop\\claude面试`\n\n. Went back in the afternoon. Gone. `--resume`\n\nfound nothing.\n\nI didn't delete it. I didn't run cleanup. I didn't touch `.claude`\n\n.\n\nClaude Code stores all conversation history under `.claude/projects/`\n\n— one directory per project. The directory name encodes the project path.\n\n```\n简历/          → C--Users-...-Desktop---\nclaude面试/    → C--Users-...-Desktop-claude--\n测试中文目录/  → C--Users-...-Desktop-------\n```\n\n**The Chinese characters are gone. Replaced by hyphens.** Two Chinese characters become two hyphens. Six characters become six hyphens.\n\nTo verify, I created two different directories with the same character count:\n\n```\n项目甲 (3 chars) → C--Users-...-Desktop----\n测试乙 (3 chars) → C--Users-...-Desktop---- ← Same directory\n```\n\n**Two different folders — mapped to the same session directory.**\n\nRunning `claude project purge`\n\nin `项目甲`\n\ndeleted the project directory `----`\n\n— including all sessions from `测试乙`\n\n. The user of `测试乙`\n\nnever knew their conversations were deleted.\n\nRunning `claude --resume`\n\nin `测试乙`\n\nshowed `项目甲`\n\n's conversation. Someone who has never opened that project can resume its full chat history.\n\nI tested Japanese (`日本語テスト`\n\n), Korean (`한국어테스트`\n\n), and Arabic (`اختبار`\n\n). All four languages produced the same collision. Every non-Latin script is affected.\n\nWhile investigating, I found that my own `.claude/projects/`\n\nalready contained 5 hyphen-only directories with sessions from real folders — not test directories. For example, `C--Users-...-Desktop--------`\n\ncontained sessions from `C:\\Users\\...\\Desktop\\资料`\n\n. This bug has been silently colliding sessions for as long as these directories have existed.\n\nClaude Code's path encoding strips every non-Latin character and replaces it with a hyphen. Different directory names with the same non-Latin character count collide to the same `.claude/projects/`\n\nentry.\n\n```\nReal path:       C:\\Users\\...\\Desktop\\测试中文目录\nEncoded path:    C--Users-...-Desktop-------\n                            All 6 characters → 6 hyphens\n```\n\nAnyone using directory names with **Chinese, Japanese, Korean, Arabic, Russian, Hebrew, Thai** — or any non-Latin script. That's every developer who doesn't name their folders in ASCII.\n\nAt risk:\n\n`claude project purge`\n\nin one project silently deleting another project's conversations`--resume`\n\nand seeing conversations from unrelated projects`autoUploadSessions`\n\nsyncing merged conversations from multiple projects to claude.ai`cleanupPeriodDays`\n\n(default 30 days) operating on the collided directory — treating multiple projects as oneI built a free, open-source scanner that catches this before Claude Code silently loses your data. Point it at any project directory:\n\n```\ngit clone https://github.com/yurenpai/ai-config-guard.git\ncd ai-config-guard\nnode index.js .\n```\n\nIt does three things:\n\n**Checks the directory name FIRST** — if it contains non-Latin characters, you get an immediate warning with the encoded name and collision risk. This is the `NON_LATIN_DIRNAME`\n\nrule — built from the discovery above.\n\n**Scans your project files** — detects instructions that could make an AI coding assistant read your credentials, exfiltrate data, or execute hidden commands. 7 detection rules covering everything from `CREDENTIAL_READ`\n\nto cross-language ambiguity.\n\n**Runs in CI/CD** — GitHub Actions integration with SARIF export for GitHub Code Scanning.\n\nWeb dashboard included. Dark/light theme. Chinese/English bilingual. Zero dependencies beyond Node.js.\n\n**This is the only tool that currently detects the non-Latin path encoding bug.** If your directory name has Chinese, Japanese, Korean, Arabic, or any non-Latin characters — it will tell you before Claude Code loses your conversations.\n\n*June 25, 2026 · Discovered, tested, reported, and built a detection tool for it.*", "url": "https://wpnews.pro/news/don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are", "canonical_source": "https://dev.to/yurenpai_c188178e6b313e59/dont-open-claude-code-with-a-non-latin-directory-name-your-conversations-are-disappearing-4dhm", "published_at": "2026-06-24 19:51:03+00:00", "updated_at": "2026-06-24 20:13:26.738984+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models", "ai-safety"], "entities": ["Claude Code", "Anthropic", "GitHub", "yurenpai", "ai-config-guard"], "alternates": {"html": "https://wpnews.pro/news/don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are", "markdown": "https://wpnews.pro/news/don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are.md", "text": "https://wpnews.pro/news/don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are.txt", "jsonld": "https://wpnews.pro/news/don-t-open-claude-code-with-a-non-latin-directory-name-your-conversations-are.jsonld"}}