You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes:
- Enhanced `listSessions()` to clarify deduplication behavior when filtering by workspace, ensuring no cross-workspace deduplication occurs when the `--workspace` option is set.
- Updated documentation in `CLAUDE.md` to reflect changes in session deduplication and workspace path resolution.
- Improved error handling in `workspaceUriToPath()` to decode percent-encoded characters in workspace URIs.
- Incremented version in `package.json` to 0.12.1.
Why: These updates improve user clarity on session listing behavior and enhance workspace path handling, ensuring a more robust experience.
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,11 +114,11 @@ So when someone uses `import { listSessions } from 'cursor-history'`, they're ca
114
114
115
115
### Storage Layer (`src/core/storage.ts`)
116
116
117
-
-`listSessions()` - Uses workspace storage for listing (correct paths); when listing all (no workspace filter), deduplicates by session ID and attributes to first workspace in deterministic order (.code-workspace paths before folder paths)
117
+
-`listSessions()` - Uses workspace storage for listing (correct paths); when listing all sessions (no `--workspace` filter), deduplicates by session ID and attributes to first workspace in deterministic order (.code-workspace paths before folder paths)
118
118
-`getSession(identifier, ...)` - Get session by 1-based index (number) or composer ID (string). Tries global storage first (full AI responses), falls back to workspace. Returns null when index or composer ID not found.
119
119
-`findWorkspaceForSession(sessionId)` - Finds which workspace contains a session by ID
120
120
-`findWorkspaceByPath(path)` - Finds workspace by its project path (folder or .code-workspace file path)
121
-
-`readWorkspaceJson(workspaceDir)` - Reads workspace path from `workspace.json`: supports `folder` (single-folder workspace, file URI) and `configuration` (.code-workspace file URI); prefers `folder` when both exist; same logic used when reading from backup zip
121
+
-`readWorkspaceJson(workspaceDir)` - Reads workspace path from `workspace.json`: supports `folder` (single-folder workspace, file URI) and `workspace` (.code-workspace file URI); prefers `workspace` when both exist; same logic used when reading from backup zip
122
122
-`getComposerData(db)` - Reads composer array, handles both `allComposers` and legacy formats
123
123
-`updateComposerData(db, composers)` - Writes composer array, preserves original format
124
124
-`resolveSessionIdentifiers(input)` - Converts index/ID/comma-separated to session ID array
@@ -372,7 +372,7 @@ Edit `extractBubbleText()` in `src/core/storage.ts`. Priority matters:
372
372
- Workspace file path resolution: Workspaces opened via a .code-workspace file are now discovered and matchable
373
373
-`readWorkspaceJson()` and `readWorkspaceJsonFromBackup()` now support the `workspace` key (workspace file URI) in addition to `folder` (single-folder URI); prefer `workspace` when both exist;
374
374
- Listing, `--workspace` filter, and `findWorkspaceByPath()` work when the workspace path is the .code-workspace file path
375
-
- Session deduplication: When Cursor has two workspaceStorage entries (folder and .code-workspace), both may receive the same chats. When listing all sessions (no `--workspace` filter), the tool deduplicates by session ID so each chat appears once. Attribution is deterministic: workspaces are sorted by path with .code-workspace paths before others, so the session is attributed to the .code-workspace workspace when the same session exists in both. Filtering or exporting by `--workspace` is unchanged (only that workspace's DB is read).
375
+
- Session deduplication: When Cursor has two workspaceStorage entries (folder and .code-workspace), both may receive the same chats. When listing all sessions (no `--workspace` filter), the tool deduplicates by session ID so each chat appears once. Attribution is deterministic: workspaces are sorted by path with .code-workspace paths before others, so the session is attributed to the .code-workspace workspace when the same session exists in both. Deduplication is not applied when `--workspace` is used; each workspace's DB is listed as-is. Filtering or exporting by `--workspace` is unchanged (only that workspace's DB is read).
376
376
- 010-fix-timestamp-fallback: Fixed incorrect timestamps on pre-2025-09 sessions (Issue #13)
377
377
- Extended `RawBubbleData.timingInfo` with `clientRpcSendTime` and `clientSettleTime` fields
378
378
- New `extractTimestamp()` function in `src/core/storage.ts`: priority chain `createdAt` > `clientRpcSendTime` > `clientSettleTime` > `clientEndTime` > `null`
0 commit comments