anomalyco / anomalyco/opencode

[FEATURE]: /usage — dedicated session token & cost report (alias /cost)

Open
#41,915 3 comments 0 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 12, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Requested feature

Add a /usage slash command (alias /cost) producing a dedicated report of session token consumption and financial cost.

Why

Today cost/token info is only a compact inline line in the sidebar footer (packages/tui/src/feature-plugins/sidebar/context.tsx). A dedicated report would give per-message and cumulative accounting.

Proposed behavior

  • /usage opens a report: per-message tokens (input/output/reasoning/cache), cumulative totals, and estimated cost { amount, currency } (data already tracked, see packages/opencode/src/acp/usage.ts).
  • Showables: per session, per day, or since a date; exportable as markdown.
  • Optionally aggregate across all providers used.

Benefits

  • Financial/cost visibility (LLM spend) without external tooling.
  • Analogous to /cost in other CLIs; complements /context for window size vs /usage for spend.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.