From d61cfc90c21732182c79ef80877915c8d2ff9e91 Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 31 Dec 2025 12:18:34 +0800 Subject: [PATCH] refactor: replace specific character regex with comprehensive non-alphanumeric pattern Update the regex in getProjectPath to replace all non-alphanumeric characters with dashes instead of only specific ones. This provides more robust handling of edge cases in working directory paths. --- cli/src/claude/utils/path.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/claude/utils/path.ts b/cli/src/claude/utils/path.ts index 5580e3b1..5a953f4e 100644 --- a/cli/src/claude/utils/path.ts +++ b/cli/src/claude/utils/path.ts @@ -2,7 +2,7 @@ import { homedir } from "node:os"; import { join, resolve } from "node:path"; export function getProjectPath(workingDirectory: string) { - const projectId = resolve(workingDirectory).replace(/[\\\/\.:_]/g, '-'); + const projectId = resolve(workingDirectory).replace(/[^a-zA-Z0-9]/g, '-'); const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude'); return join(claudeConfigDir, 'projects', projectId); } \ No newline at end of file