feat: Add /stats command for token usage statistics #7346

Closed
opened 2026-02-16 18:06:54 -05:00 by yindo · 2 comments
Owner

Originally created by @ajjucoder on GitHub (Jan 23, 2026).

Originally assigned to: @thdxr on GitHub.

Description

Currently there's no easy way to view token usage statistics and activity history in OpenCode. Users have to manually calculate their usage or check external dashboards.

Proposed Solution

Add a /stats slash command that opens a dialog showing:

  1. Activity Heatmap - GitHub-style contribution graph showing daily token usage intensity

    • 3 view modes: 7 days, 30 days, 1 year (toggle with Shift+R)
  2. Token Summaries - Side-by-side comparison of 7-day and 30-day stats

    • Input/Output/Cache tokens
    • Session count
    • Cost estimate
  3. Model Usage Breakdown - Visual bar charts showing token distribution by model

Benefits

  • Quick visibility into usage patterns
  • Helps users understand their token consumption
  • Identifies which models are being used most
  • Provides cost awareness

Related

  • PR #6313 - Separate context window and session stats in sidebar
  • PR #6860 - Display Google Gemini cached token stats

This feature provides a more comprehensive, dedicated view for statistics rather than sidebar-based stats.

Originally created by @ajjucoder on GitHub (Jan 23, 2026). Originally assigned to: @thdxr on GitHub. ## Description Currently there's no easy way to view token usage statistics and activity history in OpenCode. Users have to manually calculate their usage or check external dashboards. ## Proposed Solution Add a `/stats` slash command that opens a dialog showing: 1. **Activity Heatmap** - GitHub-style contribution graph showing daily token usage intensity - 3 view modes: 7 days, 30 days, 1 year (toggle with Shift+R) 2. **Token Summaries** - Side-by-side comparison of 7-day and 30-day stats - Input/Output/Cache tokens - Session count - Cost estimate 3. **Model Usage Breakdown** - Visual bar charts showing token distribution by model ## Benefits - Quick visibility into usage patterns - Helps users understand their token consumption - Identifies which models are being used most - Provides cost awareness ## Related - PR #6313 - Separate context window and session stats in sidebar - PR #6860 - Display Google Gemini cached token stats This feature provides a more comprehensive, dedicated view for statistics rather than sidebar-based stats.
yindo closed this issue 2026-02-16 18:06:54 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 23, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6767: [Feature Request] Implement /stats command for visual usage insights (similar to Claude Code)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #6767: [Feature Request] Implement /stats command for visual usage insights (similar to Claude Code) Feel free to ignore if none of these address your specific case.
Author
Owner

@ajjucoder commented on GitHub (Jan 23, 2026):

Closing as duplicate of #6767. PR #10234 implements this feature.

@ajjucoder commented on GitHub (Jan 23, 2026): Closing as duplicate of #6767. PR #10234 implements this feature.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7346