feat: Add limit parameters and efficiency metrics (closes #77, #78, #79)#80
Conversation
## Issue #77: Limit parameters for verbose endpoints - Add `limit` parameter to get_tool_sequences (default: 50) - Add `limit` parameter to get_compaction_events (default: 50) - Add `limit` parameter to get_session_efficiency (default: 50) - Return total_patterns/total_compaction_count for pagination awareness - Use parameterized queries for LIMIT clauses (SQL injection prevention) ## Issue #78: Efficiency metrics in analyze_trends - Add compactions, avg_compactions_per_session to trend comparison - Add files_read_multiple_times as rework indicator - Add avg_result_mb_per_session for context consumption tracking ## Issue #79: Efficiency metrics in classify_sessions - Add efficiency object to each session with: - compaction_count, total_result_mb, files_read_multiple_times - burn_rate: "high" (>2/hr), "medium" (0.5-2/hr), "low" (<0.5/hr) ## Additional improvements - Filter non-actionable commands (pwd, cd, echo, etc.) from permission gaps - Update guide.md with new parameters and efficiency documentation - Add 6 new tests for all new functionality Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds Issues FoundCriticalNone Important
Suggestions
VerdictREQUEST_CHANGES - CLI commands need Automated review by Claude Code |
Address reviewer feedback from claude-review:
- Add --limit parameter to sequences, compactions, efficiency commands
- Show truncation info in formatters ("Showing X of Y total")
- Maintain CLI/MCP parity as required by CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feedback AddressedImplemented
|
Code ReviewSummaryThis PR adds Previous Feedback VerifiedAll items from the previous review have been addressed:
Issues FoundCriticalNone ImportantNone SuggestionsNone VerdictAPPROVE - Code looks good, no issues found. The implementation correctly addresses all three linked issues:
Test coverage is comprehensive with 6 new tests covering all the new functionality. Automated review by Claude Code |
Summary
limitparameter to verbose endpoints (get_tool_sequences,get_compaction_events,get_session_efficiency) to prevent context overflow in MCP responsesanalyze_trends()for tracking workflow improvements over timeclassify_sessions()with burn_rate classificationChanges
Limit Parameters (#77)
get_tool_sequences(limit=50)- returnstotal_patternsfor pagination awarenessget_compaction_events(limit=50)- returnstotal_compaction_countfor full countget_session_efficiency(limit=50)- limits sessions returnedEfficiency Metrics in Trends (#78)
compactions- context reset count comparisonavg_compactions_per_session- normalized metricfiles_read_multiple_times- rework indicatoravg_result_mb_per_session- context consumptionEfficiency Metrics in Sessions (#79)
efficiencyobject with:compaction_count,total_result_mb,files_read_multiple_timesburn_rate: "high" (>2/hr), "medium" (0.5-2/hr), "low" (<0.5/hr)Additional Improvements
Test plan
make checkpasses (format, lint, test)🤖 Generated with Claude Code