Skip to content

[FEATURE]: Session-specific stats command and exit summary #5555

Closed

Description

@modelnova-ai

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Current Behavior:

  • opencode stats shows aggregate statistics across all sessions
  • Token and cost details are shown during the session
  • No way to see detailed session stats or get a summary when exiting

Requested Feature:
Add a /stats command to view current session statistics, and automatically show the same summary when quitting.

Why this would be helpful:

  • See performance details like tool call success rates and cost breakdown
  • Get a complete view of token usage (input/output/cache) in one place
  • Check how much is being spent on the current session
  • Get immediate feedback on session efficiency when wrapping up

Example output:

Agent powering down. Goodbye!

Interaction Summary
Session ID:           ses_4de4db894ffekihkp0YJ6o352F
Tool Calls:          1 (✓ 1 × 0)
Success Rate:        100.0%

Performance
Wall Time:           2s
LLM Requests:        3
Total Tokens:        29.3K
  Input Tokens:      20.3K
  Output Tokens:     534
  Cache Tokens:      8.4K
Total Cost:          $0.0000

Model Usage
Model                Reqs    Input      Output
big-pickle           3       20.3K      534

Tool Usage (Top 5)
Tool                 Calls   Success    Errors
task                 1       1          0

Savings Highlight: 8.4K (29.4%) of input tokens were served from cache.

» Tip: For historical stats, run `opencode stats`.

This would complement the existing opencode stats command, which remains useful for historical analysis.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 15, 2025
  2. github-actions commented on Dec 15, 2025

    @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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions