davila7/claude-code-templates · error
Failed to generate year in review
Error message
Failed to generate year in review
What it means
500 from GET /api/2025 (Year in Review). The handler generates the yearly summary; unlike its siblings it includes error.message, so the response tells you the actual generation failure (usually reading/aggregating a year of conversation data).
Source
Thrown at cli-tool/src/analytics.js:1254
this.app.get('/api/2025', async (req, res) => {
try {
console.log('📅 Generating 2025 Year in Review...');
// Load all conversations for analysis
const allConversations = await this.conversationAnalyzer.loadConversations(this.stateCalculator);
// Generate year in review statistics
const yearInReview = await this.yearInReview2025.generateYearInReview(allConversations, this.claudeDir);
console.log(`✅ 2025 Year in Review generated with ${yearInReview.totalConversations} conversations`);
res.json({
...yearInReview,
timestamp: new Date().toISOString()
});
} catch (error) {
console.error('Error generating 2025 year in review:', error);
res.status(500).json({
error: 'Failed to generate year in review',
message: error.message
});
}
});
// Year in Review 2025 page route
this.app.get('/2025', (req, res) => {
res.sendFile(path.join(__dirname, 'analytics-web', '2025.html'));
});
// Main dashboard route
this.app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'analytics-web', 'index.html'));
});
}
async startServer() {View on GitHub (pinned to a0851ed10c)
Solutions
- Read the 'message' field of the 500 response — it carries error.message
- Clear caches and retry the endpoint
- Prune or archive very old/corrupt conversation files under ~/.claude/projects
- If it consistently fails on one file, the message usually names it; remove/fix that file
Defensive patterns
Strategy: try-catch
Validate before calling
const hasData = await fetch(base + '/api/conversations').then(r => r.ok);
Try / catch
try { return await getYearInReview(); } catch (e) { if (e.message) log(e.message); return generateClientSideFallbackSummary(); } Prevention
- Archive very large histories before running year-in-review
- Check the message field first — it names the failing file
When it happens
Trigger: GET /api/2025 when the year-review generator throws — corrupt session files, missing timestamps in conversations, or resource exhaustion over a year of data.
Common situations: Very large conversation histories; sessions with malformed created_at fields; disk/read errors in ~/.claude/projects.
Related errors
- Failed to update states
- Failed to get system health
- Failed to get Claude session info
- Failed to get performance metrics
- Failed to clear cache
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/3bc9cac40b791bd3.
Report an issue: GitHub.