Session history split across two project-slug folders for the same cwd (ñ normalization / space+case handling)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 20, 2026

Summary

Claude Code's session-storage layer sometimes computes a different storage key/slug for the exact same project working directory across different app launches. This causes the same conversation history to be split across two different folders under ~/.claude/projects/, so on some launches the app only shows an older/shorter version of a conversation while the newest messages are silently written to the other, currently-unread folder. Nothing is technically lost — it's on disk — but it looks and feels like recent messages "disappear" after closing and reopening the app.

Impact

  • Reopening the app can show a conversation frozen days in the past, missing everything typed since.
  • The two copies keep diverging on subsequent launches (new turns get appended to whichever slug the app resolves this time), so the split gets worse over time and there's no single "latest" file.
  • Happened across multiple unrelated projects, so it isn't a one-off fluke.

Evidence — case 1: path containing an accented character (ñ)

Real folder on disk (single folder, no duplicates in Finder):
/Users/<user>/Documents/THI/rediseño-web-thi

But ~/.claude/projects/ contains two different slug folders for it:

  • -Users-<user>-Documents-THI-redise-o-web-thi
  • -Users-<user>-Documents-THI-redisen-o-web-thi

Byte-level diff of the two slugs shows the "ñ" is handled two different ways:

  • redise-o → the ñ is dropped entirely (dise + o)
  • redisen-o → the ñ is transliterated to a plain n (disen + o)

This looks like a Unicode NFC vs NFD normalization inconsistency (macOS/APFS stores filenames in NFD, where "ñ" is n + combining tilde U+0303, vs NFC where it's the single codepoint U+00F1) — the slugifier apparently treats the two forms differently depending on which one it receives.

The same session UUID literally exists as two separate files with diverging content:

| session file | lines | size | last modified |
|---|---|---|---|
| .../redise-o-web-thi/69c2eac3-....jsonl | 3075 | 56.2 MB | today, most recent |
| .../redisen-o-web-thi/69c2eac3-....jsonl | 1000 | 22.9 MB | 1 day earlier, stale |

Same pattern repeats for at least 2 more session UUIDs in that project, and for a second unrelated project (rediseño-web-mariposas → also split into redise-o-web-mariposas / redisen-o-web-mariposas).

Evidence — case 2: plain ASCII path with a space (no special characters at all)

Real folder: /Users/<user>/Documents/THI/Motor SEO

Grepping the raw "cwd" field recorded inside the session .jsonl files (ground truth of what path was actually opened) shows the identical cwd string "/Users/<user>/Documents/THI/Motor SEO" appearing in session files stored under two different project slug folders:

  • -Users-<user>-Documents-THI-Motor-SEO
  • -Users-<user>-Documents-THI-motor-seo-v2 (note the auto-appended -v2, as if the app detected a slug collision and created a second parallel storage location instead of resolving to the existing one)

This confirms the bug isn't limited to accented characters — it reproduces with a plain-ASCII path that only contains a space and mixed case, suggesting a more general instability in how the project/session storage key is derived from the working-directory path (case handling and/or space handling), not just Unicode normalization.

How to reproduce (best guess)

  1. Create a project folder with either an accented character (e.g. ñ) or a space + mixed case in the name.
  2. Open Claude Code in that folder, have a conversation.
  3. Close the app fully and reopen it (or open the same folder from a different launcher/context) enough times.
  4. Inspect ~/.claude/projects/ — look for more than one slug folder whose sessions share the same "cwd" value, or the same session UUID present in two different slug folders with diverging line counts.

Expected behavior

The same real working-directory path should always resolve to the same single storage slug, regardless of Unicode normalization form or how the path was typed/passed in, so a project's session history is never split or silently forked.

Environment

  • macOS (Darwin), filesystem APFS (case-insensitive, case-preserving by default; NFD-normalized filenames)
  • Multiple project folders affected, spanning several weeks of normal usage

View original on GitHub ↗