You can name the per-project history folder yourself, as long as you also set a custom config directory.
What's wrong with this entry?
Claude Code keeps each project's history and sessions in a folder under projects in its config directory, named after the project path. You can now name that folder yourself with CLAUDE_CODE_PROJECT_DIR_NAME, which only applies when CLAUDE_CONFIG_DIR is also set.
- The name must match
[A-Za-z0-9_-]{1,64}. - Windows reserved device names are rejected: con, prn, aux, nul, com0-9, lpt0-9.
- When the override differs from the usual path-derived name, history and session lookup searches both folders, so existing sessions are still found.
export CLAUDE_CONFIG_DIR=~/.claude-work
export CLAUDE_CODE_PROJECT_DIR_NAME=my-projectCLAUDE_CODE_PROJECT_DIR_NAME
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.219
Workflow size guideline gets a default and a policy override
Both mention config configuration
-
v2.1.246
Startup drops a storage backend built for a different CLAUDE_CONFIG_DIR
Both mention config configuration
-
v2.1.248
/config now separates a refused setting from a failed save, and hides save detail remotely
Both mention config configuration