Skip to content

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

Closed

Description

@ajjucoder

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

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

Activity

  1. github-actions commented on Jan 23, 2026

    @github-actions
    Contributor

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

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

  2. ajjucoder commented on Jan 23, 2026

    @ajjucoder
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions