Description
ccundo list and ccundo sessions fail on Windows due to three path-related bugs in ClaudeSessionParser.js.
Environment
- OS: Windows 11 (25H2)
- Node.js: v25.6.0
- ccundo: v1.1.1
- Claude Code: latest
Bug 1: process.env.HOME is undefined on Windows
Line 10 uses process.env.HOME which doesn't exist on Windows. The HOME environment variable is a Unix convention; Windows uses USERPROFILE.
// Before (broken on Windows)
this.claudeProjectsDir = path.join(process.env.HOME, '.claude', 'projects');
// Fix: use os.homedir() which works cross-platform
import os from 'os';
this.claudeProjectsDir = path.join(os.homedir(), '.claude', 'projects');
Bug 2: getCurrentProjectDir() regex doesn't encode Windows paths correctly
Line 16 regex /[\s\/_]/g doesn't match : or \ (backslash), so Windows paths like C:\Users\marce are not encoded correctly.
Claude Code encodes project directories by replacing special characters with dashes:
C:\Users\marce\projetos\PROFITDLL → C--Users-marce-projetos-PROFITDLL
The current regex misses : and \, producing wrong directory names that don't match.
// Before (misses : and \ on Windows)
const safePath = cwd.replace(/[\s\/_]/g, '-');
// Fix: include backslash and colon
const safePath = cwd.replace(/[:\\s\/_.]/g, '-');
Bug 3: getAllSessions() reconstructs paths assuming Unix format
Line 197 decodes the project directory name back to a path by assuming Unix conventions, producing ///Users/marce instead of C:\Users\marce.
// Before (Unix-only)
const projectPath = projectDir.substring(1).replace(/-/g, '/');
sessions.push({ id: sessionId, project: '/' + projectPath, ... });
// Fix: handle Windows path format
let projectPath;
if (process.platform === 'win32') {
// C--Users-marce-projetos => C:\Users\marce\projetos
projectPath = projectDir.replace(/^([A-Z])-/, '$1:\').replace(/-/g, '\');
} else {
projectPath = '/' + projectDir.substring(1).replace(/-/g, '/');
}
sessions.push({ id: sessionId, project: projectPath, ... });
Steps to Reproduce
- Install ccundo on Windows:
npm install -g ccundo
- Navigate to any directory where Claude Code has been used
- Run
ccundo list → "No active Claude Code session found in this directory"
- Run
ccundo sessions → Shows paths as ///Users/marce instead of C:\Users\marce
After Fix
All three changes applied to src/core/ClaudeSessionParser.js resolve the issues:
ccundo list correctly finds and lists operations
ccundo sessions shows proper Windows paths
Happy to submit a PR if helpful.
Description
ccundo listandccundo sessionsfail on Windows due to three path-related bugs inClaudeSessionParser.js.Environment
Bug 1:
process.env.HOMEis undefined on WindowsLine 10 uses
process.env.HOMEwhich doesn't exist on Windows. TheHOMEenvironment variable is a Unix convention; Windows usesUSERPROFILE.Bug 2:
getCurrentProjectDir()regex doesn't encode Windows paths correctlyLine 16 regex
/[\s\/_]/gdoesn't match:or\(backslash), so Windows paths likeC:\Users\marceare not encoded correctly.Claude Code encodes project directories by replacing special characters with dashes:
C:\Users\marce\projetos\PROFITDLL→C--Users-marce-projetos-PROFITDLLThe current regex misses
:and\, producing wrong directory names that don't match.Bug 3:
getAllSessions()reconstructs paths assuming Unix formatLine 197 decodes the project directory name back to a path by assuming Unix conventions, producing
///Users/marceinstead ofC:\Users\marce.Steps to Reproduce
npm install -g ccundoccundo list→ "No active Claude Code session found in this directory"ccundo sessions→ Shows paths as///Users/marceinstead ofC:\Users\marceAfter Fix
All three changes applied to
src/core/ClaudeSessionParser.jsresolve the issues:ccundo listcorrectly finds and lists operationsccundo sessionsshows proper Windows pathsHappy to submit a PR if helpful.