feat: Add progressive disclosure usage instructions to context hook output

This commit is contained in:
Alex Newman
2025-10-25 01:36:39 -04:00
parent 50d504715d
commit 77885db345
2 changed files with 34 additions and 19 deletions
+15
View File
@@ -224,6 +224,21 @@ export function contextHook(input?: SessionStartInput, useColors: boolean = fals
output.push('');
}
// Progressive Disclosure Usage Instructions
if (useColors) {
output.push(`${colors.dim}💡 Progressive Disclosure: This index shows WHAT exists (titles) and retrieval COST (token counts).${colors.reset}`);
output.push(`${colors.dim} → Use MCP search tools to fetch full observation details on-demand (Layer 2)${colors.reset}`);
output.push(`${colors.dim} → Prefer searching observations over re-reading code for past decisions and learnings${colors.reset}`);
output.push(`${colors.dim} → Critical types (🔴 gotcha, 🟤 decision, ⚖️ trade-off) often worth fetching immediately${colors.reset}`);
output.push('');
} else {
output.push(`💡 **Progressive Disclosure:** This index shows WHAT exists (titles) and retrieval COST (token counts).`);
output.push(`- Use MCP search tools to fetch full observation details on-demand (Layer 2)`);
output.push(`- Prefer searching observations over re-reading code for past decisions and learnings`);
output.push(`- Critical types (🔴 gotcha, 🟤 decision, ⚖️ trade-off) often worth fetching immediately`);
output.push('');
}
// Create unified timeline with both observations and summaries
const mostRecentSummaryId = recentSummaries[0]?.id;