davila7/claude-code-templates · warning
Could not detect installed components:
Error message
Could not detect installed components:
What it means
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.
Source
Thrown at cli-tool/src/analytics/core/YearInReview2025.js:608
});
});
}
// Extract enabled plugins
if (settings.enabledPlugins) {
Object.entries(settings.enabledPlugins).forEach(([pluginName, enabled]) => {
if (enabled) {
components.push({
type: 'skill',
name: pluginName.split('@')[0],
date: new Date('2025-02-01')
});
}
});
}
}
} catch (error) {
console.warn('Could not detect installed components:', error.message);
}
return components;
}
/**
* Generate insights and fun facts
* @param {Array} conversations - 2025 conversations
* @returns {Array} Insights
*/
generateInsights(conversations) {
const insights = [];
// Total messages
const totalMessages = conversations.reduce((sum, conv) => sum + (conv.messageCount || 0), 0);
insights.push(`Sent ${totalMessages.toLocaleString()} messages`);
// Average session lengthView on GitHub (pinned to a0851ed10c)
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
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify component dirs exist and are readable before the year-in-review scan
for (const d of ['agents','commands','skills']) {
const ok = await fs.access(path.join(homedir, '.claude', d)).then(() => true).catch(() => false);
if (!ok) console.log(`skipping ${d}`);
} Try / catch
try { /* scan component dirs */ }
catch (error) { console.warn('Could not detect installed components:', error.message); return components; } Prevention
- chown ~/.claude to your user if sudo was ever used
- Fix fd limits before large scans
- Expect partial component counts when warnings fire
When it happens
Trigger: Scanning ~/.claude directories for installed components when one read/stat/parse throws (permissions, EMFILE, unexpected file shape) inside the big loop.
Common situations: Mixed-ownership files under ~/.claude after sudo use; component files with unusual structure introduced by other tools; very large installs hitting fd limits.
Related errors
- Failed to update states
- Failed to generate year in review
- Warning: Could not extract project from conversation ${fileP
- ⚠️ Console Bridge initialization failed:
- Warning: Could not read agents directory ${agentsDir}:
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/01e2437a6ac9b58c.
Report an issue: GitHub.