惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Jina AI
Jina AI
The Cloudflare Blog
V
Visual Studio Blog
博客园_首页
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - Franky

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Don't Open Claude Code With a Non-Latin Directory Name. Y...
yurenpai · 2026-06-25 · via DEV Community

yurenpai

Don't Open Claude Code With a Non-Latin Directory Name. Your Conversations Are Disappearing.

Confirmed across 4 languages. 6 layers of impact. One root cause.


A conversation vanished

June 24. I had a 30-minute session with Claude Code in C:\Users\...\Desktop\claude面试. Went back in the afternoon. Gone. --resume found nothing.

I didn't delete it. I didn't run cleanup. I didn't touch .claude.


Digging into the encoding

Claude Code stores all conversation history under .claude/projects/ — one directory per project. The directory name encodes the project path.

简历/          → C--Users-...-Desktop---
claude面试/    → C--Users-...-Desktop-claude--
测试中文目录/  → C--Users-...-Desktop-------

The Chinese characters are gone. Replaced by hyphens. Two Chinese characters become two hyphens. Six characters become six hyphens.

To verify, I created two different directories with the same character count:

项目甲 (3 chars) → C--Users-...-Desktop----
测试乙 (3 chars) → C--Users-...-Desktop---- ← Same directory

Two different folders — mapped to the same session directory.


This means three things

1. Cleanup in one directory deletes the other

Running claude project purge in 项目甲 deleted the project directory ---- — including all sessions from 测试乙. The user of 测试乙 never knew their conversations were deleted.

2. One directory can see the other's conversations

Running claude --resume in 测试乙 showed 项目甲's conversation. Someone who has never opened that project can resume its full chat history.

3. Not just Chinese

I tested Japanese (日本語テスト), Korean (한국어테스트), and Arabic (اختبار). All four languages produced the same collision. Every non-Latin script is affected.


Pre-existing collisions on real systems

While investigating, I found that my own .claude/projects/ already contained 5 hyphen-only directories with sessions from real folders — not test directories. For example, C--Users-...-Desktop-------- contained sessions from C:\Users\...\Desktop\资料. This bug has been silently colliding sessions for as long as these directories have existed.


The root cause

Claude 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/ entry.

Real path:       C:\Users\...\Desktop\测试中文目录
Encoded path:    C--Users-...-Desktop-------
                            All 6 characters → 6 hyphens


Who is affected

Anyone 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.

At risk:

  • Running claude project purge in one project silently deleting another project's conversations
  • Using --resume and seeing conversations from unrelated projects
  • autoUploadSessions syncing merged conversations from multiple projects to claude.ai
  • cleanupPeriodDays (default 30 days) operating on the collided directory — treating multiple projects as one

Detection tool — ai-config-guard

I built a free, open-source scanner that catches this before Claude Code silently loses your data. Point it at any project directory:

git clone https://github.com/yurenpai/ai-config-guard.git
cd ai-config-guard
node index.js .

It does three things:

  1. 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 rule — built from the discovery above.

  2. 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 to cross-language ambiguity.

  3. Runs in CI/CD — GitHub Actions integration with SARIF export for GitHub Code Scanning.

Web dashboard included. Dark/light theme. Chinese/English bilingual. Zero dependencies beyond Node.js.

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.


June 25, 2026 · Discovered, tested, reported, and built a detection tool for it.