Skip to content

RFC: Integrate session-analytics into /status-report #106

Description

@evansenter

Summary

Add session analytics data to /status-report to provide richer context about work patterns, session health, and Claude Code usage beyond GitHub state.

Problem / Motivation

The current /status-report focuses on GitHub state (PRs, issues, worktrees, event bus). While useful for understanding what's open and merged, it misses:

  • Session health: Error rates, rework patterns that indicate friction
  • Tool usage: What tools are being used most, command patterns
  • Permission gaps: Commands that should be added to settings.json

The claude-session-analytics MCP server now provides these signals via:

  • get_session_signals() - raw session metrics
  • get_tool_frequency() - tool usage counts
  • get_permission_gaps() - commands needing permissions

Context

Proposed Solution

Add a new section to /status-report that queries session-analytics MCP tools and displays raw signals. Per RFC #17, we pass raw data and let the LLM generating the report interpret meaning.

New Section: Session Analytics

### Session Analytics (7 days)

**Overview**
| Metric | Value |
|--------|-------|
| Sessions | 12 |
| Events | 2,847 |
| Errors | 41 (1.4%) |

**Recent Sessions** (top 5 by event count)
| Session | Events | Errors | Commits | Flags |
|---------|--------|--------|---------|-------|
| abc123 | 450 | 2 (0.4%) | 3 | PR |
| def456 | 120 | 15 (12.5%) | 0 | rework |

**Top Tools** (last 7 days)
Read (892), Edit (341), Bash (298), Grep (156)

**Permission Gaps** (commands to add to settings.json)
| Command | Count | Suggestion |
|---------|-------|------------|
| npm test | 23 | Bash(npm test:*) |
| cargo clippy | 18 | Bash(cargo clippy:*) |

Graceful Degradation

If session-analytics MCP is unavailable:

  1. Try CLI fallback: session-analytics-cli status --json
  2. If that fails, skip section with note: "Session analytics unavailable"

Integration with Recommendations

The LLM can use raw signals to inform recommendations:

  • High error rate in a session → suggest investigating
  • Permission gaps → suggest adding to settings.json
  • Rework patterns → note potential friction

Important: The analytics section provides raw data. The LLM interprets it contextually when generating recommendations - no pre-baked conclusions.

Assumptions

Assumption Confidence Impact if Wrong
session-analytics MCP available High Section skipped gracefully
CLI fallback works High Can shell out if MCP fails
Data is fresh (<5min) High Auto-refresh built into queries

Open Questions

  1. Project filter: Should we filter to current project only, or show cross-project data?
  2. Time window: Default to 7 days, or make configurable?

Actionable Requirements

# Requirement Owner Blocked By
1 Add session-analytics MCP calls to status-report.md Claude None
2 Format raw signals in readable tables Claude #1
3 Add graceful fallback if analytics unavailable Claude #1
4 Update recommendation logic to consider signals Claude #2

Implementation Checklist

  • Add mcp__session-analytics__get_status() check
  • Add mcp__session-analytics__get_session_signals(days=7) call
  • Add mcp__session-analytics__get_tool_frequency(days=7) call
  • Add mcp__session-analytics__get_permission_gaps(days=7) call
  • Format output in Session Analytics section
  • Add CLI fallback for graceful degradation
  • Update recommendation section to reference signals

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions