{"record":{"id":"01e2437a6ac9b58c","repo":"davila7/claude-code-templates","slug":"could-not-detect-installed-components","errorCode":null,"errorMessage":"Could not detect installed components:","messagePattern":"Could not detect installed components:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/analytics/core/YearInReview2025.js","lineNumber":608,"sourceCode":"            });\n          });\n        }\n\n        // Extract enabled plugins\n        if (settings.enabledPlugins) {\n          Object.entries(settings.enabledPlugins).forEach(([pluginName, enabled]) => {\n            if (enabled) {\n              components.push({\n                type: 'skill',\n                name: pluginName.split('@')[0],\n                date: new Date('2025-02-01')\n              });\n            }\n          });\n        }\n      }\n    } catch (error) {\n      console.warn('Could not detect installed components:', error.message);\n    }\n\n    return components;\n  }\n\n  /**\n   * Generate insights and fun facts\n   * @param {Array} conversations - 2025 conversations\n   * @returns {Array} Insights\n   */\n  generateInsights(conversations) {\n    const insights = [];\n\n    // Total messages\n    const totalMessages = conversations.reduce((sum, conv) => sum + (conv.messageCount || 0), 0);\n    insights.push(`Sent ${totalMessages.toLocaleString()} messages`);\n\n    // Average session length","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/analytics/core/YearInReview2025.js#L590-L626","documentation":"YearInReview2025.detectInstalledComponents caught an error while scanning installed component directories (agents/commands/skills/mcps hooks etc.) and returns whatever it collected so far — the year-in-review still renders, possibly with fewer components.","triggerScenarios":"Scanning ~/.claude directories for installed components when one read/stat/parse throws (permissions, EMFILE, unexpected file shape) inside the big loop.","commonSituations":"Mixed-ownership files under ~/.claude after sudo use; component files with unusual structure introduced by other tools; very large installs hitting fd limits.","solutions":["Check ~/.claude subdirectory permissions and fix ownership (chown -R)","Run with more file descriptors (ulimit -n 4096) if scanning stalls or EMFILEs","Ignore — the report degrades gracefully","Verify ~/.claude exists and matches expected structure for this CLI version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify component dirs exist and are readable before the year-in-review scan\nfor (const d of ['agents','commands','skills']) {\n  const ok = await fs.access(path.join(homedir, '.claude', d)).then(() => true).catch(() => false);\n  if (!ok) console.log(`skipping ${d}`);\n}","typeGuard":null,"tryCatchPattern":"try { /* scan component dirs */ }\ncatch (error) { console.warn('Could not detect installed components:', error.message); return components; }","preventionTips":["chown ~/.claude to your user if sudo was ever used","Fix fd limits before large scans","Expect partial component counts when warnings fire"],"tags":["year-in-review","components","file-io","graceful-degradation"],"backgroundTag":"directory-read-failed","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}