Skip to content

[Compat] Claude Code v2.1.234: CLAUDE_CODE_PROJECT_DIR_NAME lets hosts rename the per-project transcript directory #259

Description

@delexw

Claude Code Version

v2.1.234 (August 17, 2026)

Change Description

Added the optional CLAUDE_CODE_PROJECT_DIR_NAME environment variable: hosts that give each session its own config directory can choose a short name for the per-project transcript directory

This introduces a way for a host/wrapper to override the name Claude Code gives to the per-project transcript directory under ~/.claude/projects/, instead of the usual sanitized-path/hash-derived name.

Impact on claude-code-trace

claude-code-trace's default JSONL location is ~/.claude/projects/<project-hash>/sessions/ (configurable). Any logic that derives, guesses, or validates a project's directory name from its filesystem path (e.g. project auto-discovery, matching a configured working directory to the right session folder) may not find sessions for a project whose directory was named via CLAUDE_CODE_PROJECT_DIR_NAME instead of the standard scheme — the directory name is no longer guaranteed to be a function of the project path at all.

If claude-code-trace only enumerates existing directories under ~/.claude/projects/ without recomputing names itself, this is not directly broken, but any UI that groups/labels sessions by inferred project path (rather than reading cwd from the JSONL entries themselves) could mislabel or fail to associate a CLAUDE_CODE_PROJECT_DIR_NAME-renamed directory with its real project.

Severity: Critical

Affected Parser Code

  • Project/session directory discovery code (wherever the app maps a filesystem path to its ~/.claude/projects/<dir>/ folder)
  • src-tauri/src/parser/entry.rs - Entry struct (for confirming cwd is still the authoritative source of the real project path, independent of directory name)

Suggested Fix

  • Do not infer the real project path from the transcript directory name; always read cwd from JSONL entries as the source of truth for which project a session belongs to.
  • If any directory-name-based matching/validation exists, add a fallback that trusts an arbitrary directory name and resolves the project identity from entry content instead.

Source

Claude Code v2.1.234 release notes, August 17, 2026.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions