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

Open
opened 2026-02-16 17:40:36 -05:00 by yindo · 1 comment
Owner

Originally created by @modelnova-ai on GitHub (Dec 15, 2025).

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.

Originally created by @modelnova-ai on GitHub (Dec 15, 2025). ### Feature hasn't been suggested before. - [x] 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.
yindo added the discussion label 2026-02-16 17:40:36 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 15, 2025):

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

  • #4801: [FEATURE]: Print some info when exiting: title, command to resume, usage stats

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

@github-actions[bot] commented on GitHub (Dec 15, 2025): This issue might be a duplicate of existing issues. Please check: - #4801: [FEATURE]: Print some info when exiting: title, command to resume, usage stats Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3547