Repository navigation
Description
Summary
v1 opencode stats --days N showed input, output, cache read, and cache write so cache hit rate was obvious. v2 opencode2 stats --days N only prints a total token count; the old breakdown requires combining --days and --cost, which is easy to miss or mix up.
Environment
- opencode version: 0.0.0-beta-19151 (
opencode2); compared against stableopencode1.18.16 - OS: Microsoft Windows [Version 10.0.26200.9278] (Windows_NT 10.0.26200, win32 x64)
- Terminal: TERM=xterm-256color; TERM_PROGRAM and COLORTERM unset
- Shell: C:\WINDOWS\system32\cmd.exe
- Install/channel: beta (
opencode2via npm@opencode-ai/cli) - Active plugins: none (
plugins: []in config)
Reproduction
- On v1, run
opencode stats --days 1and note the COST & TOKENS section (Input, Output, Cache Read, Cache Write). - On v2 beta, run
opencode2 stats --days 1. The default view shows only an aggregate token count (for example32.6m tokens) with no input/output/cache split. - Run
opencode2 stats --cost. This shows the token/cache breakdown, but the range is year-to-date (2026 so far), not the last N days. - Run
opencode2 stats --days 1 --cost(or--cost --days 1). The breakdown appears for the requested window, includingcached input.
Expected Behavior
opencode2 stats --days N should include cost and token details (input, output, reasoning, cache read/write, cache hit rate) in the default view, matching v1. Users should not need a second flag to inspect cache hit rate for a day range.
Actual Behavior
Default opencode2 stats --days N omits the breakdown:
opencode stats · today · all projects
20 sessions · 24 subagents
47 prompts · 589 steps · 32.6m tokens
98.1% tool success · 1 active day · best streak 1 day
--cost alone defaults to the calendar year:
2026 so far · all projects
COST & TOKENS
cost $493.76
input 510.7m
output 25.7m
reasoning 9.5m
cache read 3.1b
cache write 30.1m
cached input 85.3%
Combining both flags works and flag order does not matter, but it is more complex than v1 and easy to mix up. --json also contains the per-range token/cache fields, so the data is available; it is just hidden from the default --days output.
Additional Context
- Reproduces every time.
- Workaround:
opencode2 stats --days N --cost(also--full). - v1 help had
--daysand always showed COST & TOKENS. v2 help adds--cost/--full/--json, so the split is intentional, but it regresses the common “last N days, what was my cache hit rate?” workflow. - Sample from this machine:
--days 1 --costreportedcached input 85.7%;--days 7 --costreported90.3%.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed comparison with v1, @its-peter-yall!
In v2,
opencode statskeeps the time range (--days,--year,--all) separate from the detail sections (--models,--tools,--cost,--full). The COST & TOKENS breakdown only appears with--costor--full, and without a range flag the window is the current year. So the current output is how the command was designed, not a bug. You're asking for the input/output/reasoning/cache breakdown and cache hit rate to show by default with--days N, as v1 did, so it's easy to check the cache hit rate for a recent window.I've passed this on as a feature request for the maintainers to consider. Until then,
opencode2 stats --days N --cost(or--full) shows the breakdown for the window you want, as you found.