whydid 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,18 @@
1
1
  import { existsSync, readdirSync, statSync, openSync, closeSync, readSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { join, basename as nodeBasename } from "node:path";
4
+ /**
5
+ * Claude Code replaces EACH non-alphanumeric character with its own hyphen
6
+ * — it does not collapse adjacent ones into a single hyphen. A POSIX path
7
+ * never has two special characters back to back (every segment is
8
+ * separated by exactly one '/'), so this was indistinguishable from
9
+ * collapsing-runs against real macOS data — only a Windows drive letter
10
+ * ("C:\" — colon then backslash, two adjacent specials) exposes the
11
+ * difference: Claude Code's real output doubles the hyphen there
12
+ * ("C--Users..."), confirmed against documented real Windows examples.
13
+ */
4
14
  export function claudeCodeProjectSlug(projectRoot) {
5
- return projectRoot.replace(/[^a-zA-Z0-9]+/g, "-");
15
+ return projectRoot.replace(/[^a-zA-Z0-9]/g, "-");
6
16
  }
7
17
  /**
8
18
  * Claude Code keys its ~/.claude/projects/<slug> folder on the full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whydid",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "A local-first AI coding time machine — captures meaningful changes, reasoning, and session context so you can see what happened across your coding sessions, even days later.",