Skip to main content

project_dir_name

Function project_dir_name 

Source
pub fn project_dir_name(cwd: &str) -> String
Expand description

The folder under <CLAUDE_CONFIG_DIR>/projects/ that holds the sessions the CLI ran with cwd as its working directory.

The CLI’s rule (its RC(), read from the binary AgentMux 0.57.0 bundles, Claude Code v2.1.280):

function TQ(e){let r=0;for(let n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return r}
function RC(e){let n=e.replace(/[^a-zA-Z0-9]/g,"-");
  if(n.length<=200)return n;return`${n.slice(0,200)}-${Math.abs(TQ(e)).toString(36)}`}

JavaScript strings are UTF-16, so the rule works on UTF-16 code units: a character outside the Basic Multilingual Plane (an emoji) becomes two dashes, not one.

cwd must be the path as the CLI sees it — already expanded, not a ~-shorthand.