SessionHarvester.ts hardcodes a macOS-style project directory slug on line 30:
const PROJECTS_DIR = path.join(CLAUDE_DIR, "projects", `-Users-${USERNAME}--claude`);
Claude Code stores session transcripts under ~/.claude/projects/{cwd-slug}/, where the slug is derived
from the current working directory by replacing / and . with -. On macOS this produces
-Users-username--claude, but on Linux the home directory is /home/username, producing
-home-username--claude. The hardcoded macOS path causes the script to silently find no sessions and exit
with "No sessions found to harvest" on any non-macOS system.
Steps to Reproduce
- Run on a Linux system where $HOME is /home/
- Execute bun run SessionHarvester.ts --recent 10
- Output: No sessions found to harvest
Expected Behavior
SessionHarvester should detect the correct projects directory regardless of OS.
Fix
Replace the hardcoded slug with dynamic derivation from CLAUDE_DIR:
const CWD_SLUG = CLAUDE_DIR.replace(/[\/\.]/g, "-");
const PROJECTS_DIR = path.join(CLAUDE_DIR, "projects", CWD_SLUG);
This produces the correct slug on both macOS (-Users-username--claude) and Linux
(-home-username--claude).
Impact
- Severity: High — the tool is completely non-functional on Linux
- Scope: All Linux and WSL users
- Failure mode: Silent — no error message, just "No sessions found"
SessionHarvester.tshardcodes a macOS-style project directory slug on line 30:Claude Code stores session transcripts under ~/.claude/projects/{cwd-slug}/, where the slug is derived
from the current working directory by replacing / and . with -. On macOS this produces
-Users-username--claude, but on Linux the home directory is /home/username, producing
-home-username--claude. The hardcoded macOS path causes the script to silently find no sessions and exit
with "No sessions found to harvest" on any non-macOS system.
Steps to Reproduce
Expected Behavior
SessionHarvester should detect the correct projects directory regardless of OS.
Fix
Replace the hardcoded slug with dynamic derivation from CLAUDE_DIR:
This produces the correct slug on both macOS (-Users-username--claude) and Linux
(-home-username--claude).
Impact