feat: Add compaction detection and context efficiency analysis (closes #69)#74
Conversation
…#69) Add result_size_bytes column to track message sizes for context burn rate analysis. Detect compaction events during ingestion when summaries contain "continued from a previous conversation" marker. Provide 4 new endpoints for analyzing context efficiency: get_compaction_events, get_pre_compaction_events, get_large_tool_results, and get_session_efficiency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds compaction detection and context efficiency analysis capabilities: a new Issues FoundCriticalNone ImportantNone Suggestions
VerdictREQUEST_CHANGES - Minor suggestions for consistency and issue spec alignment. Automated review by Claude Code |
- Add CLI formatter for get_pre_compaction_events for consistency - Add read_to_edit_ratio metric to get_session_efficiency - Add files_read_multiple_times metric to get_session_efficiency - Update guide.md documentation with new metrics Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feedback AddressedImplemented
|
Code ReviewSummaryThis PR adds compaction detection and context efficiency analysis capabilities: a new Issues FoundCriticalNone ImportantNone SuggestionsNone Previous Feedback StatusThe previous review identified two suggestions:
Notes
VerdictAPPROVE - Code looks good, no issues found. All previous feedback has been addressed. Automated review by Claude Code |
Summary
result_size_bytescolumn to track message sizes for context burn rate analysisget_compaction_events- List context reset eventsget_pre_compaction_events- Show events before a compactionget_large_tool_results- Find bloated tool results consuming contextget_session_efficiency- Analyze burn rate and efficiency metricsTest plan
get_pre_compaction_events(3 tests)calculate_result_sizeanddetect_compactionhelpers (14 tests)🤖 Generated with Claude Code