()
| 41 | } |
| 42 | |
| 43 | async function checkClaudeMdFiles(): Promise<ContextWarning | null> { |
| 44 | const largeFiles = getLargeMemoryFiles(await getMemoryFiles()) |
| 45 | |
| 46 | // This already filters for files > 40k chars each |
| 47 | if (largeFiles.length === 0) { |
| 48 | return null |
| 49 | } |
| 50 | |
| 51 | const details = largeFiles |
| 52 | .sort((a, b) => b.content.length - a.content.length) |
| 53 | .map(file => `${file.path}: ${file.content.length.toLocaleString()} chars`) |
| 54 | |
| 55 | const message = |
| 56 | largeFiles.length === 1 |
| 57 | ? `Large CLAUDE.md file detected (${largeFiles[0]!.content.length.toLocaleString()} chars > ${MAX_MEMORY_CHARACTER_COUNT.toLocaleString()})` |
| 58 | : `${largeFiles.length} large CLAUDE.md files detected (each > ${MAX_MEMORY_CHARACTER_COUNT.toLocaleString()} chars)` |
| 59 | |
| 60 | return { |
| 61 | type: 'claudemd_files', |
| 62 | severity: 'warning', |
| 63 | message, |
| 64 | details, |
| 65 | currentValue: largeFiles.length, // Number of files exceeding threshold |
| 66 | threshold: MAX_MEMORY_CHARACTER_COUNT, |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Check agent descriptions token count |
no test coverage detected