-
Notifications
You must be signed in to change notification settings - Fork 66
Extension non-functional on Windows — path encoding bug + likely additional issues #4
Description
Environment
- OS: Windows 11
- Claude Code: terminal CLI (Git Bash)
- Extension version: 0.4.7
What happens
Agent Flow panel opens, shows "Live", but always displays zero sessions regardless of active Claude Code sessions. Hooks fire and reach the extension (HTTP POST returns 200), but nothing renders.
Confirmed bug: path encoding broken on Windows
In session-watcher.ts:
this.workspacePath = workspaceFolder.replace(/\//g, '-')On Windows, uri.fsPath returns a backslash path (e.g. c:\Users\kaleb\Documents\MyProject). The regex only matches forward slashes, so nothing is replaced. The result passed to path.join(CLAUDE_DIR, workspacePath) produces:
C:\Users\kaleb\.claude\projects\c:\Users\kaleb\Documents\MyProject
A colon in the middle of a Windows path is invalid. fs.existsSync() returns false, the directory watcher is never created, and no sessions are ever detected.
Fix:
// Replace backslashes, forward slashes, and colons — matching Claude Code's own encoding
this.workspacePath = workspaceFolder.replace(/[:\/]/g, '-')This correctly transforms c:\Users\kaleb\Documents\MyProject → c--Users-kaleb-Documents-MyProject, matching the directory Claude Code creates under ~/.claude/projects/.
Likely additional issues
After patching the above locally, the panel still showed zero sessions. The path encoding fix is confirmed correct (it now resolves to the right directory), but something downstream is still failing. Possible candidates:
- The JSONL file watcher or parser may have additional Windows path assumptions
fs.watch()behavior differences on Windows- Other
replace(/\//g, '-')occurrences elsewhere in the codebase
The extension appears to have been developed and tested on macOS/Linux only. A full Windows pass would likely surface more issues.