{"record":{"id":"60ba046820cd353c","repo":"thedotmack/claude-mem","slug":"ide-detection-failed-to-read-vs-code-extensions","errorCode":null,"errorMessage":"[ide-detection] Failed to read VS Code extensions directory:","messagePattern":"\\[ide-detection\\] Failed to read VS Code extensions directory:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/npx-cli/commands/ide-detection.ts","lineNumber":40,"sourceCode":"      execFileSync('which', [command], { stdio: 'ignore' });\n    }\n    return true;\n  } catch (error: unknown) {\n    if (process.env.DEBUG) {\n      console.error(`[ide-detection] ${command} not in PATH:`, error instanceof Error ? error.message : String(error));\n    }\n    return false;\n  }\n}\n\nfunction hasVscodeExtension(extensionNameFragment: string): boolean {\n  const extensionsDirectory = join(homedir(), '.vscode', 'extensions');\n  if (!existsSync(extensionsDirectory)) return false;\n  try {\n    const entries = readdirSync(extensionsDirectory);\n    return entries.some((entry) => entry.toLowerCase().includes(extensionNameFragment.toLowerCase()));\n  } catch (error: unknown) {\n    console.warn('[ide-detection] Failed to read VS Code extensions directory:', error instanceof Error ? error.message : String(error));\n    return false;\n  }\n}\n\nexport function detectInstalledIDEs(): IDEInfo[] {\n  const home = homedir();\n\n  return [\n    {\n      id: 'claude-code',\n      label: 'Claude Code',\n      detected: isCommandInPath('claude'),\n      hint: 'recommended',\n    },\n    {\n      id: 'opencode',\n      label: 'OpenCode',\n      detected:","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/npx-cli/commands/ide-detection.ts#L22-L58","documentation":"A console.warn from the installer's IDE detection: readdirSync on ~/.vscode/extensions threw (typically EACCES/EPERM) after the directory was confirmed to exist. The function returns false for that check, so VS Code / VS Code-based IDEs are reported as not detected and the installer's pre-selection lists fewer IDEs. Detection of command-line IDEs is unaffected.","triggerScenarios":"Running `npx claude-mem install` where ~/.vscode/extensions exists but is unreadable — restrictive home-dir permissions, root-owned directory from a past sudo run, or SELinux/AppArmor denying reads.","commonSituations":"Running the installer under sudo so later runs as the normal user lack read access; managed/locked-down corporate machines; NAS-mounted home directories with odd ACL semantics.","solutions":["Fix ownership/permissions: sudo chown -R $USER ~/.vscode && chmod -R u+rX ~/.vscode","Then simply select the IDE manually on the installer prompt — detection failing only affects auto-selection","Check with ls ~/.vscode/extensions in the same shell to confirm the read now succeeds"],"exampleFix":"# before\n$ ls ~/.vscode/extensions\nls: cannot open directory: Permission denied\n\n# after\n$ sudo chown -R $USER ~/.vscode && chmod -R u+rX ~/.vscode\n$ npx claude-mem install  # VS Code now auto-detected","handlingStrategy":"fallback","validationCode":"import { accessSync, constants } from 'node:fs';\nfunction extensionsReadable(dir: string): boolean {\n  try { accessSync(dir, constants.R_OK); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep ~/.vscode owned and readable by your user (never edit dotfiles with sudo)","When detection fails, select IDEs manually in the installer prompt instead of trusting auto-detect","Run installers as the regular user, not root"],"tags":["ide-detection","installer","permissions","eacces","vscode"],"backgroundTag":"home-directory-permission-denied","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}