← Back to Kontasks
CLAUDE.md Token Analysis & Refactoring Assessment
Analysis of all CLAUDE.md files showing token usage and refactoring recommendations
Output
📊 CLAUDE.md Token Analysis
File Sizes Overview
| File | Lines | Words | ~Tokens | % of 200K |
|---|---|---|---|---|
| ● root/CLAUDE.md | 2,329 | 11,102 | ~14,432 | 7.2% |
| ● konui/CLAUDE.md | 1,146 | 4,865 | ~6,324 | 3.2% |
| ● konsole/CLAUDE.md | 457 | 1,756 | ~2,282 | 1.1% |
| ● kondata/CLAUDE.md | 372 | 1,689 | ~2,195 | 1.1% |
| ● konimage/CLAUDE.md | 206 | 847 | ~1,101 | 0.6% |
| ● kongate/CLAUDE.md | 135 | 741 | ~963 | 0.5% |
| ● kontext/CLAUDE.md | 160 | 670 | ~871 | 0.4% |
| ● konwebflow/CLAUDE.md | 128 | 653 | ~848 | 0.4% |
| TOTAL (all combined) | 4,933 | 22,323 | ~29,019 | 14.5% |
🔴 Root CLAUDE.md - Section Breakdown
The root file alone is 14K+ tokens. Here are the biggest sections:
| Section | Words | ~Tokens |
|---|---|---|
| Kontasks - Visual Decision Canvas | 6,997 | ~9,096 |
| Konsole Safety Configuration | 416 | ~540 |
| Service Management | 336 | ~436 |
| Service Restart Safety | 332 | ~431 |
| Turn Completion Protocol | 281 | ~365 |
| All other sections combined | 2,740 | ~3,562 |
⚠️ The Kontasks section is 63% of the root file!
🤔 Assessment & Recommendations
The Good News:
- 14.5% of context window is used by ALL CLAUDE.md files combined - well within budget
- Service-specific files are appropriately sized (500-2,300 tokens each)
- Most context comes from code/conversation, not instructions
The Concern:
- Kontasks section (~9K tokens) is massive - it's essentially a full UI component library
- Contains extensive HTML templates, interactive component docs, styling guides
- Much of this is reference material Claude rarely needs in full
Refactoring Options:
| Option 1: Split Kontasks | Move kontask templates and interactive components to a separate KONTASKS.md file. Root keeps just the core concepts (~2K tokens instead of 9K). |
| Option 2: Move to konui | The kontask HTML templates belong in konui/CLAUDE.md since that's where they're implemented. Root just references them. |
| Option 3: Leave As-Is | 14.5% context usage isn't critical. The investment in detailed kontask docs pays off in better output quality. Don't optimize prematurely. |
| Option 4: Lazy Loading | Future enhancement: Only load kontask templates when creating output kontasks. Requires Claude SDK changes. |
💡 My Recommendation
Option 2 is the cleanest architectural move. Kontask templates are konui implementation details. Move them there and keep root CLAUDE.md focused on project-wide patterns. This would reduce root from ~14K to ~5K tokens while maintaining full documentation coverage.
However, this is an optimization, not an emergency. Current context usage is healthy.
What's Next?
Choose an action:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
claude-mdtokensperformancerefactoring
Created
8 Jan 2026, 11:16 am
Updated
8 Jan 2026, 11:16 am
Timing
⏱️ 124.2s
0 tools
● TTFE 0%
● Thinking 100%
● Tools 0%
Created By
claude
Raw Data
{
"id": "9dac118d-f8d8-4c1c-b5c2-d658fc8b5c5e",
"type": "general",
"status": "completed",
"title": "CLAUDE.md Token Analysis & Refactoring Assessment",
"description": "Analysis of all CLAUDE.md files showing token usage and refactoring recommendations",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:'Consolas','Monaco',monospace;\">\n<h2 style=\"font-family:sans-serif;color:#fff;margin:0 0 16px 0;\">📊 CLAUDE.md Token Analysis</h2>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"margin:0 0 12px 0;color:#fff;font-family:sans-serif;\">File Sizes Overview</h3>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;\">\n<thead>\n<tr style=\"border-bottom:2px solid #4b5563;\">\n<th style=\"text-align:left;padding:8px;color:#9ca3af;\">File</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">Lines</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">Words</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">~Tokens</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">% of 200K</th>\n</tr>\n</thead>\n<tbody>\n<tr style=\"background:#ef444420;border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#ef4444;\">●</span> root/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">2,329</td>\n<td style=\"text-align:right;padding:8px;\">11,102</td>\n<td style=\"text-align:right;padding:8px;color:#ef4444;font-weight:bold;\">~14,432</td>\n<td style=\"text-align:right;padding:8px;color:#ef4444;\">7.2%</td>\n</tr>\n<tr style=\"background:#f59e0b20;border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#f59e0b;\">●</span> konui/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">1,146</td>\n<td style=\"text-align:right;padding:8px;\">4,865</td>\n<td style=\"text-align:right;padding:8px;color:#f59e0b;font-weight:bold;\">~6,324</td>\n<td style=\"text-align:right;padding:8px;color:#f59e0b;\">3.2%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> konsole/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">457</td>\n<td style=\"text-align:right;padding:8px;\">1,756</td>\n<td style=\"text-align:right;padding:8px;\">~2,282</td>\n<td style=\"text-align:right;padding:8px;\">1.1%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> kondata/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">372</td>\n<td style=\"text-align:right;padding:8px;\">1,689</td>\n<td style=\"text-align:right;padding:8px;\">~2,195</td>\n<td style=\"text-align:right;padding:8px;\">1.1%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> konimage/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">206</td>\n<td style=\"text-align:right;padding:8px;\">847</td>\n<td style=\"text-align:right;padding:8px;\">~1,101</td>\n<td style=\"text-align:right;padding:8px;\">0.6%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> kongate/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">135</td>\n<td style=\"text-align:right;padding:8px;\">741</td>\n<td style=\"text-align:right;padding:8px;\">~963</td>\n<td style=\"text-align:right;padding:8px;\">0.5%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> kontext/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">160</td>\n<td style=\"text-align:right;padding:8px;\">670</td>\n<td style=\"text-align:right;padding:8px;\">~871</td>\n<td style=\"text-align:right;padding:8px;\">0.4%</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">●</span> konwebflow/CLAUDE.md</td>\n<td style=\"text-align:right;padding:8px;\">128</td>\n<td style=\"text-align:right;padding:8px;\">653</td>\n<td style=\"text-align:right;padding:8px;\">~848</td>\n<td style=\"text-align:right;padding:8px;\">0.4%</td>\n</tr>\n<tr style=\"background:#3b82f620;border-top:2px solid #4b5563;font-weight:bold;\">\n<td style=\"padding:8px;\">TOTAL (all combined)</td>\n<td style=\"text-align:right;padding:8px;\">4,933</td>\n<td style=\"text-align:right;padding:8px;\">22,323</td>\n<td style=\"text-align:right;padding:8px;color:#3b82f6;\">~29,019</td>\n<td style=\"text-align:right;padding:8px;color:#3b82f6;\">14.5%</td>\n</tr>\n</tbody>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"margin:0 0 12px 0;color:#fff;font-family:sans-serif;\">🔴 Root CLAUDE.md - Section Breakdown</h3>\n<p style=\"color:#9ca3af;margin:0 0 12px 0;\">The root file alone is 14K+ tokens. Here are the biggest sections:</p>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;\">\n<thead>\n<tr style=\"border-bottom:2px solid #4b5563;\">\n<th style=\"text-align:left;padding:8px;color:#9ca3af;\">Section</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">Words</th>\n<th style=\"text-align:right;padding:8px;color:#9ca3af;\">~Tokens</th>\n</tr>\n</thead>\n<tbody>\n<tr style=\"background:#ef444440;border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\"><strong>Kontasks - Visual Decision Canvas</strong></td>\n<td style=\"text-align:right;padding:8px;\">6,997</td>\n<td style=\"text-align:right;padding:8px;color:#ef4444;font-weight:bold;\">~9,096</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\">Konsole Safety Configuration</td>\n<td style=\"text-align:right;padding:8px;\">416</td>\n<td style=\"text-align:right;padding:8px;\">~540</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\">Service Management</td>\n<td style=\"text-align:right;padding:8px;\">336</td>\n<td style=\"text-align:right;padding:8px;\">~436</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\">Service Restart Safety</td>\n<td style=\"text-align:right;padding:8px;\">332</td>\n<td style=\"text-align:right;padding:8px;\">~431</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;\">Turn Completion Protocol</td>\n<td style=\"text-align:right;padding:8px;\">281</td>\n<td style=\"text-align:right;padding:8px;\">~365</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;color:#7f848e;\">All other sections combined</td>\n<td style=\"text-align:right;padding:8px;color:#7f848e;\">2,740</td>\n<td style=\"text-align:right;padding:8px;color:#7f848e;\">~3,562</td>\n</tr>\n</tbody>\n</table>\n<p style=\"color:#f59e0b;margin:12px 0 0 0;\">⚠️ <strong>The Kontasks section is 63% of the root file!</strong></p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"margin:0 0 12px 0;color:#fff;font-family:sans-serif;\">🤔 Assessment & Recommendations</h3>\n\n<div style=\"margin-bottom:16px;\">\n<h4 style=\"color:#22c55e;margin:0 0 8px 0;\">The Good News:</h4>\n<ul style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li><strong>14.5% of context window</strong> is used by ALL CLAUDE.md files combined - well within budget</li>\n<li>Service-specific files are appropriately sized (500-2,300 tokens each)</li>\n<li>Most context comes from code/conversation, not instructions</li>\n</ul>\n</div>\n\n<div style=\"margin-bottom:16px;\">\n<h4 style=\"color:#f59e0b;margin:0 0 8px 0;\">The Concern:</h4>\n<ul style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li><strong>Kontasks section (~9K tokens)</strong> is massive - it's essentially a full UI component library</li>\n<li>Contains extensive HTML templates, interactive component docs, styling guides</li>\n<li>Much of this is <strong>reference material</strong> Claude rarely needs in full</li>\n</ul>\n</div>\n\n<div>\n<h4 style=\"color:#3b82f6;margin:0 0 8px 0;\">Refactoring Options:</h4>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;margin-top:8px;\">\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;width:30%;vertical-align:top;\"><strong style=\"color:#22c55e;\">Option 1: Split Kontasks</strong></td>\n<td style=\"padding:8px;\">Move kontask templates and interactive components to a separate <code>KONTASKS.md</code> file. Root keeps just the core concepts (~2K tokens instead of 9K).</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;vertical-align:top;\"><strong style=\"color:#3b82f6;\">Option 2: Move to konui</strong></td>\n<td style=\"padding:8px;\">The kontask HTML templates belong in <code>konui/CLAUDE.md</code> since that's where they're implemented. Root just references them.</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;vertical-align:top;\"><strong style=\"color:#8b5cf6;\">Option 3: Leave As-Is</strong></td>\n<td style=\"padding:8px;\">14.5% context usage isn't critical. The investment in detailed kontask docs pays off in better output quality. Don't optimize prematurely.</td>\n</tr>\n<tr style=\"border-bottom:1px solid #374151;\">\n<td style=\"padding:8px;vertical-align:top;\"><strong style=\"color:#f59e0b;\">Option 4: Lazy Loading</strong></td>\n<td style=\"padding:8px;\">Future enhancement: Only load kontask templates when creating output kontasks. Requires Claude SDK changes.</td>\n</tr>\n</table>\n</div>\n</div>\n\n<div style=\"background:#1e3a5f;padding:16px;border-radius:6px;border-left:4px solid #3b82f6;\">\n<h4 style=\"margin:0 0 8px 0;color:#fff;\">💡 My Recommendation</h4>\n<p style=\"color:#e0e0e0;margin:0;line-height:1.6;\"><strong>Option 2</strong> is the cleanest architectural move. Kontask templates are konui implementation details. Move them there and keep root CLAUDE.md focused on project-wide patterns. This would reduce root from ~14K to ~5K tokens while maintaining full documentation coverage.</p>\n<p style=\"color:#9ca3af;margin:8px 0 0 0;font-size:0.9rem;\">However, this is an optimization, not an emergency. Current context usage is healthy.</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-top:16px;\">\n<h4 style=\"margin:0 0 8px 0;color:#fff;\">What's Next?</h4>\n<p style=\"color:#9ca3af;margin:0;\">Choose an action:</p>\n</div>\n</div>",
"requestedAt": "2026-01-08T01:25:00.000Z",
"requestId": "798cd3fc-a824-477e-be5f-6a17fba04f12",
"choices": [
{
"label": "Refactor now (Option 2)",
"value": "Move kontask templates from root CLAUDE.md to konui/CLAUDE.md - keep root focused on project-wide patterns",
"primary": true
},
{
"label": "Leave as-is",
"value": "Keep CLAUDE.md files as they are - the 14.5% context usage is acceptable"
},
{
"label": "Create KONTASKS.md",
"value": "Create a separate KONTASKS.md file for all kontask-related documentation (Option 1)"
},
{
"label": "Show section detail",
"value": "Show me the full breakdown of what's in the Kontasks section so I can decide what to move"
}
],
"turnTiming": {
"totalMs": 124153,
"ttfeMs": 104,
"thinkingMs": 124046,
"toolExecutionMs": 0,
"toolCallCount": 0,
"thinkingPct": 100,
"toolsPct": 0,
"ttfePct": 0
}
},
"createdBy": "claude",
"createdAt": "2026-01-08T01:16:50.959Z",
"updatedAt": "2026-01-08T01:16:57.554Z",
"requestId": "798cd3fc-a824-477e-be5f-6a17fba04f12",
"scope": "vibetools",
"tags": [
"claude-md",
"tokens",
"performance",
"refactoring"
],
"targetUser": "claude"
}