davila7/claude-code-templates · warning
Warning: Could not parse ${filename}:
Error message
Warning: Could not parse ${filename}: What it means
loadConversations in ConversationAnalyzer.js failed to parse one conversation file: the per-file try/catch wraps message extraction/caching and warns, skipping that file while continuing the loop.
Source
Thrown at cli-tool/src/analytics/core/ConversationAnalyzer.js:141
filePath: filePath,
messageCount: parsedMessages.length,
fileSize: stats.size,
lastModified: stats.mtime,
created: stats.birthtime,
tokens: tokenUsage.total > 0 ? tokenUsage.total : this.estimateTokens(await this.getFileContent(filePath)),
tokenUsage: tokenUsage,
modelInfo: modelInfo,
toolUsage: toolUsage,
project: finalProject,
status: stateCalculator.determineConversationStatus(parsedMessages, stats.mtime),
conversationState: stateCalculator.determineConversationState(parsedMessages, stats.mtime),
statusSquares: await this.getCachedStatusSquares(filePath, parsedMessages),
// parsedMessages removed to prevent memory leak - available via cache when needed
};
conversations.push(conversation);
} catch (error) {
console.warn(chalk.yellow(`Warning: Could not parse ${filename}:`, error.message));
}
}
return conversations.sort((a, b) => b.lastModified - a.lastModified);
} catch (error) {
console.error(chalk.red('Error loading conversations:'), error.message);
return [];
}
}
/**
* Load active Claude projects from directory structure
* @returns {Promise<Array>} Array of project objects
*/
async loadActiveProjects() {
const projects = [];
try {View on GitHub (pinned to a0851ed10c)
Solutions
- Isolate the file named in the warning and inspect its first lines with head/jq
- If it's an old-format file, exclude or delete it
- Update the CLI/analytics package for the latest format support
- Ignore — other conversations still load
Defensive patterns
Strategy: try-catch
Validate before calling
// Skip files that can't be fully parsed before heavy analysis
const lines = (await fs.readFile(p,'utf8')).split('\n').filter(Boolean);
if (!lines.every(l => { try { JSON.parse(l); return true; } catch { return false; } })) continue; Try / catch
try { conversations.push(await analyze(file)); }
catch (error) { console.warn(`Could not parse ${filename}:`, error.message); /* continue loop */ } Prevention
- Validate .jsonl files on ingest rather than during analytics
- Pin known-good CLI versions that match your conversation formats
- Quarantine unparseable conversations into a retry/inspect folder
When it happens
Trigger: A conversation .jsonl whose structure doesn't match expected Claude Code format (unexpected message shapes, unreadable file), or a cache/derived-computation (statusSquares) throwing for that file.
Common situations: Old/new Claude Code conversation format versions; corrupted files; files from other tools dropped into ~/.claude/projects.
Related errors
- Error parsing message line:
- Warning: Could not extract project from conversation ${fileP
- Failed to update states
- Failed to get system health
- Failed to get Claude session info
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/63638381e4302faf.
Report an issue: GitHub.