Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
On Windows, Import Claude Code Conversations silently imports nothing. The setting is on, the feature gate is on, and Claude Code transcripts exist on disk — but no imported agents ever appear in the Agents window.
Root cause: the directory-name encoder used to locate ~/.claude/projects/<encoded-cwd> only replaces forward slashes with dashes. It does not strip the Windows drive-letter colon (or handle backslashes), so the computed directory name is not a legal Windows filename and can never exist.
Steps to Reproduce
- On Windows, use Claude Code in a local workspace, e.g.
C:\Code\MyProject, so that transcripts are written to%USERPROFILE%\.claude\projects\C--Code-MyProject\*.jsonl. - Open that workspace in Cursor’s Agents window.
- Enable Cursor Settings → Agents → Third-Party Imports → Import Claude Code Conversations.
- Restart Cursor and look at the agent list.
Expected Behavior
Claude Code sessions appear in the Agents list with the Imported from Claude Code source badge.
Actual: No imported sessions appear, in any grouping or filter mode. No error is surfaced.
Operating System
Windows 10/11
Version Information
Cursor: 3.21.16
Commit: 8ae78e8eee1e63479c7e0504b664bc0a80c68000
VS Code base: 1.128.0
OS: Windows 11 Pro, build 26200
For AI issues: which model did you use?
N/A — not an AI-request issue; this is Agents-window import of Claude Code transcripts.
For AI issues: add Request ID with privacy disabled
N/A — no AI request involved.
Additional Information
Root cause
From workbench.glass.main.js (minified; module marker claude-code/paths.ts):
// Kwu = ".claude", Ywu = "projects"
function ANk(t){ return t.replaceAll("/","-") || "-" }
function Ffs(t){ return `${t.homeDir.replace(/\/$/,"")}/${Kwu}/${Ywu}/${ANk(t.cwd)}` }
Ffs is called from both the transcript mtime poller and the session counter:
const e = this.pathService.userHome({preferLocal:true}).fsPath;
for (const r of t) {
const s = Ffs({ homeDir: e, cwd: r.cwd });
if (!await this.pathExists(s)) continue; // always taken on Windows
}
cwd originates from uri.fsPath of the workspace identifier, which on Windows is c:\Code\MyProject.
The mismatch:
| Directory name | |
|---|---|
| What Claude Code actually writes | C--Code-MyProject |
What ANk() computes |
c:\Code\MyProject (no / present, so unchanged) |
| If the path were POSIX-normalised first | c:-Code-MyProject |
Claude Code’s own encoder replaces the drive colon and the separators with -. Cursor’s replaces only /.
Both candidate results still contain :, which is not a legal NTFS filename character. Attempting to create c:-Code-MyProject under .claude\projects fails outright (The second path fragment must not be a drive or UNC name.).
The lookup can never succeed on Windows regardless of slash normalisation. On macOS/Linux the encoding happens to match (/Users/me/proj → -Users-me-proj), which is presumably why this went unnoticed.
Ruled out
These were verified as correct on the affected machine:
- Feature gate
import_cc_conversation=true(full rollout, rule...:100.00:1) cursor/importClaudeCodeAgents='true'instate.vscdbItemTable(read via SQL)- Sidebar filter
glassSidebarSettings.filter.showincludessource:third_party - Scan window is 30 days / 50 sessions max; the sessions in question are hours old
~/.claude.jsonand~/.claude/projectsboth exist, so the “is Claude Code installed” probe succeeds (it builds its path differently)
Suggested fix
Match Claude Code’s encoder — normalise separators and strip the drive colon:
function encodeProjectDir(cwd){
return cwd.replace(/[\\/:]/g, "-") || "-";
}
This yields C--Code-MyProject for C:\Code\MyProject and leaves POSIX paths behaving as they do today.
Workaround
None available to users. The expected directory name contains a colon, so it cannot be created, symlinked, or junctioned on Windows.
Affected data on this machine: 68 Claude Code sessions total, 49 for the workspace under test.
Does this stop you from using Cursor
No - Cursor works, but with this issue