← Back to Kontasks
Auto-load Recent Kontasks on Turn Start
Proposal to read recent kontasks at turn start for better context continuity
Output
💡 Auto-Load Recent Kontasks on Turn Start
✓ You're Absolutely Right
We're creating rich kontask outputs with valuable context (what was done, decisions made, code changes, next steps) but then throwing it all away when the next turn starts. Claude has to rediscover what was just completed.
📊 Current Flow (Wasteful)
Turn 1: Does work → Creates kontask with rich output
Turn 2: Starts fresh → Hunts for what was done → Reads files, greps, explores
└── Kontask from Turn 1 sitting RIGHT THERE, ignored
🎯 Proposed Flow (Smart)
Turn N starts:
1. Hook/system reads last 3 kontasks (mine + completed)
2. Injects summary into system prompt or first message
3. Claude immediately knows:
- What was just done
- What files were touched
- What decisions were made
- What the user approved/rejected
🔧 Implementation Options
| Option | Where | Pros/Cons |
|---|---|---|
| A. UserPromptSubmit Hook | konsole kontext.ts | Already have hook infra, adds to every prompt |
| B. System Prompt Injection | konsole spawn | One-time at session start, stale after first turn |
| C. CLAUDE.md Dynamic Section | Generate on spawn | Gets cached, reduces freshness |
| D. MCP Tool Auto-Call | Claude instruction | Adds latency, but flexible |
⭐ Recommended: Option A (UserPromptSubmit Hook)
The hook already fires on every prompt. We can extend it to:
- Fetch last 3 kontasks (user's scope, completed or mine)
- Extract: title, summary, key decisions, files touched
- Inject as
<recent-context>block - Keep it concise (~500 tokens max)
📝 What to Include in Context
<recent-context> Last 3 kontasks for johnathon: 1. [completed] "Turn: Fix notification badge" (2 min ago) - Fixed unread count display in nav - Files: konui/src/views/layout.ts, admin-broadcast.ts - Commit: 4593ff7b 2. [completed] "WebSocket broadcast phases 3-5" (15 min ago) - Implemented client handlers for login/logout events - Files: konui/src/views/layout.ts, styles.ts - Commit: 602a1610 3. [pending] "Review: Database schema change" (1 hour ago) - Awaiting your approval for new fields </recent-context>
⚠️ Token Budget Concern
Full kontask output can be 2000+ tokens each. We should extract a summary not the full HTML. Options:
- Parse HTML for key sections (title, files, commit)
- Add a
context.summaryfield when creating kontasks - Limit to ~200 tokens per kontask (~600 total)
What's Next?
Choose an action:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
kontaskscontextkonsoleperformance
Created
8 Jan 2026, 10:42 am
Updated
8 Jan 2026, 10:42 am
Timing
⏱️ 46.6s
0 tools
● TTFE 0%
● Thinking 100%
● Tools 0%
Created By
claude
Raw Data
{
"id": "515b507c-5ab6-458a-b81c-2b38f41ec514",
"type": "general",
"status": "completed",
"title": "Auto-load Recent Kontasks on Turn Start",
"description": "Proposal to read recent kontasks at turn start for better context continuity",
"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;\">💡 Auto-Load Recent Kontasks on Turn Start</h2>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#22c55e;margin:0 0 12px 0;\">✓ You're Absolutely Right</h3>\n<p style=\"margin:0;line-height:1.6;\">We're creating rich kontask outputs with valuable context (what was done, decisions made, code changes, next steps) but then <strong style=\"color:#f59e0b;\">throwing it all away</strong> when the next turn starts. Claude has to rediscover what was just completed.</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;\">📊 Current Flow (Wasteful)</h3>\n<pre style=\"margin:0;color:#98c379;\">\nTurn 1: Does work → Creates kontask with rich output\nTurn 2: Starts fresh → Hunts for what was done → Reads files, greps, explores\n └── Kontask from Turn 1 sitting RIGHT THERE, ignored\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#c678dd;margin:0 0 12px 0;\">🎯 Proposed Flow (Smart)</h3>\n<pre style=\"margin:0;color:#98c379;\">\nTurn N starts:\n 1. Hook/system reads last 3 kontasks (mine + completed)\n 2. Injects summary into system prompt or first message\n 3. Claude immediately knows:\n - What was just done\n - What files were touched\n - What decisions were made\n - What the user approved/rejected\n</pre>\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;\">🔧 Implementation Options</h3>\n<table style=\"width:100%;border-collapse:collapse;\">\n<tr style=\"border-bottom:1px solid #4b5563;\">\n<th style=\"text-align:left;padding:8px;color:#fff;\">Option</th>\n<th style=\"text-align:left;padding:8px;color:#fff;\">Where</th>\n<th style=\"text-align:left;padding:8px;color:#fff;\">Pros/Cons</th>\n</tr>\n<tr style=\"border-bottom:1px solid #4b5563;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">A.</span> UserPromptSubmit Hook</td>\n<td style=\"padding:8px;\">konsole kontext.ts</td>\n<td style=\"padding:8px;\">Already have hook infra, adds to every prompt</td>\n</tr>\n<tr style=\"border-bottom:1px solid #4b5563;\">\n<td style=\"padding:8px;\"><span style=\"color:#3b82f6;\">B.</span> System Prompt Injection</td>\n<td style=\"padding:8px;\">konsole spawn</td>\n<td style=\"padding:8px;\">One-time at session start, stale after first turn</td>\n</tr>\n<tr style=\"border-bottom:1px solid #4b5563;\">\n<td style=\"padding:8px;\"><span style=\"color:#8b5cf6;\">C.</span> CLAUDE.md Dynamic Section</td>\n<td style=\"padding:8px;\">Generate on spawn</td>\n<td style=\"padding:8px;\">Gets cached, reduces freshness</td>\n</tr>\n<tr>\n<td style=\"padding:8px;\"><span style=\"color:#f59e0b;\">D.</span> MCP Tool Auto-Call</td>\n<td style=\"padding:8px;\">Claude instruction</td>\n<td style=\"padding:8px;\">Adds latency, but flexible</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#1e3a5f;border:1px solid #3b82f6;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#3b82f6;margin:0 0 12px 0;\">⭐ Recommended: Option A (UserPromptSubmit Hook)</h3>\n<p style=\"margin:0 0 12px 0;\">The hook already fires on every prompt. We can extend it to:</p>\n<ol style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li>Fetch last 3 kontasks (user's scope, completed or mine)</li>\n<li>Extract: title, summary, key decisions, files touched</li>\n<li>Inject as <code style=\"background:#2d2d2d;padding:2px 6px;border-radius:3px;\"><recent-context></code> block</li>\n<li>Keep it concise (~500 tokens max)</li>\n</ol>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#fff;margin:0 0 12px 0;\">📝 What to Include in Context</h3>\n<pre style=\"margin:0;color:#7f848e;\">\n<recent-context>\nLast 3 kontasks for johnathon:\n\n1. [completed] \"Turn: Fix notification badge\" (2 min ago)\n - Fixed unread count display in nav\n - Files: konui/src/views/layout.ts, admin-broadcast.ts\n - Commit: 4593ff7b\n\n2. [completed] \"WebSocket broadcast phases 3-5\" (15 min ago)\n - Implemented client handlers for login/logout events\n - Files: konui/src/views/layout.ts, styles.ts\n - Commit: 602a1610\n\n3. [pending] \"Review: Database schema change\" (1 hour ago)\n - Awaiting your approval for new fields\n</recent-context>\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#ef4444;margin:0 0 12px 0;\">⚠️ Token Budget Concern</h3>\n<p style=\"margin:0;line-height:1.6;\">Full kontask output can be 2000+ tokens each. We should extract a <strong>summary</strong> not the full HTML. Options:</p>\n<ul style=\"margin:8px 0 0 0;padding-left:20px;line-height:1.8;\">\n<li>Parse HTML for key sections (title, files, commit)</li>\n<li>Add a <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:3px;\">context.summary</code> field when creating kontasks</li>\n<li>Limit to ~200 tokens per kontask (~600 total)</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;\">\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>",
"choices": [
{
"label": "Implement Option A",
"value": "Implement the UserPromptSubmit hook enhancement to auto-load last 3 kontasks on every turn. Start with konsole/kontext.ts modifications.",
"primary": true
},
{
"label": "Add summary field first",
"value": "First add a context.summary field to kontask creation so we have clean summaries to inject, then implement the hook"
},
{
"label": "Prototype with MCP",
"value": "Try Option D first - add a CLAUDE.md instruction to always call konui_list_tasks at turn start, see if it helps before building hook infrastructure"
},
{
"label": "Discuss more",
"value": "Let's discuss the token budget and what exactly should be in the injected context before implementing"
}
],
"requestedAt": "2025-01-08T10:30:00Z",
"requestId": "9c099ec4-7f96-46cc-932d-ca5e57834a1c",
"turnTiming": {
"totalMs": 46650,
"ttfeMs": 139,
"thinkingMs": 46509,
"toolExecutionMs": 0,
"toolCallCount": 0,
"thinkingPct": 100,
"toolsPct": 0,
"ttfePct": 0
}
},
"createdBy": "claude",
"createdAt": "2026-01-08T00:42:47.234Z",
"updatedAt": "2026-01-08T00:42:52.034Z",
"requestId": "9c099ec4-7f96-46cc-932d-ca5e57834a1c",
"scope": "vibetools",
"tags": [
"kontasks",
"context",
"konsole",
"performance"
],
"targetUser": "claude"
}