From 8096d9a2d5c6e3739ab39a50a20bcea453d735f1 Mon Sep 17 00:00:00 2001 From: jean-baptiste Date: Sun, 24 May 2026 11:16:34 +0200 Subject: [PATCH] fix(work-files): dedupe projects by projectPath in get-work-files IPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Multiple ~/.claude/projects/ folders can derive to the same projectPath when resolveWorktreePath collapses worktree paths back to their parent repo (e.g. ~30 skaleet-ai worktree folders all → /workspace/skaleet-ai). Without a dedup, the get-work-files IPC pushed one entry per source folder, producing N copies of the project header and its file list in the UI. --- main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.js b/main.js index 339bdb93..8d88d5da 100644 --- a/main.js +++ b/main.js @@ -928,6 +928,11 @@ function walkWorkFiles(dir, baseDir, results) { ipcMain.handle('get-work-files', () => { const global = getSetting('global') || {}; const hiddenProjects = new Set(global.hiddenProjects || []); + // Dedupe by projectPath: multiple ~/.claude/projects/ folders (e.g. worktrees + // of the same repo) can derive to the same projectPath via + // resolveWorktreePath, which would otherwise produce N copies of the same + // header+file list in the UI. + const seen = new Set(); const projects = []; try { @@ -941,6 +946,8 @@ ipcMain.handle('get-work-files', () => { const projectPath = deriveProjectPath(folderPath, folder); if (!projectPath) continue; if (hiddenProjects.has(projectPath)) continue; + if (seen.has(projectPath)) continue; + seen.add(projectPath); const workFilesDir = path.join(projectPath, '.work-files'); if (!fs.existsSync(workFilesDir)) continue;