claude-remote-cli 2.4.7 → 2.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,8 +100,16 @@ function scanReposInRoot(rootDir) {
100
100
  if (!entry.isDirectory() || entry.name.startsWith('.'))
101
101
  continue;
102
102
  const fullPath = path.join(rootDir, entry.name);
103
- if (fs.existsSync(path.join(fullPath, '.git'))) {
104
- repos.push({ name: entry.name, path: fullPath, root: rootDir });
103
+ const dotGit = path.join(fullPath, '.git');
104
+ try {
105
+ // Only count directories with a .git *directory* as repos.
106
+ // Worktrees and submodules have a .git *file* and should be skipped.
107
+ if (fs.statSync(dotGit).isDirectory()) {
108
+ repos.push({ name: entry.name, path: fullPath, root: rootDir });
109
+ }
110
+ }
111
+ catch (_) {
112
+ // .git doesn't exist — not a repo
105
113
  }
106
114
  }
107
115
  return repos;
@@ -446,7 +454,15 @@ async function main() {
446
454
  }
447
455
  }
448
456
  }
449
- res.json(worktrees);
457
+ // Deduplicate by path (a worktree can appear via multiple repo scans)
458
+ const seen = new Set();
459
+ const unique = worktrees.filter(wt => {
460
+ if (seen.has(wt.path))
461
+ return false;
462
+ seen.add(wt.path);
463
+ return true;
464
+ });
465
+ res.json(unique);
450
466
  });
451
467
  // GET /roots — list root directories
452
468
  app.get('/roots', requireAuth, (_req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-remote-cli",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "description": "Remote web interface for Claude Code CLI sessions",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",