{"record":{"id":"63638381e4302faf","repo":"davila7/claude-code-templates","slug":"warning-could-not-parse-filename","errorCode":null,"errorMessage":"Warning: Could not parse ${filename}:","messagePattern":"Warning: Could not parse (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/analytics/core/ConversationAnalyzer.js","lineNumber":141,"sourceCode":"            filePath: filePath,\n            messageCount: parsedMessages.length,\n            fileSize: stats.size,\n            lastModified: stats.mtime,\n            created: stats.birthtime,\n            tokens: tokenUsage.total > 0 ? tokenUsage.total : this.estimateTokens(await this.getFileContent(filePath)),\n            tokenUsage: tokenUsage,\n            modelInfo: modelInfo,\n            toolUsage: toolUsage,\n            project: finalProject,\n            status: stateCalculator.determineConversationStatus(parsedMessages, stats.mtime),\n            conversationState: stateCalculator.determineConversationState(parsedMessages, stats.mtime),\n            statusSquares: await this.getCachedStatusSquares(filePath, parsedMessages),\n            // parsedMessages removed to prevent memory leak - available via cache when needed\n          };\n\n          conversations.push(conversation);\n        } catch (error) {\n          console.warn(chalk.yellow(`Warning: Could not parse ${filename}:`, error.message));\n        }\n      }\n\n      return conversations.sort((a, b) => b.lastModified - a.lastModified);\n    } catch (error) {\n      console.error(chalk.red('Error loading conversations:'), error.message);\n      return [];\n    }\n  }\n\n  /**\n   * Load active Claude projects from directory structure\n   * @returns {Promise<Array>} Array of project objects\n   */\n  async loadActiveProjects() {\n    const projects = [];\n\n    try {","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/analytics/core/ConversationAnalyzer.js#L123-L159","documentation":"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.","triggerScenarios":"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.","commonSituations":"Old/new Claude Code conversation format versions; corrupted files; files from other tools dropped into ~/.claude/projects.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Skip files that can't be fully parsed before heavy analysis\nconst lines = (await fs.readFile(p,'utf8')).split('\\n').filter(Boolean);\nif (!lines.every(l => { try { JSON.parse(l); return true; } catch { return false; } })) continue;","typeGuard":null,"tryCatchPattern":"try { conversations.push(await analyze(file)); }\ncatch (error) { console.warn(`Could not parse ${filename}:`, error.message); /* continue loop */ }","preventionTips":["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"],"tags":["jsonl","parsing","conversations","analytics"],"backgroundTag":"conversation-file-parse-error","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}