claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

/stats graph displays 12-month period while local history defaults to 30-day retention

Open shostako opened this issue 1 week ago • 0 comments

Image

Problem

The /stats command displays a GitHub-style contribution graph spanning 12 months (Dec → Jan → ... → Dec), but the local conversation history (~/.claude/projects/) defaults to 30-day retention via cleanupPeriodDays.

This creates a misleading visualization where:

  • Only ~1 month of data appears on the right edge
  • The remaining ~11 months are filled with empty dots
  • The stats footer even acknowledges this: "Stats from the last 39 days"

Screenshot

Current Behavior

The graph always shows a full year regardless of available data, resulting in mostly empty visualizations for users who haven't modified the default retention period.

Suggested Improvement

Consider one of these approaches:

  1. Match graph period to cleanupPeriodDays: Default to 30-day graph, extend only if user has configured longer retention
  2. Add period selector: Allow users to toggle between "30 days", "90 days", "1 year" views
  3. Auto-scale: Detect actual data range and scale the graph accordingly

Environment

  • Claude Code version: v2.0.72
  • OS: Windows (WSL)

Additional Context

The GitHub contribution graph works because GitHub retains a full year of data. Adopting the same UI pattern without matching data retention creates a UX inconsistency.

shostako avatar Dec 19 '25 11:12 shostako