← Back to Kontasks
Compaction Detection Added to Telemetry
Added hadCompaction flag to track context compaction events in telemetry
Output
✓ Compaction Detection Added
What's New
Telemetry now tracks when context compaction (auto-summarization) occurs during a turn. This helps separate normal turn timing from compaction-inflated timing.
Changes Made
| File | Change |
|---|---|
metrics.ts | Added hadCompaction?: boolean to TelemetryRecord |
router.ts | API accepts and stores hadCompaction flag |
console-event-handler.ts | Tracks sawCompactionThisTurn, sets flag on auto_compact event, sends with telemetry |
views/telemetry.ts | Shows 🔄 badge on compaction turns, adds Compaction Stats section |
How It Works
- When Claude sends
auto_compactevent, the client setssawCompactionThisTurn = true - When the turn completes and telemetry is sent,
hadCompactionis included in the payload - The flag resets after each telemetry submission
- The telemetry view shows a 🔄 badge next to compaction turns
- A new "Compaction Stats" section shows count, avg time, and % of turns
Telemetry View Preview
🔄 Context Compaction 3 45.2s 4% Compaction Avg compaction of recent turns time turns Compaction turns are significantly longer as Claude summarizes the conversation context.
Next Steps
Restart konui to apply changes. Future compaction events will now be tracked and displayed in the telemetry dashboard.
What's Next?
Choose an action:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
telemetrycompactionperformance
Created
4 Jan 2026, 1:51 am
Updated
4 Jan 2026, 1:51 am
Created By
claude
Raw Data
{
"id": "a149f243-a632-40ff-8f00-bcad105e1761",
"type": "general",
"status": "completed",
"title": "Compaction Detection Added to Telemetry",
"description": "Added hadCompaction flag to track context compaction events in telemetry",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:sans-serif;\">\n<h2 style=\"color:#fff;margin:0 0 16px 0;\">✓ Compaction Detection Added</h2>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#a78bfa;margin:0 0 12px 0;\">What's New</h3>\n<p style=\"margin:0;line-height:1.6;\">Telemetry now tracks when context compaction (auto-summarization) occurs during a turn. This helps separate normal turn timing from compaction-inflated timing.</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#61afef;margin:0 0 12px 0;\">Changes Made</h3>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;\">\n<tr style=\"border-bottom:1px solid #444;\">\n<th style=\"text-align:left;padding:8px;color:#9ca3af;\">File</th>\n<th style=\"text-align:left;padding:8px;color:#9ca3af;\">Change</th>\n</tr>\n<tr><td style=\"padding:8px;\"><code style=\"color:#e5c07b;\">metrics.ts</code></td><td style=\"padding:8px;\">Added <code>hadCompaction?: boolean</code> to TelemetryRecord</td></tr>\n<tr><td style=\"padding:8px;\"><code style=\"color:#e5c07b;\">router.ts</code></td><td style=\"padding:8px;\">API accepts and stores hadCompaction flag</td></tr>\n<tr><td style=\"padding:8px;\"><code style=\"color:#e5c07b;\">console-event-handler.ts</code></td><td style=\"padding:8px;\">Tracks <code>sawCompactionThisTurn</code>, sets flag on auto_compact event, sends with telemetry</td></tr>\n<tr><td style=\"padding:8px;\"><code style=\"color:#e5c07b;\">views/telemetry.ts</code></td><td style=\"padding:8px;\">Shows 🔄 badge on compaction turns, adds Compaction Stats section</td></tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#98c379;margin:0 0 12px 0;\">How It Works</h3>\n<ol style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li>When Claude sends <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:3px;\">auto_compact</code> event, the client sets <code>sawCompactionThisTurn = true</code></li>\n<li>When the turn completes and telemetry is sent, <code>hadCompaction</code> is included in the payload</li>\n<li>The flag resets after each telemetry submission</li>\n<li>The telemetry view shows a 🔄 badge next to compaction turns</li>\n<li>A new \"Compaction Stats\" section shows count, avg time, and % of turns</li>\n</ol>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;\">Telemetry View Preview</h3>\n<pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;overflow-x:auto;font-family:'Consolas','Monaco',monospace;font-size:0.85rem;\">\n<span style=\"color:#a78bfa;font-weight:bold;\">🔄 Context Compaction</span>\n\n <span style=\"color:#a78bfa;font-size:1.2em;\">3</span> <span style=\"color:#a78bfa;font-size:1.2em;\">45.2s</span> <span style=\"color:#a78bfa;font-size:1.2em;\">4%</span>\n Compaction Avg compaction of recent\n turns time turns\n\n<span style=\"color:#7f848e;font-style:italic;\">Compaction turns are significantly longer as Claude\nsummarizes the conversation context.</span>\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;\">\n<h3 style=\"color:#56b6c2;margin:0 0 8px 0;\">Next Steps</h3>\n<p style=\"margin:0;line-height:1.6;\">Restart konui to apply changes. Future compaction events will now be tracked and displayed in the telemetry dashboard.</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:12px;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-04T01:55:00.000Z",
"requestId": "ab51e5fd-4eba-4857-8590-c8b21c1385e8",
"choices": [
{
"label": "View telemetry page",
"value": "Show me the telemetry page to verify the changes",
"primary": true
},
{
"label": "Commit changes",
"value": "Commit the compaction tracking changes to git"
},
{
"label": "Continue working",
"value": "What else can we improve?"
}
]
},
"createdBy": "claude",
"createdAt": "2026-01-03T15:51:26.028Z",
"updatedAt": "2026-01-03T15:51:26.211Z",
"requestId": "ab51e5fd-4eba-4857-8590-c8b21c1385e8",
"scope": "vibetools",
"tags": [
"telemetry",
"compaction",
"performance"
],
"targetUser": "claude"
}